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
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