Options.h
Go to the documentation of this file.
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
//
// Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
// dedicated to making software imaging solutions freely available.
//
// Definition of Options
//
// Options which may be applied to an image. These options are the
// equivalent of options supplied to ImageMagick utilities.
//
// This is an internal implementation class and is not part of the
// Magick++ API
//
#if !defined(Magick_Options_header)
#define Magick_Options_header
#include "Magick++/Include.h"
#include <string>
#include "Magick++/Color.h"
#include "Magick++/Geometry.h"
#include "Magick++/Drawable.h"
namespace Magick
{
class Image;
class Options
{
public:
// Default constructor
Options(void);
// Copy constructor
Options(const Options& options_);
// Destructor
~Options();
// Join images into a single multi-image file
void adjoin(const bool flag_);
bool adjoin(void) const;
// Transparent color
void matteColor(const Color &matteColor_);
Color matteColor(void) const;
// Image background color
void backgroundColor(const Color &color_);
Color backgroundColor(void) const;
// Name of texture image to tile onto the image background
void backgroundTexture(const std::string &backgroundTexture_);
std::string backgroundTexture(void) const;
// Image border color
void borderColor(const Color &color_);
Color borderColor(void) const;
// Text bounding-box base color (default none)
void boxColor(const Color &boxColor_);
Color boxColor(void) const;
// Colors within this distance are considered equal
void colorFuzz(const double fuzz_);
double colorFuzz(void) const;
// Image colorspace scheme
void colorspaceType(const ColorspaceType colorspace_);
ColorspaceType colorspaceType(void) const;
// Compression type ( NoCompression, BZipCompression,
// FaxCompression, JPEGCompression, LZWCompression,
// RLECompression, or ZipCompression )
void compressType(const CompressionType compressType_);
CompressionType compressType(void) const;
// Enable printing of debug messages from ImageMagick
void debug(const bool flag_);
bool debug(void) const;
// Vertical and horizontal resolution in pixels of the image
void density(const Point &density_);
Point density(void) const;
// Image depth (8 or 16)
void depth(const size_t depth_);
size_t depth(void) const;
// Endianness (little like Intel or big like SPARC) for image
// formats which support endian-specific options.
void endian(const EndianType endian_);
EndianType endian(void) const;
// Image filename to read or write
void file(FILE *file_);
FILE *file(void) const;
// Image filename to read or write
void fileName(const std::string &fileName_);
std::string fileName(void) const;
// Color to use when filling drawn objects
void fillColor(const Color &fillColor_);
Color fillColor(void) const;
// Fill pattern
void fillPattern(const MagickCore::Image *fillPattern_);
const MagickCore::Image *fillPattern(void) const;
// Rule to use when filling drawn objects
void fillRule(const FillRule &fillRule_);
FillRule fillRule(void) const;
// Font name
void font(const std::string &font_);
std::string font(void) const;
// Font name
void fontFamily(const std::string &family_);
std::string fontFamily(void) const;
// Font point size
void fontPointsize(const double pointSize_);
double fontPointsize(void) const;
// Font style
void fontStyle(const StyleType style_);
StyleType fontStyle(void) const;
// Font weight
void fontWeight(const size_t weight_);
size_t fontWeight(void) const;
std::string format(void) const;
// Image interlace scheme
void interlaceType(const InterlaceType interlace_);
InterlaceType interlaceType(void) const;
// Image format to write or read
void magick(const std::string &magick_);
std::string magick(void) const;
// Write as a monochrome image
void monochrome(const bool monochromeFlag_);
bool monochrome(void) const;
// Preferred size and location of an image canvas.
void page(const Geometry &pageSize_);
Geometry page(void) const;
// Desired image quality factor
void quality(const size_t quality_);
size_t quality(void) const;
// Maximum number of colors to quantize to
void quantizeColors(const size_t colors_);
size_t quantizeColors(void) const;
// Colorspace to quantize in.
void quantizeColorSpace(const ColorspaceType colorSpace_);
ColorspaceType quantizeColorSpace(void) const;
// Dither image during quantization.
void quantizeDither(const bool ditherFlag_);
bool quantizeDither(void) const;
// Dither method
void quantizeDitherMethod(const DitherMethod ditherMethod_);
DitherMethod quantizeDitherMethod(void) const;
// Quantization tree-depth
void quantizeTreeDepth(const size_t treeDepth_);
size_t quantizeTreeDepth(void) const;
// Suppress all warning messages. Error messages are still reported.
void quiet(const bool quiet_);
bool quiet(void) const;
// Units of resolution to interpret density
void resolutionUnits(const ResolutionType resolutionUnits_);
ResolutionType resolutionUnits(void) const;
// Image sampling factor
void samplingFactor(const std::string &samplingFactor_);
std::string samplingFactor(void) const;
// Image size (required for raw formats)
void size(const Geometry &geometry_);
Geometry size(void) const;
// enabled/disable stroke anti-aliasing
void strokeAntiAlias(const bool flag_);
bool strokeAntiAlias(void) const ;
// Color to use when drawing object outlines
void strokeColor(const Color &strokeColor_);
Color strokeColor(void) const;
// Control the pattern of dashes and gaps used to stroke
// paths. The strokeDashArray represents a list of numbers that
// specify the lengths of alternating dashes and gaps in user
// units. If an odd number of values is provided, then the list of
// values is repeated to yield an even number of values.
void strokeDashArray(const double *strokeDashArray_);
const double *strokeDashArray(void) const;
// While drawing using strokeDashArray, specify distance into the dash
// pattern to start the dash (default 0).
void strokeDashOffset(const double strokeDashOffset_);
double strokeDashOffset(void) const;
// Specify the shape to be used at the end of open subpaths when
// they are stroked. Values of LineCap are UndefinedCap, ButtCap,
// RoundCap, and SquareCap.
void strokeLineCap(const LineCap lineCap_);
LineCap strokeLineCap(void) const;
// Specify the shape to be used at the corners of paths (or other
// vector shapes) when they are stroked. Values of LineJoin are
// UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
void strokeLineJoin(const LineJoin lineJoin_);
LineJoin strokeLineJoin(void) const;
// Specify miter limit. When two line segments meet at a sharp
// angle and miter joins have been specified for 'lineJoin', it is
// possible for the miter to extend far beyond the thickness of
// the line stroking the path. The miterLimit' imposes a limit on
// the ratio of the miter length to the 'stroke_width'. The default
// value of this parameter is 4.
void strokeMiterLimit(const size_t miterLimit_);
size_t strokeMiterLimit(void) const;
// Pattern image to use for stroked outlines
void strokePattern(const MagickCore::Image *strokePattern_);
const MagickCore::Image *strokePattern(void) const;
// Stroke width for drawing vector objects (default one)
void strokeWidth(const double strokeWidth_);
double strokeWidth(void) const;
void subImage(const size_t subImage_);
size_t subImage(void) const;
// Sub-frame number to return
void subRange(const size_t subRange_);
size_t subRange(void) const;
// Remove pixel aliasing
void textAntiAlias(const bool flag_);
bool textAntiAlias(void) const;
// Render text right-to-left or left-to-right.
void textDirection(const DirectionType direction_);
DirectionType textDirection() const;
// Annotation text encoding (e.g. "UTF-16")
void textEncoding(const std::string &encoding_);
std::string textEncoding(void) const;
// Text gravity.
void textGravity(const GravityType gravity_);
GravityType textGravity() const;
// Text inter-line spacing
void textInterlineSpacing(const double spacing_);
double textInterlineSpacing(void) const;
// Text inter-word spacing
void textInterwordSpacing(const double spacing_);
double textInterwordSpacing(void) const;
// Text inter-character kerning
void textKerning(const double kerning_);
double textKerning(void) const;
// Text undercolor box
void textUnderColor(const Color &underColor_);
Color textUnderColor(void) const;
// Origin of coordinate system to use when annotating with text or drawing
void transformOrigin(const double tx_,const double ty_);
// Reset transformation parameters to default
void transformReset(void);
// Rotation to use when annotating with text or drawing
void transformRotation(const double angle_);
// Scale to use when annotating with text or drawing
void transformScale(const double sx_,const double sy_);
// Skew to use in X axis when annotating with text or drawing
void transformSkewX(const double skewx_);
// Skew to use in Y axis when annotating with text or drawing
void transformSkewY(const double skewy_);
// Image representation type
void type(const ImageType type_);
ImageType type(void) const;
// Return verbose information about an image, or an operation
void verbose(const bool verboseFlag_);
bool verbose(void) const;
// X11 display name
void x11Display(const std::string &display_);
std::string x11Display(void) const;
//
// Internal implementation methods. Please do not use.
//
MagickCore::DrawInfo *drawInfo(void);
MagickCore::ImageInfo *imageInfo(void);
MagickCore::QuantizeInfo *quantizeInfo(void);
// Construct using raw structures
Options(const MagickCore::ImageInfo *imageInfo_,
const MagickCore::QuantizeInfo *quantizeInfo_,
const MagickCore::DrawInfo *drawInfo_);
private:
// Assignment not supported
Options& operator=(const Options&);
void setOption(const char *name,const Color &value_);
void setOption(const char *name,const double value_);
MagickCore::ImageInfo *_imageInfo;
MagickCore::QuantizeInfo *_quantizeInfo;
MagickCore::DrawInfo *_drawInfo;
bool _quiet;
};
} // namespace Magick
#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