Audacity 3.2.0
ImageRoll.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ImageRoll.h
6
7 Dominic Mazzoni
8
9
10**********************************************************************/
11
12#ifndef __AUDACITY_IMAGE_ROLL__
13#define __AUDACITY_IMAGE_ROLL__
14
15#include <vector>
16// #include <wx/dc.h> // for enum wxRasterOperationMode
17#include <wx/defs.h>
18#include "wxPanelWrapper.h" // to inherit
19
20#if !wxCHECK_VERSION(3,0,0)
21#define wxRasterOperationMode int
22#endif
23
24// wxImage copies cheaply with reference counting
25using ImageArray = std::vector<wxImage>;
26
27class AUDACITY_DLL_API ImageRoll
28{
29 public:
30 enum RollType {
35 Frame
36 };
37
38 ImageRoll();
39 ImageRoll(const wxImage &src);
40 ImageRoll(RollType type, const wxImage &src, wxColour magicColor);
42 ImageRoll &operator =(const ImageRoll&);
44
45 bool Ok() const;
46
47 wxSize GetMinSize() const { return mMinSize; }
48 wxSize GetMaxSize() const { return mMaxSize; }
49
50 void Draw(wxDC &dc, wxRect rect,
51 int /* wxRasterOperationMode */ logicalFunc);
52 void Draw(wxDC &dc, wxRect rect); // default logicalFunc to wxCOPY
53
54 static ImageArray SplitH(const wxImage &src, wxColour magicColor);
55 static ImageArray SplitV(const wxImage &src, wxColour magicColor);
56
57 protected:
58
59 void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
60 int x, int y,
61 int /* wxRasterOperationMode */ logicalFunc);
62
63 void Init(RollType type, const wxImage &src, wxColour magicColor);
64
66 // wxBitmap copies cheaply with reference counting
67 std::vector<wxBitmap> mPieces;
68 wxSize mMinSize;
69 wxSize mMaxSize;
70};
71
72#endif // __AUDACITY_IMAGE_ROLL__
wxImage(22, 22)
std::vector< wxImage > ImageArray
Definition: ImageRoll.h:25
An ImageRoll is an image that can be expanded to an arbitrary size; it is made up of both fixed piece...
Definition: ImageRoll.h:28
void Draw(wxDC &dc, wxRect rect, int logicalFunc)
wxSize mMinSize
Definition: ImageRoll.h:68
wxSize GetMaxSize() const
Definition: ImageRoll.h:48
wxSize GetMinSize() const
Definition: ImageRoll.h:47
@ FixedImage
Definition: ImageRoll.h:32
@ VerticalRoll
Definition: ImageRoll.h:34
@ HorizontalRoll
Definition: ImageRoll.h:33
@ Uninitialized
Definition: ImageRoll.h:31
ImageRoll(const ImageRoll &)
std::vector< wxBitmap > mPieces
Definition: ImageRoll.h:67
wxSize mMaxSize
Definition: ImageRoll.h:69
RollType mType
Definition: ImageRoll.h:65