Magick++ 7.1.0

Options.h
Go to the documentation of this file.
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4 //
5 // Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // Definition of Options
9 //
10 // Options which may be applied to an image. These options are the
11 // equivalent of options supplied to ImageMagick utilities.
12 //
13 // This is an internal implementation class and is not part of the
14 // Magick++ API
15 //
16
17 #if !defined(Magick_Options_header)
18 #define Magick_Options_header
19
20 #include "Magick++/Include.h"
21 #include <string>
22 #include "Magick++/Color.h"
23 #include "Magick++/Geometry.h"
24 #include "Magick++/Drawable.h"
25
26 namespace Magick
27 {
28 class Image;
29
30 class Options
31 {
32 public:
33
34 // Default constructor
35 Options(void);
36
37 // Copy constructor
38 Options(const Options& options_);
39
40 // Destructor
41 ~Options();
42
43 // Join images into a single multi-image file
44 void adjoin(const bool flag_);
45 bool adjoin(void) const;
46
47 // Transparent color
48 void matteColor(const Color &matteColor_);
49 Color matteColor(void) const;
50
51 // Image background color
52 void backgroundColor(const Color &color_);
53 Color backgroundColor(void) const;
54
55 // Name of texture image to tile onto the image background
56 void backgroundTexture(const std::string &backgroundTexture_);
57 std::string backgroundTexture(void) const;
58
59 // Image border color
60 void borderColor(const Color &color_);
61 Color borderColor(void) const;
62
63 // Text bounding-box base color (default none)
64 void boxColor(const Color &boxColor_);
65 Color boxColor(void) const;
66
67 // Colors within this distance are considered equal
68 void colorFuzz(const double fuzz_);
69 double colorFuzz(void) const;
70
71 // Image colorspace scheme
72 void colorspaceType(const ColorspaceType colorspace_);
73 ColorspaceType colorspaceType(void) const;
74
75 // Compression type ( NoCompression, BZipCompression,
76 // FaxCompression, JPEGCompression, LZWCompression,
77 // RLECompression, or ZipCompression )
78 void compressType(const CompressionType compressType_);
79 CompressionType compressType(void) const;
80
81 // Enable printing of debug messages from ImageMagick
82 void debug(const bool flag_);
83 bool debug(void) const;
84
85 // Vertical and horizontal resolution in pixels of the image
86 void density(const Point &density_);
87 Point density(void) const;
88
89 // Image depth (8 or 16)
90 void depth(const size_t depth_);
91 size_t depth(void) const;
92
93 // Endianness (little like Intel or big like SPARC) for image
94 // formats which support endian-specific options.
95 void endian(const EndianType endian_);
96 EndianType endian(void) const;
97
98 // Image filename to read or write
99 void file(FILE *file_);
100 FILE *file(void) const;
101
102 // Image filename to read or write
103 void fileName(const std::string &fileName_);
104 std::string fileName(void) const;
105
106 // Color to use when filling drawn objects
107 void fillColor(const Color &fillColor_);
108 Color fillColor(void) const;
109
110 // Fill pattern
111 void fillPattern(const MagickCore::Image *fillPattern_);
112 const MagickCore::Image *fillPattern(void) const;
113
114 // Rule to use when filling drawn objects
115 void fillRule(const FillRule &fillRule_);
116 FillRule fillRule(void) const;
117
118 // Font name
119 void font(const std::string &font_);
120 std::string font(void) const;
121
122 // Font name
123 void fontFamily(const std::string &family_);
124 std::string fontFamily(void) const;
125
126 // Font point size
127 void fontPointsize(const double pointSize_);
128 double fontPointsize(void) const;
129
130 // Font style
131 void fontStyle(const StyleType style_);
132 StyleType fontStyle(void) const;
133
134 // Font weight
135 void fontWeight(const size_t weight_);
136 size_t fontWeight(void) const;
137
138 std::string format(void) const;
139
140 // Image interlace scheme
141 void interlaceType(const InterlaceType interlace_);
142 InterlaceType interlaceType(void) const;
143
144 // Image format to write or read
145 void magick(const std::string &magick_);
146 std::string magick(void) const;
147
148 // Write as a monochrome image
149 void monochrome(const bool monochromeFlag_);
150 bool monochrome(void) const;
151
152 // Preferred size and location of an image canvas.
153 void page(const Geometry &pageSize_);
154 Geometry page(void) const;
155
156 // Desired image quality factor
157 void quality(const size_t quality_);
158 size_t quality(void) const;
159
160 // Maximum number of colors to quantize to
161 void quantizeColors(const size_t colors_);
162 size_t quantizeColors(void) const;
163
164 // Colorspace to quantize in.
165 void quantizeColorSpace(const ColorspaceType colorSpace_);
166 ColorspaceType quantizeColorSpace(void) const;
167
168 // Dither image during quantization.
169 void quantizeDither(const bool ditherFlag_);
170 bool quantizeDither(void) const;
171
172 // Dither method
173 void quantizeDitherMethod(const DitherMethod ditherMethod_);
174 DitherMethod quantizeDitherMethod(void) const;
175
176 // Quantization tree-depth
177 void quantizeTreeDepth(const size_t treeDepth_);
178 size_t quantizeTreeDepth(void) const;
179
180 // Suppress all warning messages. Error messages are still reported.
181 void quiet(const bool quiet_);
182 bool quiet(void) const;
183
184 // Units of resolution to interpret density
185 void resolutionUnits(const ResolutionType resolutionUnits_);
186 ResolutionType resolutionUnits(void) const;
187
188 // Image sampling factor
189 void samplingFactor(const std::string &samplingFactor_);
190 std::string samplingFactor(void) const;
191
192 // Image size (required for raw formats)
193 void size(const Geometry &geometry_);
194 Geometry size(void) const;
195
196 // enabled/disable stroke anti-aliasing
197 void strokeAntiAlias(const bool flag_);
198 bool strokeAntiAlias(void) const ;
199
200 // Color to use when drawing object outlines
201 void strokeColor(const Color &strokeColor_);
202 Color strokeColor(void) const;
203
204 // Control the pattern of dashes and gaps used to stroke
205 // paths. The strokeDashArray represents a list of numbers that
206 // specify the lengths of alternating dashes and gaps in user
207 // units. If an odd number of values is provided, then the list of
208 // values is repeated to yield an even number of values.
209 void strokeDashArray(const double *strokeDashArray_);
210 const double *strokeDashArray(void) const;
211
212 // While drawing using strokeDashArray, specify distance into the dash
213 // pattern to start the dash (default 0).
214 void strokeDashOffset(const double strokeDashOffset_);
215 double strokeDashOffset(void) const;
216
217 // Specify the shape to be used at the end of open subpaths when
218 // they are stroked. Values of LineCap are UndefinedCap, ButtCap,
219 // RoundCap, and SquareCap.
220 void strokeLineCap(const LineCap lineCap_);
221 LineCap strokeLineCap(void) const;
222
223 // Specify the shape to be used at the corners of paths (or other
224 // vector shapes) when they are stroked. Values of LineJoin are
225 // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
226 void strokeLineJoin(const LineJoin lineJoin_);
227 LineJoin strokeLineJoin(void) const;
228
229 // Specify miter limit. When two line segments meet at a sharp
230 // angle and miter joins have been specified for 'lineJoin', it is
231 // possible for the miter to extend far beyond the thickness of
232 // the line stroking the path. The miterLimit' imposes a limit on
233 // the ratio of the miter length to the 'stroke_width'. The default
234 // value of this parameter is 4.
235 void strokeMiterLimit(const size_t miterLimit_);
236 size_t strokeMiterLimit(void) const;
237
238 // Pattern image to use for stroked outlines
239 void strokePattern(const MagickCore::Image *strokePattern_);
240 const MagickCore::Image *strokePattern(void) const;
241
242 // Stroke width for drawing vector objects (default one)
243 void strokeWidth(const double strokeWidth_);
244 double strokeWidth(void) const;
245
246 void subImage(const size_t subImage_);
247 size_t subImage(void) const;
248
249 // Sub-frame number to return
250 void subRange(const size_t subRange_);
251 size_t subRange(void) const;
252
253 // Remove pixel aliasing
254 void textAntiAlias(const bool flag_);
255 bool textAntiAlias(void) const;
256
257 // Render text right-to-left or left-to-right.
258 void textDirection(const DirectionType direction_);
259 DirectionType textDirection() const;
260
261 // Annotation text encoding (e.g. "UTF-16")
262 void textEncoding(const std::string &encoding_);
263 std::string textEncoding(void) const;
264
265 // Text gravity.
266 void textGravity(const GravityType gravity_);
267 GravityType textGravity() const;
268
269 // Text inter-line spacing
270 void textInterlineSpacing(const double spacing_);
271 double textInterlineSpacing(void) const;
272
273 // Text inter-word spacing
274 void textInterwordSpacing(const double spacing_);
275 double textInterwordSpacing(void) const;
276
277 // Text inter-character kerning
278 void textKerning(const double kerning_);
279 double textKerning(void) const;
280
281 // Text undercolor box
282 void textUnderColor(const Color &underColor_);
283 Color textUnderColor(void) const;
284
285 // Origin of coordinate system to use when annotating with text or drawing
286 void transformOrigin(const double tx_,const double ty_);
287
288 // Reset transformation parameters to default
289 void transformReset(void);
290
291 // Rotation to use when annotating with text or drawing
292 void transformRotation(const double angle_);
293
294 // Scale to use when annotating with text or drawing
295 void transformScale(const double sx_,const double sy_);
296
297 // Skew to use in X axis when annotating with text or drawing
298 void transformSkewX(const double skewx_);
299
300 // Skew to use in Y axis when annotating with text or drawing
301 void transformSkewY(const double skewy_);
302
303 // Image representation type
304 void type(const ImageType type_);
305 ImageType type(void) const;
306
307 // Return verbose information about an image, or an operation
308 void verbose(const bool verboseFlag_);
309 bool verbose(void) const;
310
311 // X11 display name
312 void x11Display(const std::string &display_);
313 std::string x11Display(void) const;
314
315 //
316 // Internal implementation methods. Please do not use.
317 //
318
319 MagickCore::DrawInfo *drawInfo(void);
320 MagickCore::ImageInfo *imageInfo(void);
321 MagickCore::QuantizeInfo *quantizeInfo(void);
322
323 // Construct using raw structures
324 Options(const MagickCore::ImageInfo *imageInfo_,
325 const MagickCore::QuantizeInfo *quantizeInfo_,
326 const MagickCore::DrawInfo *drawInfo_);
327
328 private:
329
330 // Assignment not supported
331 Options& operator=(const Options&);
332
333 void setOption(const char *name,const Color &value_);
334
335 void setOption(const char *name,const double value_);
336
337 MagickCore::ImageInfo *_imageInfo;
338 MagickCore::QuantizeInfo *_quantizeInfo;
339 MagickCore::DrawInfo *_drawInfo;
340 bool _quiet;
341 };
342 } // namespace Magick
343
344 #endif // Magick_Options_header
Magick::Options::fontWeight
size_t fontWeight(void) const
Definition: Options.cpp:360
Magick::Options::strokeDashOffset
double strokeDashOffset(void) const
Definition: Options.cpp:615
Magick::Options::textKerning
double textKerning(void) const
Definition: Options.cpp:777
Magick::Options::endian
EndianType endian(void) const
Definition: Options.cpp:211
Magick::Options::borderColor
Color borderColor(void) const
Definition: Options.cpp:120
Magick::Options::quantizeInfo
MagickCore::QuantizeInfo * quantizeInfo(void)
Definition: Options.cpp:955
Magick::Options::quality
size_t quality(void) const
Definition: Options.cpp:448
Magick::Options::font
std::string font(void) const
Definition: Options.cpp:301
Magick::Options::page
Geometry page(void) const
Definition: Options.cpp:435
Magick::Point
Definition: Geometry.h:208
Magick::Options
Definition: Options.h:30
Magick::Options::quantizeDither
bool quantizeDither(void) const
Definition: Options.cpp:480
Magick::Options::imageInfo
MagickCore::ImageInfo * imageInfo(void)
Definition: Options.cpp:950
Magick::Options::density
Point density(void) const
Definition: Options.cpp:188
Magick::Options::transformReset
void transformReset(void)
Definition: Options.cpp:814
Magick::Options::transformRotation
void transformRotation(const double angle_)
Definition: Options.cpp:824
Magick::Options::colorFuzz
double colorFuzz(void) const
Definition: Options.cpp:160
Magick::Options::textDirection
DirectionType textDirection() const
Definition: Options.cpp:718
Magick::Options::subRange
size_t subRange(void) const
Definition: Options.cpp:695
Magick::Options::strokeMiterLimit
size_t strokeMiterLimit(void) const
Definition: Options.cpp:645
Magick::Options::fileName
std::string fileName(void) const
Definition: Options.cpp:239
Magick::Options::backgroundColor
Color backgroundColor(void) const
Definition: Options.cpp:93
Magick::Options::fontFamily
std::string fontFamily(void) const
Definition: Options.cpp:323
Drawable.h
Magick::Options::format
std::string format(void) const
Definition: Options.cpp:365
Magick::Options::adjoin
bool adjoin(void) const
Definition: Options.cpp:73
Magick::Options::textEncoding
std::string textEncoding(void) const
Definition: Options.cpp:729
Magick::Options::transformScale
void transformScale(const double sx_, const double sy_)
Definition: Options.cpp:845
Magick::Options::fillPattern
const MagickCore::Image * fillPattern(void) const
Definition: Options.cpp:272
Magick::Options::strokeColor
Color strokeColor(void) const
Definition: Options.cpp:577
Magick::Options::quiet
bool quiet(void) const
Definition: Options.cpp:510
Magick::Options::strokeDashArray
const double * strokeDashArray(void) const
Definition: Options.cpp:605
Magick::Options::subImage
size_t subImage(void) const
Definition: Options.cpp:685
Magick::Options::matteColor
Color matteColor(void) const
Definition: Options.cpp:83
Magick::Options::fillColor
Color fillColor(void) const
Definition: Options.cpp:252
Magick::Options::quantizeTreeDepth
size_t quantizeTreeDepth(void) const
Definition: Options.cpp:500
Magick::Options::colorspaceType
ColorspaceType colorspaceType(void) const
Definition: Options.cpp:140
Magick::Color
Definition: Color.h:36
Magick::Options::quantizeColors
size_t quantizeColors(void) const
Definition: Options.cpp:458
Magick::Options::fillRule
FillRule fillRule(void) const
Definition: Options.cpp:282
Magick::Options::strokeLineCap
LineCap strokeLineCap(void) const
Definition: Options.cpp:625
Magick::Geometry
Definition: Geometry.h:37
Magick::Options::~Options
~Options()
Definition: Options.cpp:55
Magick::Options::magick
std::string magick(void) const
Definition: Options.cpp:409
Magick::Options::textInterlineSpacing
double textInterlineSpacing(void) const
Definition: Options.cpp:755
Magick::Options::strokeAntiAlias
bool strokeAntiAlias(void) const
Definition: Options.cpp:564
Magick::Options::compressType
CompressionType compressType(void) const
Definition: Options.cpp:150
Magick::Options::type
ImageType type(void) const
Definition: Options.cpp:913
Magick::Options::file
FILE * file(void) const
Definition: Options.cpp:221
Color.h
Magick::Options::textUnderColor
Color textUnderColor(void) const
Definition: Options.cpp:788
Magick::Options::x11Display
std::string x11Display(void) const
Definition: Options.cpp:937
Magick::Options::textInterwordSpacing
double textInterwordSpacing(void) const
Definition: Options.cpp:766
Magick::Options::textGravity
GravityType textGravity() const
Definition: Options.cpp:744
Magick::Options::samplingFactor
std::string samplingFactor(void) const
Definition: Options.cpp:534
Include.h
Magick::Options::quantizeDitherMethod
DitherMethod quantizeDitherMethod(void) const
Definition: Options.cpp:490
Magick::Options::backgroundTexture
std::string backgroundTexture(void) const
Definition: Options.cpp:106
Magick::Options::verbose
bool verbose(void) const
Definition: Options.cpp:923
Magick::Options::strokePattern
const MagickCore::Image * strokePattern(void) const
Definition: Options.cpp:664
Magick::Options::strokeLineJoin
LineJoin strokeLineJoin(void) const
Definition: Options.cpp:635
Magick::Options::transformOrigin
void transformOrigin(const double tx_, const double ty_)
Definition: Options.cpp:793
Magick::Options::transformSkewY
void transformSkewY(const double skewy_)
Definition: Options.cpp:887
Magick::Options::transformSkewX
void transformSkewX(const double skewx_)
Definition: Options.cpp:866
Magick::Options::monochrome
bool monochrome(void) const
Definition: Options.cpp:422
Magick::Options::drawInfo
MagickCore::DrawInfo * drawInfo(void)
Definition: Options.cpp:945
Magick::Options::size
Geometry size(void) const
Definition: Options.cpp:550
Magick::Image
class MagickPPExport Image
Definition: Drawable.h:722
Magick
Definition: Blob.h:17
Magick::Options::interlaceType
InterlaceType interlaceType(void) const
Definition: Options.cpp:386
Magick::Options::strokeWidth
double strokeWidth(void) const
Definition: Options.cpp:675
Magick::Options::Options
Options(void)
Definition: Options.cpp:29
Magick::Options::fontStyle
StyleType fontStyle(void) const
Definition: Options.cpp:349
Magick::Options::depth
size_t depth(void) const
Definition: Options.cpp:201
Magick::Options::fontPointsize
double fontPointsize(void) const
Definition: Options.cpp:337
Magick::Options::boxColor
Color boxColor(void) const
Definition: Options.cpp:130
Geometry.h
Magick::Options::debug
bool debug(void) const
Definition: Options.cpp:173
Magick::Options::quantizeColorSpace
ColorspaceType quantizeColorSpace(void) const
Definition: Options.cpp:468
Magick::Options::textAntiAlias
bool textAntiAlias(void) const
Definition: Options.cpp:706
Magick::Options::resolutionUnits
ResolutionType resolutionUnits(void) const
Definition: Options.cpp:520