Magick++ 7.1.1
Loading...
Searching...
No Matches
Options.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// 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
26namespace 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 void quantizeDither(const DitherMethod ditherMethod_);
172
173 // Dither method
174 void quantizeDitherMethod(const DitherMethod ditherMethod_);
175 DitherMethod quantizeDitherMethod(void) const;
176
177 // Quantization tree-depth
178 void quantizeTreeDepth(const size_t treeDepth_);
179 size_t quantizeTreeDepth(void) const;
180
181 // Suppress all warning messages. Error messages are still reported.
182 void quiet(const bool quiet_);
183 bool quiet(void) const;
184
185 // Units of resolution to interpret density
186 void resolutionUnits(const ResolutionType resolutionUnits_);
187 ResolutionType resolutionUnits(void) const;
188
189 // Image sampling factor
190 void samplingFactor(const std::string &samplingFactor_);
191 std::string samplingFactor(void) const;
192
193 // Image size (required for raw formats)
194 void size(const Geometry &geometry_);
195 Geometry size(void) const;
196
197 // enabled/disable stroke anti-aliasing
198 void strokeAntiAlias(const bool flag_);
199 bool strokeAntiAlias(void) const ;
200
201 // Color to use when drawing object outlines
202 void strokeColor(const Color &strokeColor_);
203 Color strokeColor(void) const;
204
205 // Control the pattern of dashes and gaps used to stroke
206 // paths. The strokeDashArray represents a list of numbers that
207 // specify the lengths of alternating dashes and gaps in user
208 // units. If an odd number of values is provided, then the list of
209 // values is repeated to yield an even number of values.
210 void strokeDashArray(const double *strokeDashArray_);
211 const double *strokeDashArray(void) const;
212
213 // While drawing using strokeDashArray, specify distance into the dash
214 // pattern to start the dash (default 0).
215 void strokeDashOffset(const double strokeDashOffset_);
216 double strokeDashOffset(void) const;
217
218 // Specify the shape to be used at the end of open subpaths when
219 // they are stroked. Values of LineCap are UndefinedCap, ButtCap,
220 // RoundCap, and SquareCap.
221 void strokeLineCap(const LineCap lineCap_);
222 LineCap strokeLineCap(void) const;
223
224 // Specify the shape to be used at the corners of paths (or other
225 // vector shapes) when they are stroked. Values of LineJoin are
226 // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
227 void strokeLineJoin(const LineJoin lineJoin_);
228 LineJoin strokeLineJoin(void) const;
229
230 // Specify miter limit. When two line segments meet at a sharp
231 // angle and miter joins have been specified for 'lineJoin', it is
232 // possible for the miter to extend far beyond the thickness of
233 // the line stroking the path. The miterLimit' imposes a limit on
234 // the ratio of the miter length to the 'stroke_width'. The default
235 // value of this parameter is 4.
236 void strokeMiterLimit(const size_t miterLimit_);
237 size_t strokeMiterLimit(void) const;
238
239 // Pattern image to use for stroked outlines
240 void strokePattern(const MagickCore::Image *strokePattern_);
241 const MagickCore::Image *strokePattern(void) const;
242
243 // Stroke width for drawing vector objects (default one)
244 void strokeWidth(const double strokeWidth_);
245 double strokeWidth(void) const;
246
247 void subImage(const size_t subImage_);
248 size_t subImage(void) const;
249
250 // Sub-frame number to return
251 void subRange(const size_t subRange_);
252 size_t subRange(void) const;
253
254 // Remove pixel aliasing
255 void textAntiAlias(const bool flag_);
256 bool textAntiAlias(void) const;
257
258 // Render text right-to-left or left-to-right.
259 void textDirection(const DirectionType direction_);
260 DirectionType textDirection() const;
261
262 // Annotation text encoding (e.g. "UTF-16")
263 void textEncoding(const std::string &encoding_);
264 std::string textEncoding(void) const;
265
266 // Text gravity.
267 void textGravity(const GravityType gravity_);
268 GravityType textGravity() const;
269
270 // Text inter-line spacing
271 void textInterlineSpacing(const double spacing_);
272 double textInterlineSpacing(void) const;
273
274 // Text inter-word spacing
275 void textInterwordSpacing(const double spacing_);
276 double textInterwordSpacing(void) const;
277
278 // Text inter-character kerning
279 void textKerning(const double kerning_);
280 double textKerning(void) const;
281
282 // Text undercolor box
283 void textUnderColor(const Color &underColor_);
284 Color textUnderColor(void) const;
285
286 // Origin of coordinate system to use when annotating with text or drawing
287 void transformOrigin(const double tx_,const double ty_);
288
289 // Reset transformation parameters to default
290 void transformReset(void);
291
292 // Rotation to use when annotating with text or drawing
293 void transformRotation(const double angle_);
294
295 // Scale to use when annotating with text or drawing
296 void transformScale(const double sx_,const double sy_);
297
298 // Skew to use in X axis when annotating with text or drawing
299 void transformSkewX(const double skewx_);
300
301 // Skew to use in Y axis when annotating with text or drawing
302 void transformSkewY(const double skewy_);
303
304 // Image representation type
305 void type(const ImageType type_);
306 ImageType type(void) const;
307
308 // Return verbose information about an image, or an operation
309 void verbose(const bool verboseFlag_);
310 bool verbose(void) const;
311
312 // X11 display name
313 void x11Display(const std::string &display_);
314 std::string x11Display(void) const;
315
316 //
317 // Internal implementation methods. Please do not use.
318 //
319
320 MagickCore::DrawInfo *drawInfo(void);
321 MagickCore::ImageInfo *imageInfo(void);
322 MagickCore::QuantizeInfo *quantizeInfo(void);
323
324 // Construct using raw structures
325 Options(const MagickCore::ImageInfo *imageInfo_,
326 const MagickCore::QuantizeInfo *quantizeInfo_,
327 const MagickCore::DrawInfo *drawInfo_);
328
329 private:
330
331 // Assignment not supported
332 Options& operator=(const Options&);
333
334 void setOption(const char *name,const Color &value_);
335
336 void setOption(const char *name,const double value_);
337
338 MagickCore::ImageInfo *_imageInfo;
339 MagickCore::QuantizeInfo *_quantizeInfo;
340 MagickCore::DrawInfo *_drawInfo;
341 bool _quiet;
342 };
343} // namespace Magick
344
345#endif // Magick_Options_header