Image.h revision b5e877bd8701bc3f0ac1e9a3679a6cee64c69674
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 Image, the representation of a single image in Magick++ 6// 7 8#if !defined(Magick_Image_header) 9#define Magick_Image_header 10 11#include "Magick++/Include.h" 12#include <string> 13#include <list> 14#include "Magick++/Blob.h" 15#include "Magick++/Color.h" 16#include "Magick++/Drawable.h" 17#include "Magick++/Exception.h" 18#include "Magick++/Geometry.h" 19#include "Magick++/TypeMetric.h" 20 21namespace Magick 22{ 23 // Forward declarations 24 class Options; 25 class ImageRef; 26 27 extern MagickPPExport const char *borderGeometryDefault; 28 extern MagickPPExport const char *frameGeometryDefault; 29 extern MagickPPExport const char *raiseGeometryDefault; 30 31 // Compare two Image objects regardless of LHS/RHS 32 // Image sizes and signatures are used as basis of comparison 33 int MagickPPExport operator == ( const Magick::Image& left_, 34 const Magick::Image& right_ ); 35 int MagickPPExport operator != ( const Magick::Image& left_, 36 const Magick::Image& right_ ); 37 int MagickPPExport operator > ( const Magick::Image& left_, 38 const Magick::Image& right_ ); 39 int MagickPPExport operator < ( const Magick::Image& left_, 40 const Magick::Image& right_ ); 41 int MagickPPExport operator >= ( const Magick::Image& left_, 42 const Magick::Image& right_ ); 43 int MagickPPExport operator <= ( const Magick::Image& left_, 44 const Magick::Image& right_ ); 45 46 // C library initialization routine 47 void MagickPPExport InitializeMagick(const char *path_); 48 49 // 50 // Image is the representation of an image. In reality, it actually 51 // a handle object which contains a pointer to a shared reference 52 // object (ImageRef). As such, this object is extremely space efficient. 53 // 54 class Image 55 { 56 public: 57 // Construct from image file or image specification 58 Image( const std::string &imageSpec_ ); 59 60 // Construct a blank image canvas of specified size and color 61 Image( const Geometry &size_, const Color &color_ ); 62 63 // Construct Image from in-memory BLOB 64 Image ( const Blob &blob_ ); 65 66 // Construct Image of specified size from in-memory BLOB 67 Image ( const Blob &blob_, const Geometry &size_ ); 68 69 // Construct Image of specified size and depth from in-memory BLOB 70 Image ( const Blob &blob_, const Geometry &size, 71 const size_t depth ); 72 73 // Construct Image of specified size, depth, and format from 74 // in-memory BLOB 75 Image ( const Blob &blob_, const Geometry &size, 76 const size_t depth_, 77 const std::string &magick_ ); 78 // Construct Image of specified size, and format from in-memory 79 // BLOB 80 Image ( const Blob &blob_, const Geometry &size, 81 const std::string &magick_ ); 82 83 // Construct an image based on an array of raw pixels, of 84 // specified type and mapping, in memory 85 Image ( const size_t width_, 86 const size_t height_, 87 const std::string &map_, 88 const StorageType type_, 89 const void *pixels_ ); 90 91 // Default constructor 92 Image( void ); 93 94 // Destructor 95 virtual ~Image(); 96 97 /// Copy constructor 98 Image ( const Image & image_ ); 99 100 // Assignment operator 101 Image& operator= ( const Image &image_ ); 102 103 ////////////////////////////////////////////////////////////////////// 104 // 105 // Image operations 106 // 107 ////////////////////////////////////////////////////////////////////// 108 109 // Adaptive-blur image with specified blur factor 110 // The radius_ parameter specifies the radius of the Gaussian, in 111 // pixels, not counting the center pixel. The sigma_ parameter 112 // specifies the standard deviation of the Laplacian, in pixels. 113 void adaptiveBlur ( const double radius_ = 0.0, 114 const double sigma_ = 1.0 ); 115 116 // Local adaptive threshold image 117 // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm 118 // Width x height define the size of the pixel neighborhood 119 // offset = constant to subtract from pixel neighborhood mean 120 void adaptiveThreshold ( const size_t width, 121 const size_t height, 122 const ::ssize_t offset = 0 ); 123 124 // Add noise to image with specified noise type 125 void addNoise ( const NoiseType noiseType_ ); 126 void addNoiseChannel ( const ChannelType channel_, 127 const NoiseType noiseType_); 128 129 // Transform image by specified affine (or free transform) matrix. 130 void affineTransform ( const DrawableAffine &affine ); 131 132 // 133 // Annotate image (draw text on image) 134 // 135 136 // Gravity effects text placement in bounding area according to rules: 137 // NorthWestGravity text bottom-left corner placed at top-left 138 // NorthGravity text bottom-center placed at top-center 139 // NorthEastGravity text bottom-right corner placed at top-right 140 // WestGravity text left-center placed at left-center 141 // CenterGravity text center placed at center 142 // EastGravity text right-center placed at right-center 143 // SouthWestGravity text top-left placed at bottom-left 144 // SouthGravity text top-center placed at bottom-center 145 // SouthEastGravity text top-right placed at bottom-right 146 147 // Annotate using specified text, and placement location 148 void annotate ( const std::string &text_, 149 const Geometry &location_ ); 150 // Annotate using specified text, bounding area, and placement 151 // gravity 152 void annotate ( const std::string &text_, 153 const Geometry &boundingArea_, 154 const GravityType gravity_ ); 155 // Annotate with text using specified text, bounding area, 156 // placement gravity, and rotation. 157 void annotate ( const std::string &text_, 158 const Geometry &boundingArea_, 159 const GravityType gravity_, 160 const double degrees_ ); 161 // Annotate with text (bounding area is entire image) and placement 162 // gravity. 163 void annotate ( const std::string &text_, 164 const GravityType gravity_ ); 165 166 // Inserts the artifact with the specified name and value into 167 // the artifact tree of the image. 168 void artifact ( const std::string &name_, 169 const std::string &value_ ); 170 // Returns the value of the artifact with the specified name. 171 std::string artifact ( const std::string &name_ ); 172 173 // Blur image with specified blur factor 174 // The radius_ parameter specifies the radius of the Gaussian, in 175 // pixels, not counting the center pixel. The sigma_ parameter 176 // specifies the standard deviation of the Laplacian, in pixels. 177 void blur ( const double radius_ = 0.0, 178 const double sigma_ = 1.0 ); 179 void blurChannel ( const ChannelType channel_, 180 const double radius_ = 0.0, 181 const double sigma_ = 1.0 ); 182 183 // Border image (add border to image) 184 void border ( const Geometry &geometry_ 185 = borderGeometryDefault ); 186 187 // Extract channel from image 188 void channel ( const ChannelType channel_ ); 189 190 // Set or obtain modulus channel depth 191 void channelDepth ( const size_t depth_ ); 192 size_t channelDepth ( ); 193 194 // Charcoal effect image (looks like charcoal sketch) 195 // The radius_ parameter specifies the radius of the Gaussian, in 196 // pixels, not counting the center pixel. The sigma_ parameter 197 // specifies the standard deviation of the Laplacian, in pixels. 198 void charcoal ( const double radius_ = 0.0, 199 const double sigma_ = 1.0 ); 200 201 // Chop image (remove vertical or horizontal subregion of image) 202 // FIXME: describe how geometry argument is used to select either 203 // horizontal or vertical subregion of image. 204 205 void chop ( const Geometry &geometry_ ); 206 207 // Accepts a lightweight Color Correction Collection 208 // (CCC) file which solely contains one or more color corrections and 209 // applies the correction to the image. 210 void cdl ( const std::string &cdl_ ); 211 212 // Colorize image with pen color, using specified percent alpha 213 // for red, green, and blue quantums 214 void colorize ( const unsigned int alphaRed_, 215 const unsigned int alphaGreen_, 216 const unsigned int alphaBlue_, 217 const Color &penColor_ ); 218 // Colorize image with pen color, using specified percent alpha. 219 void colorize ( const unsigned int alpha_, 220 const Color &penColor_ ); 221 222 // Apply a color matrix to the image channels. The user supplied 223 // matrix may be of order 1 to 5 (1x1 through 5x5). 224 void colorMatrix (const size_t order_, 225 const double *color_matrix_); 226 227 // Comment image (add comment string to image) 228 void comment ( const std::string &comment_ ); 229 230 // Composition operator to be used when composition is implicitly 231 // used (such as for image flattening). 232 void compose (const CompositeOperator compose_); 233 CompositeOperator compose ( void ) const; 234 235 // Compare current image with another image 236 // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError 237 // in the current image. False is returned if the images are identical. 238 bool compare ( const Image &reference_ ); 239 240 // Compose an image onto another at specified offset and using 241 // specified algorithm 242 void composite ( const Image &compositeImage_, 243 const ::ssize_t xOffset_, 244 const ::ssize_t yOffset_, 245 const CompositeOperator compose_ 246 = InCompositeOp ); 247 void composite ( const Image &compositeImage_, 248 const Geometry &offset_, 249 const CompositeOperator compose_ 250 = InCompositeOp ); 251 void composite ( const Image &compositeImage_, 252 const GravityType gravity_, 253 const CompositeOperator compose_ 254 = InCompositeOp ); 255 256 // Contrast image (enhance intensity differences in image) 257 void contrast ( const size_t sharpen_ ); 258 259 // Convolve image. Applies a user-specified convolution to the image. 260 // order_ represents the number of columns and rows in the filter kernel. 261 // kernel_ is an array of doubles representing the convolution kernel. 262 void convolve ( const size_t order_, 263 const double *kernel_ ); 264 265 // Crop image (subregion of original image) 266 void crop ( const Geometry &geometry_ ); 267 268 // Cycle image colormap 269 void cycleColormap ( const ::ssize_t amount_ ); 270 271 // Despeckle image (reduce speckle noise) 272 void despeckle ( void ); 273 274 // Display image on screen 275 void display ( void ); 276 277 // Distort image. distorts an image using various distortion methods, by 278 // mapping color lookups of the source image to a new destination image 279 // usally of the same size as the source image, unless 'bestfit' is set to 280 // true. 281 void distort ( const DistortImageMethod method_, 282 const size_t number_arguments_, 283 const double *arguments_, 284 const bool bestfit_ = false ); 285 286 // Draw on image using a single drawable 287 void draw ( const Drawable &drawable_ ); 288 289 // Draw on image using a drawable list 290 void draw ( const std::list<Magick::Drawable> &drawable_ ); 291 292 // Edge image (hilight edges in image) 293 void edge ( const double radius_ = 0.0 ); 294 295 // Emboss image (hilight edges with 3D effect) 296 // The radius_ parameter specifies the radius of the Gaussian, in 297 // pixels, not counting the center pixel. The sigma_ parameter 298 // specifies the standard deviation of the Laplacian, in pixels. 299 void emboss ( const double radius_ = 0.0, 300 const double sigma_ = 1.0); 301 302 // Enhance image (minimize noise) 303 void enhance ( void ); 304 305 // Equalize image (histogram equalization) 306 void equalize ( void ); 307 308 // Erase image to current "background color" 309 void erase ( void ); 310 311 // Extend the image as defined by the geometry. 312 void extent ( const Geometry &geometry_ ); 313 void extent ( const Geometry &geometry_, const Color &backgroundColor ); 314 void extent ( const Geometry &geometry_, const GravityType gravity_ ); 315 void extent ( const Geometry &geometry_, const Color &backgroundColor, const GravityType gravity_ ); 316 317 // Flip image (reflect each scanline in the vertical direction) 318 void flip ( void ); 319 320 // Flood-fill color across pixels that match the color of the 321 // target pixel and are neighbors of the target pixel. 322 // Uses current fuzz setting when determining color match. 323 void floodFillColor( const ::ssize_t x_, 324 const ::ssize_t y_, 325 const Color &fillColor_ ); 326 void floodFillColor( const Geometry &point_, 327 const Color &fillColor_ ); 328 329 // Flood-fill color across pixels starting at target-pixel and 330 // stopping at pixels matching specified border color. 331 // Uses current fuzz setting when determining color match. 332 void floodFillColor( const ::ssize_t x_, 333 const ::ssize_t y_, 334 const Color &fillColor_, 335 const Color &borderColor_ ); 336 void floodFillColor( const Geometry &point_, 337 const Color &fillColor_, 338 const Color &borderColor_ ); 339 340 // Floodfill pixels matching color (within fuzz factor) of target 341 // pixel(x,y) with replacement alpha value using method. 342 void floodFillAlpha ( const ::ssize_t x_, 343 const ::ssize_t y_, 344 const unsigned int alpha_, 345 const PaintMethod method_ ); 346 347 // Flood-fill texture across pixels that match the color of the 348 // target pixel and are neighbors of the target pixel. 349 // Uses current fuzz setting when determining color match. 350 void floodFillTexture( const ::ssize_t x_, 351 const ::ssize_t y_, 352 const Image &texture_ ); 353 void floodFillTexture( const Geometry &point_, 354 const Image &texture_ ); 355 356 // Flood-fill texture across pixels starting at target-pixel and 357 // stopping at pixels matching specified border color. 358 // Uses current fuzz setting when determining color match. 359 void floodFillTexture( const ::ssize_t x_, 360 const ::ssize_t y_, 361 const Image &texture_, 362 const Color &borderColor_ ); 363 void floodFillTexture( const Geometry &point_, 364 const Image &texture_, 365 const Color &borderColor_ ); 366 367 // Flop image (reflect each scanline in the horizontal direction) 368 void flop ( void ); 369 370 // Frame image 371 void frame ( const Geometry &geometry_ = frameGeometryDefault ); 372 void frame ( const size_t width_, 373 const size_t height_, 374 const ::ssize_t innerBevel_ = 6, 375 const ::ssize_t outerBevel_ = 6 ); 376 377 // Applies a mathematical expression to the image. 378 void fx ( const std::string expression ); 379 void fx ( const std::string expression, 380 const Magick::ChannelType channel ); 381 382 // Gamma correct image 383 void gamma ( const double gamma_ ); 384 void gamma ( const double gammaRed_, 385 const double gammaGreen_, 386 const double gammaBlue_ ); 387 388 // Gaussian blur image 389 // The number of neighbor pixels to be included in the convolution 390 // mask is specified by 'width_'. The standard deviation of the 391 // gaussian bell curve is specified by 'sigma_'. 392 void gaussianBlur ( const double width_, const double sigma_ ); 393 void gaussianBlurChannel ( const ChannelType channel_, 394 const double width_, 395 const double sigma_ ); 396 397 // Apply a color lookup table (Hald CLUT) to the image. 398 void haldClut ( const Image &clutImage_ ); 399 400 401 // Implode image (special effect) 402 void implode ( const double factor_ ); 403 404 // implements the inverse discrete Fourier transform (DFT) of the image 405 // either as a magnitude / phase or real / imaginary image pair. 406 // 407 void inverseFourierTransform ( const Image &phase_ ); 408 void inverseFourierTransform ( const Image &phase_, 409 const bool magnitude_ ); 410 // Label image 411 void label ( const std::string &label_ ); 412 413 // Level image. Adjust the levels of the image by scaling the 414 // colors falling between specified white and black points to the 415 // full available quantum range. The parameters provided represent 416 // the black, mid (gamma), and white points. The black point 417 // specifies the darkest color in the image. Colors darker than 418 // the black point are set to zero. Mid point (gamma) specifies a 419 // gamma correction to apply to the image. White point specifies 420 // the lightest color in the image. Colors brighter than the 421 // white point are set to the maximum quantum value. The black and 422 // white point have the valid range 0 to QuantumRange while mid (gamma) 423 // has a useful range of 0 to ten. 424 void level ( const double black_point, 425 const double white_point, 426 const double mid_point=1.0 ); 427 428 // Magnify image by integral size 429 void magnify ( void ); 430 431 // Remap image colors with closest color from reference image 432 void map ( const Image &mapImage_ , 433 const bool dither_ = false ); 434 435 // Floodfill designated area with replacement alpha value 436 void matteFloodfill ( const Color &target_ , 437 const unsigned int alpha_, 438 const ::ssize_t x_, const ::ssize_t y_, 439 const PaintMethod method_ ); 440 441 // Filter image by replacing each pixel component with the median 442 // color in a circular neighborhood 443 void medianFilter ( const double radius_ = 0.0 ); 444 445 // Reduce image by integral size 446 void minify ( void ); 447 448 // Modulate percent hue, saturation, and brightness of an image 449 void modulate ( const double brightness_, 450 const double saturation_, 451 const double hue_ ); 452 453 // Motion blur image with specified blur factor 454 // The radius_ parameter specifies the radius of the Gaussian, in 455 // pixels, not counting the center pixel. The sigma_ parameter 456 // specifies the standard deviation of the Laplacian, in pixels. 457 // The angle_ parameter specifies the angle the object appears 458 // to be comming from (zero degrees is from the right). 459 void motionBlur ( const double radius_, 460 const double sigma_, 461 const double angle_ ); 462 463 // Negate colors in image. Set grayscale to only negate grayscale 464 // values in image. 465 void negate ( const bool grayscale_ = false ); 466 467 // Normalize image (increase contrast by normalizing the pixel 468 // values to span the full range of color values) 469 void normalize ( void ); 470 471 // Oilpaint image (image looks like oil painting) 472 void oilPaint ( const double radius_ = 0.0, const double sigma = 1.0 ); 473 474 // Set or attenuate the alpha channel in the image. If the image 475 // pixels are opaque then they are set to the specified alpha 476 // value, otherwise they are blended with the supplied alpha 477 // value. The value of alpha_ ranges from 0 (completely opaque) 478 // to QuantumRange. The defines OpaqueAlpha and TransparentAlpha are 479 // available to specify completely opaque or completely 480 // transparent, respectively. 481 void alpha ( const unsigned int alpha_ ); 482 483 // Change color of opaque pixel to specified pen color. 484 void opaque ( const Color &opaqueColor_, 485 const Color &penColor_ ); 486 487 // Ping is similar to read except only enough of the image is read 488 // to determine the image columns, rows, and filesize. Access the 489 // columns(), rows(), and fileSize() attributes after invoking 490 // ping. The image data is not valid after calling ping. 491 void ping ( const std::string &imageSpec_ ); 492 493 // Ping is similar to read except only enough of the image is read 494 // to determine the image columns, rows, and filesize. Access the 495 // columns(), rows(), and fileSize() attributes after invoking 496 // ping. The image data is not valid after calling ping. 497 void ping ( const Blob &blob_ ); 498 499 // Quantize image (reduce number of colors) 500 void quantize ( const bool measureError_ = false ); 501 502 void quantumOperator ( const ChannelType channel_, 503 const MagickEvaluateOperator operator_, 504 double rvalue_); 505 506 void quantumOperator ( const ::ssize_t x_,const ::ssize_t y_, 507 const size_t columns_, 508 const size_t rows_, 509 const ChannelType channel_, 510 const MagickEvaluateOperator operator_, 511 const double rvalue_); 512 513 // Execute a named process module using an argc/argv syntax similar to 514 // that accepted by a C 'main' routine. An exception is thrown if the 515 // requested process module doesn't exist, fails to load, or fails during 516 // execution. 517 void process ( std::string name_, 518 const ::ssize_t argc_, 519 const char **argv_ ); 520 521 // Raise image (lighten or darken the edges of an image to give a 522 // 3-D raised or lowered effect) 523 void raise ( const Geometry &geometry_ = raiseGeometryDefault, 524 const bool raisedFlag_ = false ); 525 526 // Random threshold image. 527 // 528 // Changes the value of individual pixels based on the intensity 529 // of each pixel compared to a random threshold. The result is a 530 // low-contrast, two color image. The thresholds_ argument is a 531 // geometry containing LOWxHIGH thresholds. If the string 532 // contains 2x2, 3x3, or 4x4, then an ordered dither of order 2, 533 // 3, or 4 will be performed instead. If a channel_ argument is 534 // specified then only the specified channel is altered. This is 535 // a very fast alternative to 'quantize' based dithering. 536 void randomThreshold( const Geometry &thresholds_ ); 537 void randomThresholdChannel( const Geometry &thresholds_, 538 const ChannelType channel_ ); 539 540 // Read single image frame into current object 541 void read ( const std::string &imageSpec_ ); 542 543 // Read single image frame of specified size into current object 544 void read ( const Geometry &size_, 545 const std::string &imageSpec_ ); 546 547 // Read single image frame from in-memory BLOB 548 void read ( const Blob &blob_ ); 549 550 // Read single image frame of specified size from in-memory BLOB 551 void read ( const Blob &blob_, 552 const Geometry &size_ ); 553 554 // Read single image frame of specified size and depth from 555 // in-memory BLOB 556 void read ( const Blob &blob_, 557 const Geometry &size_, 558 const size_t depth_ ); 559 560 // Read single image frame of specified size, depth, and format 561 // from in-memory BLOB 562 void read ( const Blob &blob_, 563 const Geometry &size_, 564 const size_t depth_, 565 const std::string &magick_ ); 566 567 // Read single image frame of specified size, and format from 568 // in-memory BLOB 569 void read ( const Blob &blob_, 570 const Geometry &size_, 571 const std::string &magick_ ); 572 573 // Read single image frame from an array of raw pixels, with 574 // specified storage type (ConstituteImage), e.g. 575 // image.read( 640, 480, "RGB", 0, pixels ); 576 void read ( const size_t width_, 577 const size_t height_, 578 const std::string &map_, 579 const StorageType type_, 580 const void *pixels_ ); 581 582 // Reduce noise in image using a noise peak elimination filter 583 void reduceNoise ( void ); 584 void reduceNoise ( const double order_ ); 585 586 // Resize image to specified size. 587 void resize ( const Geometry &geometry_ ); 588 589 // Roll image (rolls image vertically and horizontally) by specified 590 // number of columnms and rows) 591 void roll ( const Geometry &roll_ ); 592 void roll ( const size_t columns_, 593 const size_t rows_ ); 594 595 // Rotate image counter-clockwise by specified number of degrees. 596 void rotate ( const double degrees_ ); 597 598 // Resize image by using pixel sampling algorithm 599 void sample ( const Geometry &geometry_ ); 600 601 // Resize image by using simple ratio algorithm 602 void scale ( const Geometry &geometry_ ); 603 604 // Segment (coalesce similar image components) by analyzing the 605 // histograms of the color components and identifying units that 606 // are homogeneous with the fuzzy c-means technique. Also uses 607 // QuantizeColorSpace and Verbose image attributes 608 void segment ( const double clusterThreshold_ = 1.0, 609 const double smoothingThreshold_ = 1.5 ); 610 611 // Shade image using distant light source 612 void shade ( const double azimuth_ = 30, 613 const double elevation_ = 30, 614 const bool colorShading_ = false ); 615 616 // Simulate an image shadow 617 void shadow ( const double percent_opacity_ = 80.0, 618 const double sigma_ = 0.5, 619 const ssize_t x_ = 5, 620 const ssize_t y_ = 5 ); 621 622 // Sharpen pixels in image 623 // The radius_ parameter specifies the radius of the Gaussian, in 624 // pixels, not counting the center pixel. The sigma_ parameter 625 // specifies the standard deviation of the Laplacian, in pixels. 626 void sharpen ( const double radius_ = 0.0, 627 const double sigma_ = 1.0 ); 628 void sharpenChannel ( const ChannelType channel_, 629 const double radius_ = 0.0, 630 const double sigma_ = 1.0 ); 631 632 // Shave pixels from image edges. 633 void shave ( const Geometry &geometry_ ); 634 635 // Shear image (create parallelogram by sliding image by X or Y axis) 636 void shear ( const double xShearAngle_, 637 const double yShearAngle_ ); 638 639 // adjust the image contrast with a non-linear sigmoidal contrast algorithm 640 void sigmoidalContrast ( const size_t sharpen_, const double contrast, const double midpoint = QuantumRange / 2.0 ); 641 642 // Solarize image (similar to effect seen when exposing a 643 // photographic film to light during the development process) 644 void solarize ( const double factor_ = 50.0 ); 645 646 // Splice the background color into the image. 647 void splice ( const Geometry &geometry_ ); 648 649 // Spread pixels randomly within image by specified ammount 650 void spread ( const size_t amount_ = 3 ); 651 652 // Sparse color image, given a set of coordinates, interpolates the colors 653 // found at those coordinates, across the whole image, using various 654 // methods. 655 void sparseColor ( const ChannelType channel, 656 const SparseColorMethod method, 657 const size_t number_arguments, 658 const double *arguments ); 659 660 // Add a digital watermark to the image (based on second image) 661 void stegano ( const Image &watermark_ ); 662 663 // Create an image which appears in stereo when viewed with 664 // red-blue glasses (Red image on left, blue on right) 665 void stereo ( const Image &rightImage_ ); 666 667 // Strip strips an image of all profiles and comments. 668 void strip ( void ); 669 670 // Swirl image (image pixels are rotated by degrees) 671 void swirl ( const double degrees_ ); 672 673 // Channel a texture on image background 674 void texture ( const Image &texture_ ); 675 676 // Threshold image 677 void threshold ( const double threshold_ ); 678 679 // Transform image based on image and crop geometries 680 // Crop geometry is optional 681 void transform ( const Geometry &imageGeometry_ ); 682 void transform ( const Geometry &imageGeometry_, 683 const Geometry &cropGeometry_ ); 684 685 // Add matte image to image, setting pixels matching color to 686 // transparent 687 void transparent ( const Color &color_ ); 688 689 // Add matte image to image, for all the pixels that lies in between 690 // the given two color 691 void transparentChroma ( const Color &colorLow_, const Color &colorHigh_); 692 693 // Trim edges that are the background color from the image 694 void trim ( void ); 695 696 // Image representation type (also see type attribute) 697 // Available types: 698 // Bilevel Grayscale GrayscaleMatte 699 // Palette PaletteMatte TrueColor 700 // TrueColorMatte ColorSeparation ColorSeparationMatte 701 void type ( const ImageType type_ ); 702 703 // Replace image with a sharpened version of the original image 704 // using the unsharp mask algorithm. 705 // radius_ 706 // the radius of the Gaussian, in pixels, not counting the 707 // center pixel. 708 // sigma_ 709 // the standard deviation of the Gaussian, in pixels. 710 // amount_ 711 // the percentage of the difference between the original and 712 // the blur image that is added back into the original. 713 // threshold_ 714 // the threshold in pixels needed to apply the diffence amount. 715 void unsharpmask ( const double radius_, 716 const double sigma_, 717 const double amount_, 718 const double threshold_ ); 719 void unsharpmaskChannel ( const ChannelType channel_, 720 const double radius_, 721 const double sigma_, 722 const double amount_, 723 const double threshold_ ); 724 725 // Map image pixels to a sine wave 726 void wave ( const double amplitude_ = 25.0, 727 const double wavelength_ = 150.0 ); 728 729 // Write single image frame to a file 730 void write ( const std::string &imageSpec_ ); 731 732 // Write single image frame to in-memory BLOB, with optional 733 // format and adjoin parameters. 734 void write ( Blob *blob_ ); 735 void write ( Blob *blob_, 736 const std::string &magick_ ); 737 void write ( Blob *blob_, 738 const std::string &magick_, 739 const size_t depth_ ); 740 741 // Write single image frame to an array of pixels with storage 742 // type specified by user (DispatchImage), e.g. 743 // image.write( 0, 0, 640, 1, "RGB", 0, pixels ); 744 void write ( const ::ssize_t x_, 745 const ::ssize_t y_, 746 const size_t columns_, 747 const size_t rows_, 748 const std::string& map_, 749 const StorageType type_, 750 void *pixels_ ); 751 752 // Zoom image to specified size. 753 void zoom ( const Geometry &geometry_ ); 754 755 ////////////////////////////////////////////////////////////////////// 756 // 757 // Image Attributes and Options 758 // 759 ////////////////////////////////////////////////////////////////////// 760 761 // Join images into a single multi-image file 762 void adjoin ( const bool flag_ ); 763 bool adjoin ( void ) const; 764 765 // Anti-alias Postscript and TrueType fonts (default true) 766 void antiAlias( const bool flag_ ); 767 bool antiAlias( void ); 768 769 // Time in 1/100ths of a second which must expire before 770 // displaying the next image in an animated sequence. 771 void animationDelay ( const size_t delay_ ); 772 size_t animationDelay ( void ) const; 773 774 // Number of iterations to loop an animation (e.g. Netscape loop 775 // extension) for. 776 void animationIterations ( const size_t iterations_ ); 777 size_t animationIterations ( void ) const; 778 779 // Access/Update a named image attribute 780 void attribute ( const std::string name_, 781 const std::string value_ ); 782 std::string attribute ( const std::string name_ ); 783 784 // Image background color 785 void backgroundColor ( const Color &color_ ); 786 Color backgroundColor ( void ) const; 787 788 // Name of texture image to tile onto the image background 789 void backgroundTexture (const std::string &backgroundTexture_ ); 790 std::string backgroundTexture ( void ) const; 791 792 // Base image width (before transformations) 793 size_t baseColumns ( void ) const; 794 795 // Base image filename (before transformations) 796 std::string baseFilename ( void ) const; 797 798 // Base image height (before transformations) 799 size_t baseRows ( void ) const; 800 801 // Image border color 802 void borderColor ( const Color &color_ ); 803 Color borderColor ( void ) const; 804 805 // Return smallest bounding box enclosing non-border pixels. The 806 // current fuzz value is used when discriminating between pixels. 807 // This is the crop bounding box used by crop(Geometry(0,0)); 808 Geometry boundingBox ( void ) const; 809 810 // Text bounding-box base color (default none) 811 void boxColor ( const Color &boxColor_ ); 812 Color boxColor ( void ) const; 813 814 // Pixel cache threshold in megabytes. Once this memory threshold 815 // is exceeded, all subsequent pixels cache operations are to/from 816 // disk. This setting is shared by all Image objects. 817 static void cacheThreshold ( const size_t threshold_ ); 818 819 // Chromaticity blue primary point (e.g. x=0.15, y=0.06) 820 void chromaBluePrimary ( const double x_, const double y_ ); 821 void chromaBluePrimary ( double *x_, double *y_ ) const; 822 823 // Chromaticity green primary point (e.g. x=0.3, y=0.6) 824 void chromaGreenPrimary ( const double x_, const double y_ ); 825 void chromaGreenPrimary ( double *x_, double *y_ ) const; 826 827 // Chromaticity red primary point (e.g. x=0.64, y=0.33) 828 void chromaRedPrimary ( const double x_, const double y_ ); 829 void chromaRedPrimary ( double *x_, double *y_ ) const; 830 831 // Chromaticity white point (e.g. x=0.3127, y=0.329) 832 void chromaWhitePoint ( const double x_, const double y_ ); 833 void chromaWhitePoint ( double *x_, double *y_ ) const; 834 835 // Image class (DirectClass or PseudoClass) 836 // NOTE: setting a DirectClass image to PseudoClass will result in 837 // the loss of color information if the number of colors in the 838 // image is greater than the maximum palette size (either 256 or 839 // 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when 840 // ImageMagick was built). 841 void classType ( const ClassType class_ ); 842 ClassType classType ( void ) const; 843 844 // Associate a clip mask with the image. The clip mask must be the 845 // same dimensions as the image. Pass an invalid image to unset an 846 // existing clip mask. 847 void clipMask ( const Image & clipMask_ ); 848 Image clipMask ( void ) const; 849 850 // Colors within this distance are considered equal 851 void colorFuzz ( const double fuzz_ ); 852 double colorFuzz ( void ) const; 853 854 // Color at colormap position index_ 855 void colorMap ( const size_t index_, 856 const Color &color_ ); 857 Color colorMap ( const size_t index_ ) const; 858 859 // Colormap size (number of colormap entries) 860 void colorMapSize ( const size_t entries_ ); 861 size_t colorMapSize ( void ); 862 863 // Image Color Space 864 void colorSpace ( const ColorspaceType colorSpace_ ); 865 ColorspaceType colorSpace ( void ) const; 866 867 void colorspaceType ( const ColorspaceType colorSpace_ ); 868 ColorspaceType colorspaceType ( void ) const; 869 870 // Image width 871 size_t columns ( void ) const; 872 873 // Image comment 874 std::string comment ( void ) const; 875 876 // Compression type 877 void compressType ( const CompressionType compressType_ ); 878 CompressionType compressType ( void ) const; 879 880 // Enable printing of debug messages from ImageMagick 881 void debug ( const bool flag_ ); 882 bool debug ( void ) const; 883 884 // Tagged image format define (set/access coder-specific option) The 885 // magick_ option specifies the coder the define applies to. The key_ 886 // option provides the key specific to that coder. The value_ option 887 // provides the value to set (if any). See the defineSet() method if the 888 // key must be removed entirely. 889 void defineValue ( const std::string &magick_, 890 const std::string &key_, 891 const std::string &value_ ); 892 std::string defineValue ( const std::string &magick_, 893 const std::string &key_ ) const; 894 895 // Tagged image format define. Similar to the defineValue() method 896 // except that passing the flag_ value 'true' creates a value-less 897 // define with that format and key. Passing the flag_ value 'false' 898 // removes any existing matching definition. The method returns 'true' 899 // if a matching key exists, and 'false' if no matching key exists. 900 void defineSet ( const std::string &magick_, 901 const std::string &key_, 902 bool flag_ ); 903 bool defineSet ( const std::string &magick_, 904 const std::string &key_ ) const; 905 906 // Vertical and horizontal resolution in pixels of the image 907 void density ( const Geometry &geomery_ ); 908 Geometry density ( void ) const; 909 910 // Image depth (bits allocated to red/green/blue components) 911 void depth ( const size_t depth_ ); 912 size_t depth ( void ) const; 913 914 // Tile names from within an image montage 915 std::string directory ( void ) const; 916 917 // Endianness (little like Intel or big like SPARC) for image 918 // formats which support endian-specific options. 919 void endian ( const EndianType endian_ ); 920 EndianType endian ( void ) const; 921 922 // Exif profile (BLOB) 923 void exifProfile( const Blob& exifProfile_ ); 924 Blob exifProfile( void ) const; 925 926 // Image file name 927 void fileName ( const std::string &fileName_ ); 928 std::string fileName ( void ) const; 929 930 // Number of bytes of the image on disk 931 off_t fileSize ( void ) const; 932 933 // Color to use when filling drawn objects 934 void fillColor ( const Color &fillColor_ ); 935 Color fillColor ( void ) const; 936 937 // Rule to use when filling drawn objects 938 void fillRule ( const FillRule &fillRule_ ); 939 FillRule fillRule ( void ) const; 940 941 // Pattern to use while filling drawn objects. 942 void fillPattern ( const Image &fillPattern_ ); 943 Image fillPattern ( void ) const; 944 945 // Filter to use when resizing image 946 void filterType ( const FilterTypes filterType_ ); 947 FilterTypes filterType ( void ) const; 948 949 // Text rendering font 950 void font ( const std::string &font_ ); 951 std::string font ( void ) const; 952 953 // Font point size 954 void fontPointsize ( const double pointSize_ ); 955 double fontPointsize ( void ) const; 956 957 // Obtain font metrics for text string given current font, 958 // pointsize, and density settings. 959 void fontTypeMetrics( const std::string &text_, 960 TypeMetric *metrics ); 961 962 // Long image format description 963 std::string format ( void ) const; 964 965 // Gamma level of the image 966 double gamma ( void ) const; 967 968 // Preferred size of the image when encoding 969 Geometry geometry ( void ) const; 970 971 // GIF disposal method 972 void gifDisposeMethod ( const size_t disposeMethod_ ); 973 size_t gifDisposeMethod ( void ) const; 974 975 // ICC color profile (BLOB) 976 void iccColorProfile( const Blob &colorProfile_ ); 977 Blob iccColorProfile( void ) const; 978 979 // Type of interlacing to use 980 void interlaceType ( const InterlaceType interlace_ ); 981 InterlaceType interlaceType ( void ) const; 982 983 // IPTC profile (BLOB) 984 void iptcProfile( const Blob& iptcProfile_ ); 985 Blob iptcProfile( void ) const; 986 987 // Does object contain valid image? 988 void isValid ( const bool isValid_ ); 989 bool isValid ( void ) const; 990 991 // Image label 992 std::string label ( void ) const; 993 994 // Obtain image statistics. Statistics are normalized to the range 995 // of 0.0 to 1.0 and are output to the specified ImageStatistics 996 // structure. 997typedef struct _ImageChannelStatistics 998 { 999 /* Minimum value observed */ 1000 double maximum; 1001 /* Maximum value observed */ 1002 double minimum; 1003 /* Average (mean) value observed */ 1004 double mean; 1005 /* Standard deviation, sqrt(variance) */ 1006 double standard_deviation; 1007 /* Variance */ 1008 double variance; 1009 /* Kurtosis */ 1010 double kurtosis; 1011 /* Skewness */ 1012 double skewness; 1013 } ImageChannelStatistics; 1014 1015typedef struct _ImageStatistics 1016 { 1017 ImageChannelStatistics red; 1018 ImageChannelStatistics green; 1019 ImageChannelStatistics blue; 1020 ImageChannelStatistics alpha; 1021 } ImageStatistics; 1022 1023 void statistics ( ImageStatistics *statistics ) ; 1024 1025 // Stroke width for drawing vector objects (default one) 1026 // This method is now deprecated. Please use strokeWidth instead. 1027 void lineWidth ( const double lineWidth_ ); 1028 double lineWidth ( void ) const; 1029 1030 // File type magick identifier (.e.g "GIF") 1031 void magick ( const std::string &magick_ ); 1032 std::string magick ( void ) const; 1033 1034 // Image supports transparency (matte channel) 1035 void matte ( const bool matteFlag_ ); 1036 bool matte ( void ) const; 1037 1038 // Transparent color 1039 void matteColor ( const Color &matteColor_ ); 1040 Color matteColor ( void ) const; 1041 1042 // Merge image layers 1043 void mergeLayers ( const LayerMethod layerType_ ); 1044 1045 // The mean error per pixel computed when an image is color reduced 1046 double meanErrorPerPixel ( void ) const; 1047 1048 // Image modulus depth (minimum number of bits required to support 1049 // red/green/blue components without loss of accuracy) 1050 void modulusDepth ( const size_t modulusDepth_ ); 1051 size_t modulusDepth ( void ) const; 1052 1053 // Tile size and offset within an image montage 1054 Geometry montageGeometry ( void ) const; 1055 1056 // Transform image to black and white 1057 void monochrome ( const bool monochromeFlag_ ); 1058 bool monochrome ( void ) const; 1059 1060 // The normalized max error per pixel computed when an image is 1061 // color reduced. 1062 double normalizedMaxError ( void ) const; 1063 1064 // The normalized mean error per pixel computed when an image is 1065 // color reduced. 1066 double normalizedMeanError ( void ) const; 1067 1068 // Image orientation 1069 void orientation ( const OrientationType orientation_ ); 1070 OrientationType orientation ( void ) const; 1071 1072 // Preferred size and location of an image canvas. 1073 void page ( const Geometry &pageSize_ ); 1074 Geometry page ( void ) const; 1075 1076 // Pen color (deprecated, don't use any more) 1077 void penColor ( const Color &penColor_ ); 1078 Color penColor ( void ) const; 1079 1080 // Pen texture image (deprecated, don't use any more) 1081 void penTexture ( const Image &penTexture_ ); 1082 Image penTexture ( void ) const; 1083 1084 // Get/set pixel color at location x & y. 1085 void pixelColor ( const ::ssize_t x_, 1086 const ::ssize_t y_, 1087 const Color &color_ ); 1088 Color pixelColor ( const ::ssize_t x_, 1089 const ::ssize_t y_ ) const; 1090 1091 // Add or remove a named profile to/from the image. Remove the 1092 // profile by passing an empty Blob (e.g. Blob()). Valid names are 1093 // "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name. 1094 void profile( const std::string name_, 1095 const Blob &colorProfile_ ); 1096 1097 // Retrieve a named profile from the image. Valid names are: 1098 // "8BIM", "8BIMTEXT", "APP1", "APP1JPEG", "ICC", "ICM", & "IPTC" 1099 // or an existing user/format-defined profile name. 1100 Blob profile( const std::string name_ ) const; 1101 1102 // JPEG/MIFF/PNG compression level (default 75). 1103 void quality ( const size_t quality_ ); 1104 size_t quality ( void ) const; 1105 1106 // Maximum number of colors to quantize to 1107 void quantizeColors ( const size_t colors_ ); 1108 size_t quantizeColors ( void ) const; 1109 1110 // Colorspace to quantize in. 1111 void quantizeColorSpace ( const ColorspaceType colorSpace_ ); 1112 ColorspaceType quantizeColorSpace ( void ) const; 1113 1114 // Dither image during quantization (default true). 1115 void quantizeDither ( const bool ditherFlag_ ); 1116 bool quantizeDither ( void ) const; 1117 1118 // Quantization tree-depth 1119 void quantizeTreeDepth ( const size_t treeDepth_ ); 1120 size_t quantizeTreeDepth ( void ) const; 1121 1122 // The type of rendering intent 1123 void renderingIntent ( const RenderingIntent renderingIntent_ ); 1124 RenderingIntent renderingIntent ( void ) const; 1125 1126 // Units of image resolution 1127 void resolutionUnits ( const ResolutionType resolutionUnits_ ); 1128 ResolutionType resolutionUnits ( void ) const; 1129 1130 // The number of pixel rows in the image 1131 size_t rows ( void ) const; 1132 1133 // Image scene number 1134 void scene ( const size_t scene_ ); 1135 size_t scene ( void ) const; 1136 1137 // Image signature. Set force_ to true in order to re-calculate 1138 // the signature regardless of whether the image data has been 1139 // modified. 1140 std::string signature ( const bool force_ = false ) const; 1141 1142 // Width and height of a raw image 1143 void size ( const Geometry &geometry_ ); 1144 Geometry size ( void ) const; 1145 1146 // enabled/disable stroke anti-aliasing 1147 void strokeAntiAlias( const bool flag_ ); 1148 bool strokeAntiAlias( void ) const; 1149 1150 // Color to use when drawing object outlines 1151 void strokeColor ( const Color &strokeColor_ ); 1152 Color strokeColor ( void ) const; 1153 1154 // Specify the pattern of dashes and gaps used to stroke 1155 // paths. The strokeDashArray represents a zero-terminated array 1156 // of numbers that specify the lengths of alternating dashes and 1157 // gaps in pixels. If an odd number of values is provided, then 1158 // the list of values is repeated to yield an even number of 1159 // values. A typical strokeDashArray_ array might contain the 1160 // members 5 3 2 0, where the zero value indicates the end of the 1161 // pattern array. 1162 void strokeDashArray ( const double* strokeDashArray_ ); 1163 const double* strokeDashArray ( void ) const; 1164 1165 // While drawing using a dash pattern, specify distance into the 1166 // dash pattern to start the dash (default 0). 1167 void strokeDashOffset ( const double strokeDashOffset_ ); 1168 double strokeDashOffset ( void ) const; 1169 1170 // Specify the shape to be used at the end of open subpaths when 1171 // they are stroked. Values of LineCap are UndefinedCap, ButtCap, 1172 // RoundCap, and SquareCap. 1173 void strokeLineCap ( const LineCap lineCap_ ); 1174 LineCap strokeLineCap ( void ) const; 1175 1176 // Specify the shape to be used at the corners of paths (or other 1177 // vector shapes) when they are stroked. Values of LineJoin are 1178 // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. 1179 void strokeLineJoin ( const LineJoin lineJoin_ ); 1180 LineJoin strokeLineJoin ( void ) const; 1181 1182 // Specify miter limit. When two line segments meet at a sharp 1183 // angle and miter joins have been specified for 'lineJoin', it is 1184 // possible for the miter to extend far beyond the thickness of 1185 // the line stroking the path. The miterLimit' imposes a limit on 1186 // the ratio of the miter length to the 'lineWidth'. The default 1187 // value of this parameter is 4. 1188 void strokeMiterLimit ( const size_t miterLimit_ ); 1189 size_t strokeMiterLimit ( void ) const; 1190 1191 // Pattern image to use while stroking object outlines. 1192 void strokePattern ( const Image &strokePattern_ ); 1193 Image strokePattern ( void ) const; 1194 1195 // Stroke width for drawing vector objects (default one) 1196 void strokeWidth ( const double strokeWidth_ ); 1197 double strokeWidth ( void ) const; 1198 1199 // Subimage of an image sequence 1200 void subImage ( const size_t subImage_ ); 1201 size_t subImage ( void ) const; 1202 1203 // Number of images relative to the base image 1204 void subRange ( const size_t subRange_ ); 1205 size_t subRange ( void ) const; 1206 1207 // Annotation text encoding (e.g. "UTF-16") 1208 void textEncoding ( const std::string &encoding_ ); 1209 std::string textEncoding ( void ) const; 1210 1211 // Number of colors in the image 1212 size_t totalColors ( void ); 1213 1214 // Origin of coordinate system to use when annotating with text or drawing 1215 void transformOrigin ( const double x_,const double y_ ); 1216 1217 // Rotation to use when annotating with text or drawing 1218 void transformRotation ( const double angle_ ); 1219 1220 // Reset transformation parameters to default 1221 void transformReset ( void ); 1222 1223 // Scale to use when annotating with text or drawing 1224 void transformScale ( const double sx_, const double sy_ ); 1225 1226 // Skew to use in X axis when annotating with text or drawing 1227 void transformSkewX ( const double skewx_ ); 1228 1229 // Skew to use in Y axis when annotating with text or drawing 1230 void transformSkewY ( const double skewy_ ); 1231 1232 // Image representation type (also see type operation) 1233 // Available types: 1234 // Bilevel Grayscale GrayscaleMatte 1235 // Palette PaletteMatte TrueColor 1236 // TrueColorMatte ColorSeparation ColorSeparationMatte 1237 ImageType type ( void ) const; 1238 1239 // Print detailed information about the image 1240 void verbose ( const bool verboseFlag_ ); 1241 bool verbose ( void ) const; 1242 1243 // FlashPix viewing parameters 1244 void view ( const std::string &view_ ); 1245 std::string view ( void ) const; 1246 1247 // Virtual pixel method 1248 void virtualPixelMethod ( const VirtualPixelMethod virtual_pixel_method_ ); 1249 VirtualPixelMethod virtualPixelMethod ( void ) const; 1250 1251 // X11 display to display to, obtain fonts from, or to capture 1252 // image from 1253 void x11Display ( const std::string &display_ ); 1254 std::string x11Display ( void ) const; 1255 1256 // x resolution of the image 1257 double xResolution ( void ) const; 1258 1259 // y resolution of the image 1260 double yResolution ( void ) const; 1261 1262 ////////////////////////////////////////////////////////////////////// 1263 // 1264 // Low-level Pixel Access Routines 1265 // 1266 // Also see the Pixels class, which provides support for multiple 1267 // cache views. 1268 // 1269 ////////////////////////////////////////////////////////////////////// 1270 1271 1272 // Transfers read-only pixels from the image to the pixel cache as 1273 // defined by the specified region 1274 const Quantum* getConstPixels ( const ::ssize_t x_, const ::ssize_t y_, 1275 const size_t columns_, 1276 const size_t rows_ ) const; 1277 1278 // Obtain mutable image pixel metacontent (valid for PseudoClass images) 1279 void* getMetacontent ( void ); 1280 1281 // Obtain immutable image pixel metacontent (valid for PseudoClass images) 1282 const void* getConstMetacontent ( void ) const; 1283 1284 // Transfers pixels from the image to the pixel cache as defined 1285 // by the specified region. Modified pixels may be subsequently 1286 // transferred back to the image via syncPixels. This method is 1287 // valid for DirectClass images. 1288 Quantum* getPixels ( const ::ssize_t x_, const ::ssize_t y_, 1289 const size_t columns_, 1290 const size_t rows_ ); 1291 1292 // Allocates a pixel cache region to store image pixels as defined 1293 // by the region rectangle. This area is subsequently transferred 1294 // from the pixel cache to the image via syncPixels. 1295 Quantum* setPixels ( const ::ssize_t x_, const ::ssize_t y_, 1296 const size_t columns_, 1297 const size_t rows_ ); 1298 1299 // Transfers the image cache pixels to the image. 1300 void syncPixels ( void ); 1301 1302 // Transfers one or more pixel components from a buffer or file 1303 // into the image pixel cache of an image. 1304 // Used to support image decoders. 1305 void readPixels ( const QuantumType quantum_, 1306 const unsigned char *source_ ); 1307 1308 // Transfers one or more pixel components from the image pixel 1309 // cache to a buffer or file. 1310 // Used to support image encoders. 1311 void writePixels ( const QuantumType quantum_, 1312 unsigned char *destination_ ); 1313 1314 ////////////////////////////////////////////////////////////////////// 1315 // 1316 // No user-serviceable parts beyond this point 1317 // 1318 ////////////////////////////////////////////////////////////////////// 1319 1320 1321 // Construct with MagickCore::Image and default options 1322 Image ( MagickCore::Image* image_ ); 1323 1324 // Retrieve Image* 1325 MagickCore::Image*& image( void ); 1326 const MagickCore::Image* constImage( void ) const; 1327 1328 // Retrieve Options* 1329 Options* options( void ); 1330 const Options* constOptions( void ) const; 1331 1332 // Retrieve ImageInfo* 1333 MagickCore::ImageInfo * imageInfo( void ); 1334 const MagickCore::ImageInfo * constImageInfo( void ) const; 1335 1336 // Retrieve QuantizeInfo* 1337 MagickCore::QuantizeInfo * quantizeInfo( void ); 1338 const MagickCore::QuantizeInfo * constQuantizeInfo( void ) const; 1339 1340 // Replace current image (reference counted) 1341 MagickCore::Image* replaceImage ( MagickCore::Image* replacement_ ); 1342 1343 // Prepare to update image (copy if reference > 1) 1344 void modifyImage ( void ); 1345 1346 // Test for ImageMagick error and throw exception if error 1347 void throwImageException( void ) const; 1348 1349 // Register image with image registry or obtain registration id 1350 ::ssize_t registerId( void ); 1351 1352 // Unregister image from image registry 1353 void unregisterId( void) ; 1354 1355 private: 1356 ImageRef * _imgRef; 1357 }; 1358 1359} // end of namespace Magick 1360 1361// 1362// Inlines 1363// 1364 1365 1366// 1367// Image 1368// 1369 1370 1371// Reduce noise in image using a noise peak elimination filter 1372inline void Magick::Image::reduceNoise ( void ) 1373{ 1374 reduceNoise( 3.0 ); 1375} 1376 1377// Stroke width for drawing vector objects (default one) 1378inline void Magick::Image::lineWidth ( const double lineWidth_ ) 1379{ 1380 strokeWidth( lineWidth_ ); 1381} 1382inline double Magick::Image::lineWidth ( void ) const 1383{ 1384 return strokeWidth( ); 1385} 1386 1387// Get image storage class 1388inline Magick::ClassType Magick::Image::classType ( void ) const 1389{ 1390 return static_cast<Magick::ClassType>(constImage()->storage_class); 1391} 1392 1393// Get number of image columns 1394inline size_t Magick::Image::columns ( void ) const 1395{ 1396 return constImage()->columns; 1397} 1398 1399// Get number of image rows 1400inline size_t Magick::Image::rows ( void ) const 1401{ 1402 return constImage()->rows; 1403} 1404 1405#endif // Magick_Image_header 1406