Magick++ 6.9.13
Loading...
Searching...
No Matches
Montage.h
1// This may look like C code, but it is really -*- C++ -*-
2//
3// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4//
5// Definition of Montage class used to specify montage options.
6//
7
8#if !defined(Magick_Montage_header)
9#define Magick_Montage_header
10
11#include "Magick++/Include.h"
12#include <string>
13#include "Magick++/Color.h"
14#include "Magick++/Geometry.h"
15
16//
17// Basic (Un-framed) Montage
18//
19namespace Magick
20{
21 class MagickPPExport Montage
22 {
23 public:
24
25 Montage(void);
26 virtual ~Montage(void);
27
28 // Color that thumbnails are composed on
29 void backgroundColor(const Color &backgroundColor_);
30 Color backgroundColor(void) const;
31
32 // Composition algorithm to use (e.g. ReplaceCompositeOp)
33 void compose(CompositeOperator compose_);
34 CompositeOperator compose(void) const;
35
36 // Filename to save montages to
37 void fileName(const std::string &fileName_);
38 std::string fileName(void) const;
39
40 // Fill color
41 void fillColor(const Color &fill_);
42 Color fillColor(void) const;
43
44 // Label font
45 void font(const std::string &font_);
46 std::string font(void) const;
47
48 // Thumbnail width & height plus border width & height
49 void geometry(const Geometry &geometry_);
50 Geometry geometry(void) const;
51
52 // Thumbnail position (e.g. SouthWestGravity)
53 void gravity(GravityType gravity_);
54 GravityType gravity(void) const;
55
56 // Thumbnail label (applied to image prior to montage)
57 void label(const std::string &label_);
58 std::string label(void) const;
59
60 // Same as fill color
61 void penColor(const Color &pen_);
62 Color penColor(void) const;
63
64 // Font point size
65 void pointSize(size_t pointSize_);
66 size_t pointSize(void) const;
67
68 // Enable drop-shadows on thumbnails
69 void shadow(bool shadow_);
70 bool shadow(void) const;
71
72 // Outline color
73 void strokeColor(const Color &stroke_);
74 Color strokeColor(void) const;
75
76 // Background texture image
77 void texture(const std::string &texture_);
78 std::string texture(void) const;
79
80 // Thumbnail rows and columns
81 void tile(const Geometry &tile_);
82 Geometry tile(void) const;
83
84 // Montage title
85 void title(const std::string &title_);
86 std::string title(void) const;
87
88 // Transparent color
89 void transparentColor(const Color &transparentColor_);
90 Color transparentColor(void) const;
91
92 //
93 // Implementation methods/members
94 //
95
96 // Update elements in existing MontageInfo structure
97 virtual void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const;
98
99 private:
100
101 Color _backgroundColor;
102 CompositeOperator _compose;
103 std::string _fileName;
104 Color _fill;
105 std::string _font;
106 Geometry _geometry;
107 GravityType _gravity;
108 std::string _label;
109 size_t _pointSize;
110 bool _shadow;
111 Color _stroke;
112 std::string _texture;
113 Geometry _tile;
114 std::string _title;
115 Color _transparentColor;
116 };
117
118 //
119 // Montage With Frames (Extends Basic Montage)
120 //
121 class MagickPPExport MontageFramed : public Montage
122 {
123 public:
124
125 MontageFramed(void);
126 ~MontageFramed(void);
127
128 // Frame border color
129 void borderColor(const Color &borderColor_);
130 Color borderColor(void) const;
131
132 // Pixels between thumbnail and surrounding frame
133 void borderWidth(size_t borderWidth_);
134 size_t borderWidth(void) const;
135
136 // Frame geometry (width & height frame thickness)
137 void frameGeometry(const Geometry &frame_);
138 Geometry frameGeometry(void) const;
139
140 // Frame foreground color
141 void matteColor(const Color &matteColor_);
142 Color matteColor(void) const;
143
144 //
145 // Implementation methods/members
146 //
147
148 // Update elements in existing MontageInfo structure
149 void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const;
150
151 private:
152
153 Color _borderColor;
154 size_t _borderWidth;
155 Geometry _frame;
156 Color _matteColor;
157 };
158} // namespace Magick
159
160//
161// Inlines
162//
163
164//
165// Implementation of Montage
166//
167
168inline void Magick::Montage::backgroundColor(const Magick::Color &backgroundColor_)
169{
170 _backgroundColor=backgroundColor_;
171}
172
173inline Magick::Color Magick::Montage::backgroundColor(void) const
174{
175 return(_backgroundColor);
176}
177
178inline void Magick::Montage::compose(Magick::CompositeOperator compose_)
179{
180 _compose=compose_;
181}
182
183inline Magick::CompositeOperator Magick::Montage::compose(void) const
184{
185 return(_compose);
186}
187
188inline void Magick::Montage::fileName(const std::string &fileName_)
189{
190 _fileName=fileName_;
191}
192
193inline std::string Magick::Montage::fileName(void) const
194{
195 return(_fileName);
196}
197
198inline void Magick::Montage::fillColor(const Color &fill_)
199{
200 _fill=fill_;
201}
202
203inline Magick::Color Magick::Montage::fillColor(void) const
204{
205 return(_fill);
206}
207
208inline void Magick::Montage::font(const std::string &font_)
209{
210 _font=font_;
211}
212
213inline std::string Magick::Montage::font(void) const
214{
215 return(_font);
216}
217
218inline void Magick::Montage::geometry(const Magick::Geometry &geometry_)
219{
220 _geometry=geometry_;
221}
222
223inline Magick::Geometry Magick::Montage::geometry(void) const
224{
225 return(_geometry);
226}
227
228inline void Magick::Montage::gravity(Magick::GravityType gravity_)
229{
230 _gravity=gravity_;
231}
232
233inline Magick::GravityType Magick::Montage::gravity(void) const
234{
235 return(_gravity);
236}
237
238inline void Magick::Montage::label(const std::string &label_)
239{
240 _label=label_;
241}
242
243inline std::string Magick::Montage::label(void) const
244{
245 return(_label);
246}
247
248inline void Magick::Montage::penColor(const Color &pen_)
249{
250 _fill=pen_;
251 _stroke=Color("none");
252}
253
254inline Magick::Color Magick::Montage::penColor(void) const
255{
256 return _fill;
257}
258
259inline void Magick::Montage::pointSize(size_t pointSize_)
260{
261 _pointSize=pointSize_;
262}
263
264inline size_t Magick::Montage::pointSize(void) const
265{
266 return(_pointSize);
267}
268
269inline void Magick::Montage::shadow(bool shadow_)
270{
271 _shadow=shadow_;
272}
273
274inline bool Magick::Montage::shadow(void) const
275{
276 return(_shadow);
277}
278
279inline void Magick::Montage::strokeColor(const Color &stroke_)
280{
281 _stroke=stroke_;
282}
283
284inline Magick::Color Magick::Montage::strokeColor(void) const
285{
286 return(_stroke);
287}
288
289inline void Magick::Montage::texture(const std::string &texture_)
290{
291 _texture=texture_;
292}
293
294inline std::string Magick::Montage::texture(void) const
295{
296 return(_texture);
297}
298
299inline void Magick::Montage::tile(const Geometry &tile_)
300{
301 _tile=tile_;
302}
303
304inline Magick::Geometry Magick::Montage::tile(void) const
305{
306 return(_tile);
307}
308
309inline void Magick::Montage::title(const std::string &title_)
310{
311 _title=title_;
312}
313
314inline std::string Magick::Montage::title(void) const
315{
316 return(_title);
317}
318
319inline void Magick::Montage::transparentColor(const Magick::Color &transparentColor_)
320{
321 _transparentColor=transparentColor_;
322}
323
324inline Magick::Color Magick::Montage::transparentColor(void) const
325{
326 return(_transparentColor);
327}
328
329//
330// Implementation of MontageFramed
331//
332
333inline void Magick::MontageFramed::borderColor(const Magick::Color &borderColor_)
334{
335 _borderColor=borderColor_;
336}
337
338inline Magick::Color Magick::MontageFramed::borderColor(void) const
339{
340 return(_borderColor);
341}
342
343inline void Magick::MontageFramed::borderWidth(size_t borderWidth_)
344{
345 _borderWidth=borderWidth_;
346}
347
348inline size_t Magick::MontageFramed::borderWidth(void) const
349{
350 return(_borderWidth);
351}
352
353inline void Magick::MontageFramed::frameGeometry(const Magick::Geometry &frame_)
354{
355 _frame=frame_;
356}
357
358inline Magick::Geometry Magick::MontageFramed::frameGeometry(void) const
359{
360 return(_frame);
361}
362
363inline void Magick::MontageFramed::matteColor(const Magick::Color &matteColor_)
364{
365 _matteColor=matteColor_;
366}
367
368inline Magick::Color Magick::MontageFramed::matteColor(void) const
369{
370 return(_matteColor);
371}
372
373#endif // Magick_Montage_header