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