comparison Framework/Viewport/CairoSurface.h @ 561:1201b12eb9f8 dev

merge default -> dev
author Alain Mazy <alain@mazy.be>
date Thu, 18 Apr 2019 09:30:00 +0200
parents aaeec7be8fb7
children
comparison
equal deleted inserted replaced
558:d5579bdc59b5 561:1201b12eb9f8
34 cairo_surface_t* surface_; 34 cairo_surface_t* surface_;
35 unsigned int width_; 35 unsigned int width_;
36 unsigned int height_; 36 unsigned int height_;
37 unsigned int pitch_; 37 unsigned int pitch_;
38 void* buffer_; 38 void* buffer_;
39 bool hasAlpha_;
39 40
40 void Release(); 41 void Release();
41 42
42 void Allocate(unsigned int width, 43 void Allocate(unsigned int width,
43 unsigned int height); 44 unsigned int height,
45 bool hasAlpha);
44 46
45 public: 47 public:
46 CairoSurface() : 48 CairoSurface() :
47 surface_(NULL) 49 surface_(NULL)
48 { 50 {
49 Allocate(0, 0); 51 Allocate(0, 0, false);
50 } 52 }
51 53
52 CairoSurface(unsigned int width, 54 CairoSurface(unsigned int width,
53 unsigned int height) : 55 unsigned int height,
56 bool hasAlpha) :
54 surface_(NULL) 57 surface_(NULL)
55 { 58 {
56 Allocate(width, height); 59 Allocate(width, height, hasAlpha);
57 } 60 }
58 61
59 CairoSurface(Orthanc::ImageAccessor& accessor); 62 CairoSurface(Orthanc::ImageAccessor& accessor,
63 bool hasAlpha);
60 64
61 ~CairoSurface() 65 ~CairoSurface()
62 { 66 {
63 Release(); 67 Release();
64 } 68 }
65 69
66 void SetSize(unsigned int width, 70 void SetSize(unsigned int width,
67 unsigned int height); 71 unsigned int height,
72 bool hasAlpha);
68 73
69 void Copy(const CairoSurface& other); 74 void Copy(const CairoSurface& other);
75
76 void Copy(const Orthanc::ImageAccessor& source,
77 bool hasAlpha);
70 78
71 unsigned int GetWidth() const 79 unsigned int GetWidth() const
72 { 80 {
73 return width_; 81 return width_;
74 } 82 }
96 cairo_surface_t* GetObject() 104 cairo_surface_t* GetObject()
97 { 105 {
98 return surface_; 106 return surface_;
99 } 107 }
100 108
109 bool HasAlpha() const
110 {
111 return hasAlpha_;
112 }
113
101 void GetReadOnlyAccessor(Orthanc::ImageAccessor& target) const; 114 void GetReadOnlyAccessor(Orthanc::ImageAccessor& target) const;
102 115
103 void GetWriteableAccessor(Orthanc::ImageAccessor& target); 116 void GetWriteableAccessor(Orthanc::ImageAccessor& target);
104 }; 117 };
105 } 118 }