Magick++: Image.cpp Source File

Magick++ 7.1.0

Image.cpp
Go to the documentation of this file.
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4 //
5 // Copyright @ 2013 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // Implementation of Image
9 //
10
11 #define MAGICKCORE_IMPLEMENTATION 1
12 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
13
14 #include "Magick++/Include.h"
15 #include <cstdlib>
16 #include <string>
17 #include <string.h>
18 #include <errno.h>
19 #include <math.h>
20
21 #include "Magick++/Image.h"
22 #include "Magick++/Functions.h"
23 #include "Magick++/Pixels.h"
24 #include "Magick++/Options.h"
25 #include "Magick++/ImageRef.h"
26
27 using namespace std;
28
29 #define AbsoluteValue(x) ((x) < 0 ? -(x) : (x))
30 #define MagickPI 3.14159265358979323846264338327950288419716939937510
31 #define DegreesToRadians(x) (MagickPI*(x)/180.0)
32 #define ThrowImageException ThrowPPException(quiet())
33
34 MagickPPExport const char *Magick::borderGeometryDefault="6x6+0+0";
35 MagickPPExport const char *Magick::frameGeometryDefault="25x25+6+6";
36 MagickPPExport const char *Magick::raiseGeometryDefault="6x6+0+0";
37
38 MagickPPExport int Magick::operator == (const Magick::Image &left_,
39 const Magick::Image &right_)
40 {
41 // If image pixels and signature are the same, then the image is identical
42 return((left_.rows() == right_.rows()) &&
43 (left_.columns() == right_.columns()) &&
44 (left_.signature() == right_.signature()));
45 }
46
47 MagickPPExport int Magick::operator != (const Magick::Image &left_,
48 const Magick::Image &right_)
49 {
50 return(!(left_ == right_));
51 }
52
53 MagickPPExport int Magick::operator > (const Magick::Image &left_,
54 const Magick::Image &right_)
55 {
56 return(!(left_ < right_) && (left_ != right_));
57 }
58
59 MagickPPExport int Magick::operator < (const Magick::Image &left_,
60 const Magick::Image &right_)
61 {
62 // If image pixels are less, then image is smaller
63 return((left_.rows() * left_.columns()) <
64 (right_.rows() * right_.columns()));
65 }
66
67 MagickPPExport int Magick::operator >= (const Magick::Image &left_,
68 const Magick::Image &right_)
69 {
70 return((left_ > right_) || (left_ == right_));
71 }
72
73 MagickPPExport int Magick::operator <= (const Magick::Image &left_,
74 const Magick::Image &right_)
75 {
76 return((left_ < right_) || ( left_ == right_));
77 }
78
79 Magick::Image::Image(void)
80 : _imgRef(new ImageRef)
81 {
82 }
83
84 Magick::Image::Image(const Blob &blob_)
85 : _imgRef(new ImageRef)
86 {
87 try
88 {
89 // Initialize, Allocate and Read images
90 quiet(true);
91 read(blob_);
92 quiet(false);
93 }
94 catch (const Error&)
95 {
96 // Release resources
97 delete _imgRef;
98 throw;
99 }
100 }
101
102 Magick::Image::Image(const Blob &blob_,const Geometry &size_)
103 : _imgRef(new ImageRef)
104 {
105 try
106 {
107 // Read from Blob
108 quiet(true);
109 read(blob_, size_);
110 quiet(false);
111 }
112 catch(const Error&)
113 {
114 // Release resources
115 delete _imgRef;
116 throw;
117 }
118 }
119
120 Magick::Image::Image(const Blob &blob_,const Geometry &size_,
121 const size_t depth_)
122 : _imgRef(new ImageRef)
123 {
124 try
125 {
126 // Read from Blob
127 quiet(true);
128 read(blob_,size_,depth_);
129 quiet(false);
130 }
131 catch(const Error&)
132 {
133 // Release resources
134 delete _imgRef;
135 throw;
136 }
137 }
138
139 Magick::Image::Image(const Blob &blob_,const Geometry &size_,
140 const size_t depth_,const std::string &magick_)
141 : _imgRef(new ImageRef)
142 {
143 try
144 {
145 // Read from Blob
146 quiet(true);
147 read(blob_,size_,depth_,magick_);
148 quiet(false);
149 }
150 catch(const Error&)
151 {
152 // Release resources
153 delete _imgRef;
154 throw;
155 }
156 }
157
158 Magick::Image::Image(const Blob &blob_,const Geometry &size_,
159 const std::string &magick_)
160 : _imgRef(new ImageRef)
161 {
162 try
163 {
164 // Read from Blob
165 quiet(true);
166 read(blob_,size_,magick_);
167 quiet(false);
168 }
169 catch(const Error&)
170 {
171 // Release resources
172 delete _imgRef;
173 throw;
174 }
175 }
176
177 Magick::Image::Image(const Geometry &size_,const Color &color_)
178 : _imgRef(new ImageRef)
179 {
180 // xc: prefix specifies an X11 color string
181 std::string imageSpec("xc:");
182 imageSpec+=color_;
183
184 try
185 {
186 quiet(true);
187 // Set image size
188 size(size_);
189
190 // Initialize, Allocate and Read images
191 read(imageSpec);
192 quiet(false);
193 }
194 catch(const Error&)
195 {
196 // Release resources
197 delete _imgRef;
198 throw;
199 }
200 }
201
202 Magick::Image::Image(const Image &image_)
203 : _imgRef(image_._imgRef)
204 {
205 _imgRef->increase();
206 }
207
208 Magick::Image::Image(const Image &image_,const Geometry &geometry_)
209 : _imgRef(new ImageRef)
210 {
211 const RectangleInfo
212 geometry=geometry_;
213
214 OffsetInfo
215 offset;
216
217 MagickCore::Image
218 *image;
219
220 GetPPException;
221 image=CloneImage(image_.constImage(),geometry_.width(),geometry_.height(),
222 MagickTrue,exceptionInfo);
223 replaceImage(image);
224 _imgRef->options(new Options(*image_.constOptions()));
225 offset.x=0;
226 offset.y=0;
227 (void) CopyImagePixels(image,image_.constImage(),&geometry,&offset,
228 exceptionInfo);
229 ThrowImageException;
230 }
231
232 Magick::Image::Image(const size_t width_,const size_t height_,
233 const std::string &map_,const StorageType type_,const void *pixels_)
234 : _imgRef(new ImageRef)
235 {
236 try
237 {
238 quiet(true);
239 read(width_,height_,map_.c_str(),type_,pixels_);
240 quiet(false);
241 }
242 catch(const Error&)
243 {
244 // Release resources
245 delete _imgRef;
246 throw;
247 }
248 }
249
250 Magick::Image::Image(const std::string &imageSpec_)
251 : _imgRef(new ImageRef)
252 {
253 try
254 {
255 // Initialize, Allocate and Read images
256 quiet(true);
257 read(imageSpec_);
258 quiet(false);
259 }
260 catch(const Error&)
261 {
262 // Release resources
263 delete _imgRef;
264 throw;
265 }
266 }
267
268 Magick::Image::~Image()
269 {
270 try
271 {
272 if (_imgRef->decrease() == 0)
273 delete _imgRef;
274 }
275 catch(Magick::Exception&)
276 {
277 }
278
279 _imgRef=(Magick::ImageRef *) NULL;
280 }
281
282 Magick::Image& Magick::Image::operator=(const Magick::Image &image_)
283 {
284 if (this != &image_)
285 {
286 image_._imgRef->increase();
287 if (_imgRef->decrease() == 0)
288 delete _imgRef;
289
290 // Use new image reference
291 _imgRef=image_._imgRef;
292 }
293 return(*this);
294 }
295
296 void Magick::Image::adjoin(const bool flag_)
297 {
298 modifyImage();
299 options()->adjoin(flag_);
300 }
301
302 bool Magick::Image::adjoin(void) const
303 {
304 return(constOptions()->adjoin());
305 }
306
307 void Magick::Image::alpha(const bool alphaFlag_)
308 {
309 modifyImage();
310
311 // If matte channel is requested, but image doesn't already have a
312 // matte channel, then create an opaque matte channel. Likewise, if
313 // the image already has a matte channel but a matte channel is not
314 // desired, then set the matte channel to opaque.
315 GetPPException;
316 if (bool(alphaFlag_) != bool(constImage()->alpha_trait))
317 SetImageAlpha(image(),OpaqueAlpha,exceptionInfo);
318 ThrowImageException;
319
320 image()->alpha_trait=alphaFlag_ ? BlendPixelTrait : UndefinedPixelTrait;
321 }
322
323 bool Magick::Image::alpha(void) const
324 {
325 if (constImage()->alpha_trait == BlendPixelTrait)
326 return(true);
327 else
328 return(false);
329 }
330
331 void Magick::Image::matteColor(const Color &matteColor_)
332 {
333 modifyImage();
334
335 if (matteColor_.isValid())
336 {
337 image()->matte_color=matteColor_;
338 options()->matteColor(matteColor_);
339 }
340 else
341 {
342 // Set to default matte color
343 Color tmpColor("#BDBDBD");
344 image()->matte_color=tmpColor;
345 options()->matteColor(tmpColor);
346 }
347 }
348
349 Magick::Color Magick::Image::matteColor(void) const
350 {
351 return(Color(constImage()->matte_color));
352 }
353
354 void Magick::Image::animationDelay(const size_t delay_)
355 {
356 modifyImage();
357 image()->delay=delay_;
358 }
359
360 size_t Magick::Image::animationDelay(void) const
361 {
362 return(constImage()->delay);
363 }
364
365 void Magick::Image::animationIterations(const size_t iterations_)
366 {
367 modifyImage();
368 image()->iterations=iterations_;
369 }
370
371 size_t Magick::Image::animationIterations(void) const
372 {
373 return(constImage()->iterations);
374 }
375
376 void Magick::Image::backgroundColor(const Color &backgroundColor_)
377 {
378 modifyImage();
379
380 if (backgroundColor_.isValid())
381 image()->background_color=backgroundColor_;
382 else
383 image()->background_color=Color();
384
385 options()->backgroundColor(backgroundColor_);
386 }
387
388 Magick::Color Magick::Image::backgroundColor(void) const
389 {
390 return(constOptions()->backgroundColor());
391 }
392
393 void Magick::Image::backgroundTexture(const std::string &backgroundTexture_)
394 {
395 modifyImage();
396 options()->backgroundTexture(backgroundTexture_);
397 }
398
399 std::string Magick::Image::backgroundTexture(void) const
400 {
401 return(constOptions()->backgroundTexture());
402 }
403
404 size_t Magick::Image::baseColumns(void) const
405 {
406 return(constImage()->magick_columns);
407 }
408
409 std::string Magick::Image::baseFilename(void) const
410 {
411 return(std::string(constImage()->magick_filename));
412 }
413
414 size_t Magick::Image::baseRows(void) const
415 {
416 return(constImage()->magick_rows);
417 }
418
419 void Magick::Image::blackPointCompensation(const bool flag_)
420 {
421 image()->black_point_compensation=(MagickBooleanType) flag_;
422 }
423
424 bool Magick::Image::blackPointCompensation(void) const
425 {
426 return(static_cast<bool>(constImage()->black_point_compensation));
427 }
428
429 void Magick::Image::borderColor(const Color &borderColor_)
430 {
431 modifyImage();
432
433 if (borderColor_.isValid())
434 image()->border_color=borderColor_;
435 else
436 image()->border_color=Color();
437
438 options()->borderColor(borderColor_);
439 }
440
441 Magick::Color Magick::Image::borderColor(void) const
442 {
443 return(constOptions()->borderColor());
444 }
445
446 Magick::Geometry Magick::Image::boundingBox(void) const
447 {
448 RectangleInfo
449 bbox;
450
451 GetPPException;
452 bbox=GetImageBoundingBox(constImage(),exceptionInfo);
453 ThrowImageException;
454 return(Geometry(bbox));
455 }
456
457 void Magick::Image::boxColor(const Color &boxColor_)
458 {
459 modifyImage();
460 options()->boxColor(boxColor_);
461 }
462
463 Magick::Color Magick::Image::boxColor(void) const
464 {
465 return(constOptions()->boxColor());
466 }
467
468 void Magick::Image::channelDepth(const ChannelType channel_,
469 const size_t depth_)
470 {
471 modifyImage();
472 GetPPException;
473 GetAndSetPPChannelMask(channel_);
474 SetImageDepth(image(),depth_,exceptionInfo);
475 RestorePPChannelMask;
476 ThrowImageException;
477 }
478
479 size_t Magick::Image::channelDepth(const ChannelType channel_)
480 {
481 size_t
482 channel_depth;
483
484 GetPPException;
485 GetAndSetPPChannelMask(channel_);
486 channel_depth=GetImageDepth(constImage(),exceptionInfo);
487 RestorePPChannelMask;
488 ThrowImageException;
489 return(channel_depth);
490 }
491
492 size_t Magick::Image::channels() const
493 {
494 return(constImage()->number_channels);
495 }
496
497 void Magick::Image::classType(const ClassType class_)
498 {
499 if (classType() == PseudoClass && class_ == DirectClass)
500 {
501 // Use SyncImage to synchronize the DirectClass pixels with the
502 // color map and then set to DirectClass type.
503 modifyImage();
504 GetPPException;
505 SyncImage(image(),exceptionInfo);
506 ThrowImageException;
507 image()->colormap=(PixelInfo *)RelinquishMagickMemory(image()->colormap);
508 image()->storage_class=static_cast<MagickCore::ClassType>(DirectClass);
509 return;
510 }
511
512 if (classType() == DirectClass && class_ == PseudoClass)
513 {
514 // Quantize to create PseudoClass color map
515 modifyImage();
516 quantizeColors(MaxColormapSize);
517 quantize();
518 image()->storage_class=static_cast<MagickCore::ClassType>(PseudoClass);
519 }
520 }
521
522 Magick::ClassType Magick::Image::classType(void) const
523 {
524 return static_cast<Magick::ClassType>(constImage()->storage_class);
525 }
526
527 void Magick::Image::colorFuzz(const double fuzz_)
528 {
529 modifyImage();
530 image()->fuzz=fuzz_;
531 options()->colorFuzz(fuzz_);
532 }
533
534 double Magick::Image::colorFuzz(void) const
535 {
536 return(constOptions()->colorFuzz());
537 }
538
539 void Magick::Image::colorMapSize(const size_t entries_)
540 {
541 if (entries_ >MaxColormapSize)
542 throwExceptionExplicit(MagickCore::OptionError,
543 "Colormap entries must not exceed MaxColormapSize");
544
545 modifyImage();
546 GetPPException;
547 (void) AcquireImageColormap(image(),entries_,exceptionInfo);
548 ThrowImageException;
549 }
550
551 size_t Magick::Image::colorMapSize(void) const
552 {
553 if (!constImage()->colormap)
554 throwExceptionExplicit(MagickCore::OptionError,
555 "Image does not contain a colormap");
556
557 return(constImage()->colors);
558 }
559
560 void Magick::Image::colorSpace(const ColorspaceType colorSpace_)
561 {
562 if (image()->colorspace == colorSpace_)
563 return;
564
565 modifyImage();
566 GetPPException;
567 TransformImageColorspace(image(),colorSpace_,exceptionInfo);
568 ThrowImageException;
569 }
570
571 Magick::ColorspaceType Magick::Image::colorSpace(void) const
572 {
573 return (constImage()->colorspace);
574 }
575
576 void Magick::Image::colorSpaceType(const ColorspaceType colorSpace_)
577 {
578 modifyImage();
579 GetPPException;
580 SetImageColorspace(image(),colorSpace_,exceptionInfo);
581 ThrowImageException;
582 options()->colorspaceType(colorSpace_);
583 }
584
585 Magick::ColorspaceType Magick::Image::colorSpaceType(void) const
586 {
587 return(constOptions()->colorspaceType());
588 }
589
590 size_t Magick::Image::columns(void) const
591 {
592 return(constImage()->columns);
593 }
594
595 void Magick::Image::comment(const std::string &comment_)
596 {
597 modifyImage();
598 GetPPException;
599 SetImageProperty(image(),"Comment",NULL,exceptionInfo);
600 if (comment_.length() > 0)
601 SetImageProperty(image(),"Comment",comment_.c_str(),exceptionInfo);
602 ThrowImageException;
603 }
604
605 std::string Magick::Image::comment(void) const
606 {
607 const char
608 *value;
609
610 GetPPException;
611 value=GetImageProperty(constImage(),"Comment",exceptionInfo);
612 ThrowImageException;
613
614 if (value)
615 return(std::string(value));
616
617 return(std::string()); // Intentionally no exception
618 }
619
620 void Magick::Image::compose(const CompositeOperator compose_)
621 {
622 image()->compose=compose_;
623 }
624
625 Magick::CompositeOperator Magick::Image::compose(void) const
626 {
627 return(constImage()->compose);
628 }
629
630 void Magick::Image::compressType(const CompressionType compressType_)
631 {
632 modifyImage();
633 image()->compression=compressType_;
634 options()->compressType(compressType_);
635 }
636
637 Magick::CompressionType Magick::Image::compressType(void) const
638 {
639 return(constImage()->compression);
640 }
641
642 void Magick::Image::debug(const bool flag_)
643 {
644 modifyImage();
645 options()->debug(flag_);
646 }
647
648 bool Magick::Image::debug(void) const
649 {
650 return(constOptions()->debug());
651 }
652
653 void Magick::Image::density(const Point &density_)
654 {
655 modifyImage();
656 options()->density(density_);
657 if (density_.isValid())
658 {
659 image()->resolution.x=density_.x();
660 if (density_.y() != 0.0)
661 image()->resolution.y=density_.y();
662 else
663 image()->resolution.y=density_.x();
664 }
665 else
666 {
667 // Reset to default
668 image()->resolution.x=0.0;
669 image()->resolution.y=0.0;
670 }
671 }
672
673 Magick::Point Magick::Image::density(void) const
674 {
675 if (isValid())
676 {
677 ssize_t
678 x_resolution=72,
679 y_resolution=72;
680
681 if (constImage()->resolution.x > 0.0)
682 x_resolution=constImage()->resolution.x;
683
684 if (constImage()->resolution.y > 0.0)
685 y_resolution=constImage()->resolution.y;
686
687 return(Point(x_resolution,y_resolution));
688 }
689
690 return(constOptions()->density());
691 }
692
693 void Magick::Image::depth(const size_t depth_)
694 {
695 modifyImage();
696 image()->depth=depth_;
697 options()->depth(depth_);
698 }
699
700 size_t Magick::Image::depth(void) const
701 {
702 return(constImage()->depth);
703 }
704
705 std::string Magick::Image::directory(void) const
706 {
707 if (constImage()->directory)
708 return(std::string(constImage()->directory));
709
710 if (!quiet())
711 throwExceptionExplicit(MagickCore::CorruptImageWarning,
712 "Image does not contain a directory");
713
714 return(std::string());
715 }
716
717 void Magick::Image::endian(const Magick::EndianType endian_)
718 {
719 modifyImage();
720 options()->endian(endian_);
721 image()->endian=endian_;
722 }
723
724 Magick::EndianType Magick::Image::endian(void) const
725 {
726 return(constImage()->endian);
727 }
728
729 void Magick::Image::exifProfile(const Magick::Blob &exifProfile_)
730 {
731 modifyImage();
732
733 if (exifProfile_.data() != 0)
734 {
735 StringInfo
736 *exif_profile;
737
738 exif_profile=AcquireStringInfo(exifProfile_.length());
739 SetStringInfoDatum(exif_profile,(unsigned char *) exifProfile_.data());
740 GetPPException;
741 (void) SetImageProfile(image(),"exif",exif_profile,exceptionInfo);
742 exif_profile=DestroyStringInfo(exif_profile);
743 ThrowImageException;
744 }
745 }
746
747 Magick::Blob Magick::Image::exifProfile(void) const
748 {
749 const StringInfo
750 *exif_profile;
751
752 exif_profile=GetImageProfile(constImage(),"exif");
753 if (exif_profile == (StringInfo *) NULL)
754 return(Blob());
755 return(Blob(GetStringInfoDatum(exif_profile),
756 GetStringInfoLength(exif_profile)));
757 }
758
759 void Magick::Image::fileName(const std::string &fileName_)
760 {
761 ssize_t
762 max_length;
763
764 modifyImage();
765
766 max_length=sizeof(image()->filename)-1;
767 fileName_.copy(image()->filename,max_length);
768 if ((ssize_t) fileName_.length() > max_length)
769 image()->filename[max_length]=0;
770 else
771 image()->filename[fileName_.length()]=0;
772
773 options()->fileName(fileName_);
774 }
775
776 std::string Magick::Image::fileName(void) const
777 {
778 return(constOptions()->fileName());
779 }
780
781 MagickCore::MagickSizeType Magick::Image::fileSize(void) const
782 {
783 return(GetBlobSize(constImage()));
784 }
785
786 void Magick::Image::fillColor(const Magick::Color &fillColor_)
787 {
788 modifyImage();
789 options()->fillColor(fillColor_);
790 }
791
792 Magick::Color Magick::Image::fillColor(void) const
793 {
794 return(constOptions()->fillColor());
795 }
796
797 void Magick::Image::fillRule(const Magick::FillRule &fillRule_)
798 {
799 modifyImage();
800 options()->fillRule(fillRule_);
801 }
802
803 Magick::FillRule Magick::Image::fillRule(void) const
804 {
805 return constOptions()->fillRule();
806 }
807
808 void Magick::Image::fillPattern(const Image &fillPattern_)
809 {
810 modifyImage();
811 if (fillPattern_.isValid())
812 options()->fillPattern(fillPattern_.constImage());
813 else
814 options()->fillPattern(static_cast<MagickCore::Image*>(NULL));
815 }
816
817 Magick::Image Magick::Image::fillPattern(void) const
818 {
819 // FIXME: This is inordinately innefficient
820 const MagickCore::Image
821 *tmpTexture;
822
823 Image
824 texture;
825
826 tmpTexture=constOptions()->fillPattern();
827
828 if (tmpTexture)
829 {
830 MagickCore::Image
831 *image;
832
833 GetPPException;
834 image=CloneImage(tmpTexture,0,0,MagickTrue,exceptionInfo);
835 texture.replaceImage(image);
836 ThrowImageException;
837 }
838 return(texture);
839 }
840
841 void Magick::Image::filterType(const Magick::FilterType filterType_)
842 {
843 modifyImage();
844 image()->filter=filterType_;
845 }
846
847 Magick::FilterType Magick::Image::filterType(void) const
848 {
849 return(constImage()->filter);
850 }
851
852 void Magick::Image::font(const std::string &font_)
853 {
854 modifyImage();
855 options()->font(font_);
856 }
857
858 std::string Magick::Image::font(void) const
859 {
860 return(constOptions()->font());
861 }
862
863 void Magick::Image::fontFamily(const std::string &family_)
864 {
865 modifyImage();
866 options()->fontFamily(family_);
867 }
868
869 std::string Magick::Image::fontFamily(void) const
870 {
871 return(constOptions()->fontFamily());
872 }
873
874 void Magick::Image::fontPointsize(const double pointSize_)
875 {
876 modifyImage();
877 options()->fontPointsize(pointSize_);
878 }
879
880 double Magick::Image::fontPointsize(void) const
881 {
882 return(constOptions()->fontPointsize());
883 }
884
885 void Magick::Image::fontStyle(const StyleType pointSize_)
886 {
887 modifyImage();
888 options()->fontStyle(pointSize_);
889 }
890
891 Magick::StyleType Magick::Image::fontStyle(void) const
892 {
893 return(constOptions()->fontStyle());
894 }
895
896 void Magick::Image::fontWeight(const size_t weight_)
897 {
898 modifyImage();
899 options()->fontWeight(weight_);
900 }
901
902 size_t Magick::Image::fontWeight(void) const
903 {
904 return(constOptions()->fontWeight());
905 }
906
907 std::string Magick::Image::format(void) const
908 {
909 const MagickInfo
910 *magick_info;
911
912 GetPPException;
913 magick_info=GetMagickInfo(constImage()->magick,exceptionInfo);
914 ThrowImageException;
915
916 if ((magick_info != 0) && (*magick_info->description != '\0'))
917 return(std::string(magick_info->description));
918
919 if (!quiet())
920 throwExceptionExplicit(MagickCore::CorruptImageWarning,
921 "Unrecognized image magick type");
922
923 return(std::string());
924 }
925
926 std::string Magick::Image::formatExpression(const std::string expression)
927 {
928 char
929 *text;
930
931 std::string
932 text_string;
933
934 GetPPException;
935 modifyImage();
936 text=InterpretImageProperties(imageInfo(),image(),expression.c_str(),
937 exceptionInfo);
938 if (text != (char *) NULL)
939 {
940 text_string=std::string(text);
941 text=DestroyString(text);
942 }
943 ThrowImageException;
944 return(text_string);
945 }
946
947 double Magick::Image::gamma(void) const
948 {
949 return(constImage()->gamma);
950 }
951
952 Magick::Geometry Magick::Image::geometry(void) const
953 {
954 if (constImage()->geometry)
955 return Geometry(constImage()->geometry);
956
957 if (!quiet())
958 throwExceptionExplicit(MagickCore::OptionWarning,
959 "Image does not contain a geometry");
960
961 return(Geometry());
962 }
963
964 void Magick::Image::gifDisposeMethod(
965 const MagickCore::DisposeType disposeMethod_)
966 {
967 modifyImage();
968 image()->dispose=disposeMethod_;
969 }
970
971 MagickCore::DisposeType Magick::Image::gifDisposeMethod(void) const
972 {
973 return(constImage()->dispose);
974 }
975
976 bool Magick::Image::hasChannel(const PixelChannel channel) const
977 {
978 if (GetPixelChannelTraits(constImage(),channel) == UndefinedPixelTrait)
979 return(false);
980
981 if (channel == GreenPixelChannel || channel == BluePixelChannel)
982 return (GetPixelChannelOffset(constImage(),channel) == (ssize_t)channel);
983
984 return(true);
985 }
986
987 void Magick::Image::highlightColor(const Color color_)
988 {
989 std::string
990 value;
991
992 value=color_;
993 artifact("compare:highlight-color",value);
994 }
995
996 void Magick::Image::iccColorProfile(const Magick::Blob &colorProfile_)
997 {
998 profile("icc",colorProfile_);
999 }
1000
1001 Magick::Blob Magick::Image::iccColorProfile(void) const
1002 {
1003 const StringInfo
1004 *color_profile;
1005
1006 color_profile=GetImageProfile(constImage(),"icc");
1007 if (color_profile == (StringInfo *) NULL)
1008 return(Blob());
1009 return(Blob(GetStringInfoDatum(color_profile),GetStringInfoLength(
1010 color_profile)));
1011 }
1012
1013 void Magick::Image::interlaceType(const Magick::InterlaceType interlace_)
1014 {
1015 modifyImage();
1016 image()->interlace=interlace_;
1017 options()->interlaceType(interlace_);
1018 }
1019
1020 Magick::InterlaceType Magick::Image::interlaceType(void) const
1021 {
1022 return(constImage()->interlace);
1023 }
1024
1025 void Magick::Image::interpolate(const PixelInterpolateMethod interpolate_)
1026 {
1027 modifyImage();
1028 image()->interpolate=interpolate_;
1029 }
1030
1031 Magick::PixelInterpolateMethod Magick::Image::interpolate(void) const
1032 {
1033 return constImage()->interpolate;
1034 }
1035
1036 void Magick::Image::iptcProfile(const Magick::Blob &iptcProfile_)
1037 {
1038 modifyImage();
1039 if (iptcProfile_.data() != 0)
1040 {
1041 StringInfo
1042 *iptc_profile;
1043
1044 iptc_profile=AcquireStringInfo(iptcProfile_.length());
1045 SetStringInfoDatum(iptc_profile,(unsigned char *) iptcProfile_.data());
1046 GetPPException;
1047 (void) SetImageProfile(image(),"iptc",iptc_profile,exceptionInfo);
1048 iptc_profile=DestroyStringInfo(iptc_profile);
1049 ThrowImageException;
1050 }
1051 }
1052
1053 Magick::Blob Magick::Image::iptcProfile(void) const
1054 {
1055 const StringInfo
1056 *iptc_profile;
1057
1058 iptc_profile=GetImageProfile(constImage(),"iptc");
1059 if (iptc_profile == (StringInfo *) NULL)
1060 return(Blob());
1061 return(Blob(GetStringInfoDatum(iptc_profile),GetStringInfoLength(
1062 iptc_profile)));
1063 }
1064
1065 bool Magick::Image::isOpaque(void) const
1066 {
1067 MagickBooleanType
1068 result;
1069
1070 GetPPException;
1071 result=IsImageOpaque(constImage(),exceptionInfo);
1072 ThrowImageException;
1073 return(result != MagickFalse ? true : false);
1074 }
1075
1076 void Magick::Image::isValid(const bool isValid_)
1077 {
1078 if (!isValid_)
1079 {
1080 delete _imgRef;
1081 _imgRef=new ImageRef;
1082 }
1083 else if (!isValid())
1084 {
1085 // Construct with single-pixel black image to make
1086 // image valid. This is an obvious hack.
1087 size(Geometry(1,1));
1088 read("xc:black");
1089 }
1090 }
1091
1092 bool Magick::Image::isValid(void) const
1093 {
1094 return rows() && columns();
1095 }
1096
1097 void Magick::Image::label(const std::string &label_)
1098 {
1099 modifyImage();
1100 GetPPException;
1101 (void) SetImageProperty(image(),"Label",NULL,exceptionInfo);
1102 if (label_.length() > 0)
1103 (void) SetImageProperty(image(),"Label",label_.c_str(),exceptionInfo);
1104 ThrowImageException;
1105 }
1106
1107 std::string Magick::Image::label(void) const
1108 {
1109 const char
1110 *value;
1111
1112 GetPPException;
1113 value=GetImageProperty(constImage(),"Label",exceptionInfo);
1114 ThrowImageException;
1115
1116 if (value)
1117 return(std::string(value));
1118
1119 return(std::string());
1120 }
1121
1122 void Magick::Image::lowlightColor(const Color color_)
1123 {
1124 std::string
1125 value;
1126
1127 value=color_;
1128 artifact("compare:lowlight-color",value);
1129 }
1130
1131 void Magick::Image::magick(const std::string &magick_)
1132 {
1133 size_t
1134 length;
1135
1136 modifyImage();
1137
1138 length=sizeof(image()->magick)-1;
1139 if (magick_.length() < length)
1140 length=magick_.length();
1141
1142 if (!magick_.empty())
1143 magick_.copy(image()->magick,length);
1144 image()->magick[length]=0;
1145
1146 options()->magick(magick_);
1147 }
1148
1149 std::string Magick::Image::magick(void) const
1150 {
1151 if (*(constImage()->magick) != '\0')
1152 return(std::string(constImage()->magick));
1153
1154 return(constOptions()->magick());
1155 }
1156
1157 void Magick::Image::masklightColor(const Color color_)
1158 {
1159 std::string
1160 value;
1161
1162 value=color_;
1163 artifact("compare:masklight-color",value);
1164 }
1165
1166 double Magick::Image::meanErrorPerPixel(void) const
1167 {
1168 return(constImage()->error.mean_error_per_pixel);
1169 }
1170
1171 void Magick::Image::modulusDepth(const size_t depth_)
1172 {
1173 modifyImage();
1174 GetPPException;
1175 SetImageDepth(image(),depth_,exceptionInfo);
1176 ThrowImageException;
1177 options()->depth(depth_);
1178 }
1179
1180 size_t Magick::Image::modulusDepth(void) const
1181 {
1182 size_t
1183 depth;
1184
1185 GetPPException;
1186 depth=GetImageDepth(constImage(),exceptionInfo);
1187 ThrowImageException;
1188 return(depth);
1189 }
1190
1191 void Magick::Image::monochrome(const bool monochromeFlag_)
1192 {
1193 modifyImage();
1194 options()->monochrome(monochromeFlag_);
1195 }
1196
1197 bool Magick::Image::monochrome(void) const
1198 {
1199 return(constOptions()->monochrome());
1200 }
1201
1202 Magick::Geometry Magick::Image::montageGeometry(void) const
1203 {
1204 if (constImage()->montage)
1205 return Magick::Geometry(constImage()->montage);
1206
1207 if (!quiet())
1208 throwExceptionExplicit(MagickCore::CorruptImageWarning,
1209 "Image does not contain a montage");
1210
1211 return(Magick::Geometry());
1212 }
1213
1214 double Magick::Image::normalizedMaxError(void) const
1215 {
1216 return(constImage()->error.normalized_maximum_error);
1217 }
1218
1219 double Magick::Image::normalizedMeanError(void) const
1220 {
1221 return(constImage()->error.normalized_mean_error);
1222 }
1223
1224 void Magick::Image::orientation(const Magick::OrientationType orientation_)
1225 {
1226 modifyImage();
1227 image()->orientation=orientation_;
1228 }
1229
1230 Magick::OrientationType Magick::Image::orientation(void) const
1231 {
1232 return(constImage()->orientation);
1233 }
1234
1235 void Magick::Image::page(const Magick::Geometry &pageSize_)
1236 {
1237 modifyImage();
1238 options()->page(pageSize_);
1239 image()->page=pageSize_;
1240 }
1241
1242 Magick::Geometry Magick::Image::page(void) const
1243 {
1244 return(Geometry(constImage()->page.width,constImage()->page.height,
1245 constImage()->page.x,constImage()->page.y));
1246 }
1247
1248 void Magick::Image::quality(const size_t quality_)
1249 {
1250 modifyImage();
1251 image()->quality=quality_;
1252 options()->quality(quality_);
1253 }
1254
1255 size_t Magick::Image::quality(void) const
1256 {
1257 return(constImage()->quality);
1258 }
1259
1260 void Magick::Image::quantizeColors(const size_t colors_)
1261 {
1262 modifyImage();
1263 options()->quantizeColors(colors_);
1264 }
1265
1266 size_t Magick::Image::quantizeColors(void) const
1267 {
1268 return(constOptions()->quantizeColors());
1269 }
1270
1271 void Magick::Image::quantizeColorSpace(
1272 const Magick::ColorspaceType colorSpace_)
1273 {
1274 modifyImage();
1275 options()->quantizeColorSpace(colorSpace_);
1276 }
1277
1278 Magick::ColorspaceType Magick::Image::quantizeColorSpace(void) const
1279 {
1280 return(constOptions()->quantizeColorSpace());
1281 }
1282
1283 void Magick::Image::quantizeDither(const bool ditherFlag_)
1284 {
1285 modifyImage();
1286 options()->quantizeDither(ditherFlag_);
1287 }
1288
1289 bool Magick::Image::quantizeDither(void) const
1290 {
1291 return(constOptions()->quantizeDither());
1292 }
1293
1294 void Magick::Image::quantizeDitherMethod(const DitherMethod ditherMethod_)
1295 {
1296 modifyImage();
1297 options()->quantizeDitherMethod(ditherMethod_);
1298 }
1299
1300 MagickCore::DitherMethod Magick::Image::quantizeDitherMethod(void) const
1301 {
1302 return(constOptions()->quantizeDitherMethod());
1303 }
1304
1305 void Magick::Image::quantizeTreeDepth(const size_t treeDepth_)
1306 {
1307 modifyImage();
1308 options()->quantizeTreeDepth(treeDepth_);
1309 }
1310
1311 size_t Magick::Image::quantizeTreeDepth() const
1312 {
1313 return(constOptions()->quantizeTreeDepth());
1314 }
1315
1316 void Magick::Image::quiet(const bool quiet_)
1317 {
1318 modifyImage();
1319 options()->quiet(quiet_);
1320 }
1321
1322 bool Magick::Image::quiet(void) const
1323 {
1324 return(constOptions()->quiet());
1325 }
1326
1327 void Magick::Image::renderingIntent(
1328 const Magick::RenderingIntent renderingIntent_)
1329 {
1330 modifyImage();
1331 image()->rendering_intent=renderingIntent_;
1332 }
1333
1334 Magick::RenderingIntent Magick::Image::renderingIntent(void) const
1335 {
1336 return(static_cast<Magick::RenderingIntent>(constImage()->rendering_intent));
1337 }
1338
1339 void Magick::Image::resolutionUnits(
1340 const Magick::ResolutionType resolutionUnits_)
1341 {
1342 modifyImage();
1343 image()->units=resolutionUnits_;
1344 options()->resolutionUnits(resolutionUnits_);
1345 }
1346
1347 Magick::ResolutionType Magick::Image::resolutionUnits(void) const
1348 {
1349 return(static_cast<Magick::ResolutionType>(constImage()->units));
1350 }
1351
1352 size_t Magick::Image::rows(void) const
1353 {
1354 return(constImage()->rows);
1355 }
1356
1357 void Magick::Image::samplingFactor(const std::string &samplingFactor_)
1358 {
1359 modifyImage();
1360 options()->samplingFactor(samplingFactor_);
1361 }
1362
1363 std::string Magick::Image::samplingFactor(void) const
1364 {
1365 return(constOptions()->samplingFactor());
1366 }
1367
1368 void Magick::Image::scene(const size_t scene_)
1369 {
1370 modifyImage();
1371 image()->scene=scene_;
1372 }
1373
1374 size_t Magick::Image::scene(void) const
1375 {
1376 return(constImage()->scene);
1377 }
1378
1379 void Magick::Image::size(const Geometry &geometry_)
1380 {
1381 modifyImage();
1382 options()->size(geometry_);
1383 image()->rows=geometry_.height();
1384 image()->columns=geometry_.width();
1385 }
1386
1387 Magick::Geometry Magick::Image::size(void) const
1388 {
1389 return(Magick::Geometry(constImage()->columns,constImage()->rows));
1390 }
1391
1392 void Magick::Image::strokeAntiAlias(const bool flag_)
1393 {
1394 modifyImage();
1395 options()->strokeAntiAlias(flag_);
1396 }
1397
1398 bool Magick::Image::strokeAntiAlias(void) const
1399 {
1400 return(constOptions()->strokeAntiAlias());
1401 }
1402
1403 void Magick::Image::strokeColor(const Magick::Color &strokeColor_)
1404 {
1405 std::string
1406 value;
1407
1408 modifyImage();
1409 options()->strokeColor(strokeColor_);
1410 value=strokeColor_;
1411 artifact("stroke",value);
1412 }
1413
1414 Magick::Color Magick::Image::strokeColor(void) const
1415 {
1416 return(constOptions()->strokeColor());
1417 }
1418
1419 void Magick::Image::strokeDashArray(const double *strokeDashArray_)
1420 {
1421 modifyImage();
1422 options()->strokeDashArray(strokeDashArray_);
1423 }
1424
1425 const double* Magick::Image::strokeDashArray(void) const
1426 {
1427 return(constOptions()->strokeDashArray());
1428 }
1429
1430 void Magick::Image::strokeDashOffset(const double strokeDashOffset_)
1431 {
1432 modifyImage();
1433 options()->strokeDashOffset(strokeDashOffset_);
1434 }
1435
1436 double Magick::Image::strokeDashOffset(void) const
1437 {
1438 return(constOptions()->strokeDashOffset());
1439 }
1440
1441 void Magick::Image::strokeLineCap(const Magick::LineCap lineCap_)
1442 {
1443 modifyImage();
1444 options()->strokeLineCap(lineCap_);
1445 }
1446
1447 Magick::LineCap Magick::Image::strokeLineCap(void) const
1448 {
1449 return(constOptions()->strokeLineCap());
1450 }
1451
1452 void Magick::Image::strokeLineJoin(const Magick::LineJoin lineJoin_)
1453 {
1454 modifyImage();
1455 options()->strokeLineJoin(lineJoin_);
1456 }
1457
1458 Magick::LineJoin Magick::Image::strokeLineJoin(void) const
1459 {
1460 return(constOptions()->strokeLineJoin());
1461 }
1462
1463 void Magick::Image::strokeMiterLimit(const size_t strokeMiterLimit_)
1464 {
1465 modifyImage();
1466 options()->strokeMiterLimit(strokeMiterLimit_);
1467 }
1468
1469 size_t Magick::Image::strokeMiterLimit(void) const
1470 {
1471 return(constOptions()->strokeMiterLimit());
1472 }
1473
1474 void Magick::Image::strokePattern(const Image &strokePattern_)
1475 {
1476 modifyImage();
1477 if(strokePattern_.isValid())
1478 options()->strokePattern(strokePattern_.constImage());
1479 else
1480 options()->strokePattern(static_cast<MagickCore::Image*>(NULL));
1481 }
1482
1483 Magick::Image Magick::Image::strokePattern(void) const
1484 {
1485 // FIXME: This is inordinately innefficient
1486 const MagickCore::Image
1487 *tmpTexture;
1488
1489 Image
1490 texture;
1491
1492 tmpTexture=constOptions()->strokePattern();
1493
1494 if (tmpTexture)
1495 {
1496 MagickCore::Image
1497 *image;
1498
1499 GetPPException;
1500 image=CloneImage(tmpTexture,0,0,MagickTrue,exceptionInfo);
1501 texture.replaceImage(image);
1502 ThrowImageException;
1503 }
1504 return(texture);
1505 }
1506
1507 void Magick::Image::strokeWidth(const double strokeWidth_)
1508 {
1509 char
1510 value[MagickPathExtent];
1511
1512 modifyImage();
1513 options()->strokeWidth(strokeWidth_);
1514 FormatLocaleString(value,MagickPathExtent,"%.20g",strokeWidth_);
1515 (void) SetImageArtifact(image(),"strokewidth",value);
1516 }
1517
1518 double Magick::Image::strokeWidth(void) const
1519 {
1520 return(constOptions()->strokeWidth());
1521 }
1522
1523 void Magick::Image::subImage(const size_t subImage_)
1524 {
1525 modifyImage();
1526 options()->subImage(subImage_);
1527 }
1528
1529 size_t Magick::Image::subImage(void) const
1530 {
1531 return(constOptions()->subImage());
1532 }
1533
1534 void Magick::Image::subRange(const size_t subRange_)
1535 {
1536 modifyImage();
1537 options()->subRange(subRange_);
1538 }
1539
1540 size_t Magick::Image::subRange(void) const
1541 {
1542 return(constOptions()->subRange());
1543 }
1544
1545 void Magick::Image::textAntiAlias(const bool flag_)
1546 {
1547 modifyImage();
1548 options()->textAntiAlias(flag_);
1549 }
1550
1551 bool Magick::Image::textAntiAlias(void) const
1552 {
1553 return(constOptions()->textAntiAlias());
1554 }
1555
1556 void Magick::Image::textDirection(DirectionType direction_)
1557 {
1558 modifyImage();
1559 options()->textDirection(direction_);
1560 }
1561
1562 Magick::DirectionType Magick::Image::textDirection(void) const
1563 {
1564 return(constOptions()->textDirection());
1565 }
1566
1567 void Magick::Image::textEncoding(const std::string &encoding_)
1568 {
1569 modifyImage();
1570 options()->textEncoding(encoding_);
1571 }
1572
1573 std::string Magick::Image::textEncoding(void) const
1574 {
1575 return(constOptions()->textEncoding());
1576 }
1577
1578 void Magick::Image::textGravity(GravityType gravity_)
1579 {
1580 modifyImage();
1581 options()->textGravity(gravity_);
1582 }
1583
1584 Magick::GravityType Magick::Image::textGravity(void) const
1585 {
1586 return(constOptions()->textGravity());
1587 }
1588
1589 void Magick::Image::textInterlineSpacing(double spacing_)
1590 {
1591 modifyImage();
1592 options()->textInterlineSpacing(spacing_);
1593 }
1594
1595 double Magick::Image::textInterlineSpacing(void) const
1596 {
1597 return(constOptions()->textInterlineSpacing());
1598 }
1599
1600 void Magick::Image::textInterwordSpacing(double spacing_)
1601 {
1602 modifyImage();
1603 options()->textInterwordSpacing(spacing_);
1604 }
1605
1606 double Magick::Image::textInterwordSpacing(void) const
1607 {
1608 return(constOptions()->textInterwordSpacing());
1609 }
1610
1611 void Magick::Image::textKerning(double kerning_)
1612 {
1613 modifyImage();
1614 options()->textKerning(kerning_);
1615 }
1616
1617 double Magick::Image::textKerning(void) const
1618 {
1619 return(constOptions()->textKerning());
1620 }
1621
1622 void Magick::Image::textUnderColor(const Color &underColor_)
1623 {
1624 modifyImage();
1625 options()->textUnderColor(underColor_);
1626 }
1627
1628 Magick::Color Magick::Image::textUnderColor(void) const
1629 {
1630 return(constOptions()->textUnderColor());
1631 }
1632
1633 size_t Magick::Image::totalColors(void) const
1634 {
1635 size_t
1636 colors;
1637
1638 GetPPException;
1639 colors=GetNumberColors(constImage(),(FILE *) NULL,exceptionInfo);
1640 ThrowImageException;
1641 return colors;
1642 }
1643
1644 void Magick::Image::transformRotation(const double angle_)
1645 {
1646 modifyImage();
1647 options()->transformRotation(angle_);
1648 }
1649
1650 void Magick::Image::transformSkewX(const double skewx_)
1651 {
1652 modifyImage();
1653 options()->transformSkewX(skewx_);
1654 }
1655
1656 void Magick::Image::transformSkewY(const double skewy_)
1657 {
1658 modifyImage();
1659 options()->transformSkewY(skewy_);
1660 }
1661
1662 Magick::ImageType Magick::Image::type(void) const
1663 {
1664 if (constOptions()->type() != UndefinedType)
1665 return(constOptions()->type());
1666 return(GetImageType(constImage()));
1667 }
1668
1669 void Magick::Image::type(const Magick::ImageType type_)
1670 {
1671 modifyImage();
1672 options()->type(type_);
1673 GetPPException;
1674 SetImageType(image(),type_,exceptionInfo);
1675 ThrowImageException;
1676 }
1677
1678 void Magick::Image::verbose(const bool verboseFlag_)
1679 {
1680 modifyImage();
1681 options()->verbose(verboseFlag_);
1682 }
1683
1684 bool Magick::Image::verbose(void) const
1685 {
1686 return(constOptions()->verbose());
1687 }
1688
1689 void Magick::Image::virtualPixelMethod(
1690 const VirtualPixelMethod virtualPixelMethod_)
1691 {
1692 modifyImage();
1693 GetPPException;
1694 SetImageVirtualPixelMethod(image(),virtualPixelMethod_,exceptionInfo);
1695 ThrowImageException;
1696 }
1697
1698 Magick::VirtualPixelMethod Magick::Image::virtualPixelMethod(void) const
1699 {
1700 return(GetImageVirtualPixelMethod(constImage()));
1701 }
1702
1703 void Magick::Image::x11Display(const std::string &display_)
1704 {
1705 modifyImage();
1706 options()->x11Display(display_);
1707 }
1708
1709 std::string Magick::Image::x11Display(void) const
1710 {
1711 return(constOptions()->x11Display());
1712 }
1713
1714 double Magick::Image::xResolution(void) const
1715 {
1716 return(constImage()->resolution.x);
1717 }
1718
1719 double Magick::Image::yResolution(void) const
1720 {
1721 return(constImage()->resolution.y);
1722 }
1723
1724 void Magick::Image::adaptiveBlur(const double radius_,const double sigma_)
1725 {
1726 MagickCore::Image
1727 *newImage;
1728
1729 GetPPException;
1730 newImage=AdaptiveBlurImage(constImage(),radius_,sigma_,exceptionInfo);
1731 replaceImage(newImage);
1732 ThrowImageException;
1733 }
1734
1735 void Magick::Image::adaptiveResize(const Geometry &geometry_)
1736 {
1737 MagickCore::Image
1738 *newImage;
1739
1740 size_t
1741 height=rows(),
1742 width=columns();
1743
1744 ssize_t
1745 x=0,
1746 y=0;
1747
1748 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
1749 &height);
1750
1751 GetPPException;
1752 newImage=AdaptiveResizeImage(constImage(),width,height,exceptionInfo);
1753 replaceImage(newImage);
1754 ThrowImageException;
1755 }
1756
1757 void Magick::Image::adaptiveSharpen(const double radius_,const double sigma_)
1758 {
1759 MagickCore::Image
1760 *newImage;
1761
1762 GetPPException;
1763 newImage=AdaptiveSharpenImage(constImage(),radius_,sigma_,exceptionInfo);
1764 replaceImage(newImage);
1765 ThrowImageException;
1766 }
1767
1768 void Magick::Image::adaptiveSharpenChannel(const ChannelType channel_,
1769 const double radius_,const double sigma_ )
1770 {
1771 MagickCore::Image
1772 *newImage;
1773
1774 GetPPException;
1775 GetAndSetPPChannelMask(channel_);
1776 newImage=AdaptiveSharpenImage(constImage(),radius_,sigma_,exceptionInfo);
1777 RestorePPChannelMask;
1778 replaceImage(newImage);
1779 ThrowImageException;
1780 }
1781
1782 void Magick::Image::adaptiveThreshold(const size_t width_,const size_t height_,
1783 const double bias_)
1784 {
1785
1786 MagickCore::Image
1787 *newImage;
1788
1789 GetPPException;
1790 newImage=AdaptiveThresholdImage(constImage(),width_,height_,bias_,
1791 exceptionInfo);
1792 replaceImage(newImage);
1793 ThrowImageException;
1794 }
1795
1796 void Magick::Image::addNoise(const NoiseType noiseType_,const double attenuate_)
1797 {
1798 MagickCore::Image
1799 *newImage;
1800
1801 GetPPException;
1802 newImage=AddNoiseImage(constImage(),noiseType_,attenuate_,exceptionInfo);
1803 replaceImage(newImage);
1804 ThrowImageException;
1805 }
1806
1807 void Magick::Image::addNoiseChannel(const ChannelType channel_,
1808 const NoiseType noiseType_,const double attenuate_)
1809 {
1810 MagickCore::Image
1811 *newImage;
1812
1813 GetPPException;
1814 GetAndSetPPChannelMask(channel_);
1815 newImage=AddNoiseImage(constImage(),noiseType_,attenuate_,exceptionInfo);
1816 RestorePPChannelMask;
1817 replaceImage(newImage);
1818 ThrowImageException;
1819 }
1820
1821 void Magick::Image::affineTransform(const DrawableAffine &affine_)
1822 {
1823 AffineMatrix
1824 _affine;
1825
1826 MagickCore::Image
1827 *newImage;
1828
1829 _affine.sx=affine_.sx();
1830 _affine.sy=affine_.sy();
1831 _affine.rx=affine_.rx();
1832 _affine.ry=affine_.ry();
1833 _affine.tx=affine_.tx();
1834 _affine.ty=affine_.ty();
1835
1836 GetPPException;
1837 newImage=AffineTransformImage(constImage(),&_affine,exceptionInfo);
1838 replaceImage(newImage);
1839 ThrowImageException;
1840 }
1841
1842 void Magick::Image::alpha(const unsigned int alpha_)
1843 {
1844 modifyImage();
1845 GetPPException;
1846 SetImageAlpha(image(),alpha_,exceptionInfo);
1847 ThrowImageException;
1848 }
1849
1850 void Magick::Image::alphaChannel(AlphaChannelOption alphaOption_)
1851 {
1852 modifyImage();
1853 GetPPException;
1854 SetImageAlphaChannel(image(),alphaOption_,exceptionInfo);
1855 ThrowImageException;
1856 }
1857
1858 void Magick::Image::annotate(const std::string &text_,
1859 const Geometry &location_)
1860 {
1861 annotate(text_,location_,NorthWestGravity,0.0);
1862 }
1863
1864 void Magick::Image::annotate(const std::string &text_,
1865 const Geometry &boundingArea_,const GravityType gravity_)
1866 {
1867 annotate(text_,boundingArea_,gravity_,0.0);
1868 }
1869
1870 void Magick::Image::annotate(const std::string &text_,
1871 const Geometry &boundingArea_,const GravityType gravity_,
1872 const double degrees_)
1873 {
1874 AffineMatrix
1875 oaffine;
1876
1877 char
1878 boundingArea[MagickPathExtent];
1879
1880 DrawInfo
1881 *drawInfo;
1882
1883 modifyImage();
1884
1885 drawInfo=options()->drawInfo();
1886 drawInfo->text=DestroyString(drawInfo->text);
1887 drawInfo->text=const_cast<char *>(text_.c_str());
1888 drawInfo->geometry=DestroyString(drawInfo->geometry);
1889
1890 if (boundingArea_.isValid())
1891 {
1892 if (boundingArea_.width() == 0 || boundingArea_.height() == 0)
1893 {
1894 FormatLocaleString(boundingArea,MagickPathExtent,"%+.20g%+.20g",
1895 (double) boundingArea_.xOff(),(double) boundingArea_.yOff());
1896 }
1897 else
1898 {
1899 (void) CopyMagickString(boundingArea,
1900 std::string(boundingArea_).c_str(), MagickPathExtent);
1901 }
1902 drawInfo->geometry=boundingArea;
1903 }
1904
1905 drawInfo->gravity=gravity_;
1906
1907 oaffine=drawInfo->affine;
1908 if (degrees_ != 0.0)
1909 {
1910 AffineMatrix
1911 affine,
1912 current;
1913
1914 affine.sx=1.0;
1915 affine.rx=0.0;
1916 affine.ry=0.0;
1917 affine.sy=1.0;
1918 affine.tx=0.0;
1919 affine.ty=0.0;
1920
1921 current=drawInfo->affine;
1922 affine.sx=cos(DegreesToRadians(fmod(degrees_,360.0)));
1923 affine.rx=sin(DegreesToRadians(fmod(degrees_,360.0)));
1924 affine.ry=(-sin(DegreesToRadians(fmod(degrees_,360.0))));
1925 affine.sy=cos(DegreesToRadians(fmod(degrees_,360.0)));
1926
1927 drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
1928 drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
1929 drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
1930 drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
1931 drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty
1932 +current.tx;
1933 }
1934
1935 GetPPException;
1936 AnnotateImage(image(),drawInfo,exceptionInfo);
1937
1938 // Restore original values
1939 drawInfo->affine=oaffine;
1940 drawInfo->text=(char *) NULL;
1941 drawInfo->geometry=(char *) NULL;
1942
1943 ThrowImageException;
1944 }
1945
1946 void Magick::Image::annotate(const std::string &text_,
1947 const GravityType gravity_)
1948 {
1949 DrawInfo
1950 *drawInfo;
1951
1952 modifyImage();
1953
1954 drawInfo=options()->drawInfo();
1955 drawInfo->text=DestroyString(drawInfo->text);
1956 drawInfo->text=const_cast<char *>(text_.c_str());
1957 drawInfo->gravity=gravity_;
1958
1959 GetPPException;
1960 AnnotateImage(image(),drawInfo,exceptionInfo);
1961
1962 drawInfo->gravity=NorthWestGravity;
1963 drawInfo->text=(char *) NULL;
1964
1965 ThrowImageException;
1966 }
1967
1968 void Magick::Image::artifact(const std::string &name_,const std::string &value_)
1969 {
1970 modifyImage();
1971 (void) SetImageArtifact(image(),name_.c_str(),value_.c_str());
1972 }
1973
1974 std::string Magick::Image::artifact(const std::string &name_) const
1975 {
1976 const char
1977 *value;
1978
1979 value=GetImageArtifact(constImage(),name_.c_str());
1980 if (value)
1981 return(std::string(value));
1982 return(std::string());
1983 }
1984
1985 void Magick::Image::attribute(const std::string name_,const char *value_)
1986 {
1987 modifyImage();
1988 GetPPException;
1989 SetImageProperty(image(),name_.c_str(),value_,exceptionInfo);
1990 ThrowImageException;
1991 }
1992
1993 void Magick::Image::attribute(const std::string name_,const std::string value_)
1994 {
1995 modifyImage();
1996 GetPPException;
1997 SetImageProperty(image(),name_.c_str(),value_.c_str(),exceptionInfo);
1998 ThrowImageException;
1999 }
2000
2001 std::string Magick::Image::attribute(const std::string name_) const
2002 {
2003 const char
2004 *value;
2005
2006 GetPPException;
2007 value=GetImageProperty(constImage(),name_.c_str(),exceptionInfo);
2008 ThrowImageException;
2009
2010 if (value)
2011 return(std::string(value));
2012
2013 return(std::string()); // Intentionally no exception
2014 }
2015
2016 void Magick::Image::autoGamma(void)
2017 {
2018 modifyImage();
2019 GetPPException;
2020 (void) SyncImageSettings(imageInfo(),image(),exceptionInfo);
2021 (void) AutoGammaImage(image(),exceptionInfo);
2022 ThrowImageException;
2023 }
2024
2025 void Magick::Image::autoGammaChannel(const ChannelType channel_)
2026 {
2027 modifyImage();
2028 GetPPException;
2029 GetAndSetPPChannelMask(channel_);
2030 (void) SyncImageSettings(imageInfo(),image(),exceptionInfo);
2031 (void) AutoGammaImage(image(),exceptionInfo);
2032 RestorePPChannelMask;
2033 ThrowImageException;
2034 }
2035
2036 void Magick::Image::autoLevel(void)
2037 {
2038 modifyImage();
2039 GetPPException;
2040 (void) AutoLevelImage(image(),exceptionInfo);
2041 ThrowImageException;
2042 }
2043
2044 void Magick::Image::autoLevelChannel(const ChannelType channel_)
2045 {
2046 modifyImage();
2047 GetPPException;
2048 GetAndSetPPChannelMask(channel_);
2049 (void) AutoLevelImage(image(),exceptionInfo);
2050 RestorePPChannelMask;
2051 ThrowImageException;
2052 }
2053
2054 void Magick::Image::autoOrient(void)
2055 {
2056 MagickCore::Image
2057 *newImage;
2058
2059 if (image()->orientation == UndefinedOrientation ||
2060 image()->orientation == TopLeftOrientation)
2061 return;
2062
2063 GetPPException;
2064 newImage=AutoOrientImage(constImage(),image()->orientation,exceptionInfo);
2065 replaceImage(newImage);
2066 ThrowImageException;
2067 }
2068
2069 void Magick::Image::autoThreshold(const AutoThresholdMethod method_)
2070 {
2071 modifyImage();
2072 GetPPException;
2073 AutoThresholdImage(image(),method_, exceptionInfo);
2074 ThrowImageException;
2075 }
2076
2077 void Magick::Image::blackThreshold(const std::string &threshold_)
2078 {
2079 modifyImage();
2080 GetPPException;
2081 BlackThresholdImage(image(),threshold_.c_str(),exceptionInfo);
2082 ThrowImageException;
2083 }
2084
2085 void Magick::Image::blackThresholdChannel(const ChannelType channel_,
2086 const std::string &threshold_)
2087 {
2088 modifyImage();
2089 GetPPException;
2090 GetAndSetPPChannelMask(channel_);
2091 BlackThresholdImage(image(),threshold_.c_str(),exceptionInfo);
2092 RestorePPChannelMask;
2093 ThrowImageException;
2094 }
2095
2096 void Magick::Image::blueShift(const double factor_)
2097 {
2098 MagickCore::Image
2099 *newImage;
2100
2101 GetPPException;
2102 newImage=BlueShiftImage(constImage(),factor_,exceptionInfo);
2103 replaceImage(newImage);
2104 ThrowImageException;
2105 }
2106
2107 void Magick::Image::blur(const double radius_,const double sigma_)
2108 {
2109 MagickCore::Image
2110 *newImage;
2111
2112 GetPPException;
2113 newImage=BlurImage(constImage(),radius_,sigma_,exceptionInfo);
2114 replaceImage(newImage);
2115 ThrowImageException;
2116 }
2117
2118 void Magick::Image::blurChannel(const ChannelType channel_,
2119 const double radius_,const double sigma_)
2120 {
2121 MagickCore::Image
2122 *newImage;
2123
2124 GetPPException;
2125 GetAndSetPPChannelMask(channel_);
2126 newImage=BlurImage(constImage(),radius_,sigma_,exceptionInfo);
2127 RestorePPChannelMask;
2128 replaceImage(newImage);
2129 ThrowImageException;
2130 }
2131
2132 void Magick::Image::border(const Geometry &geometry_)
2133 {
2134 MagickCore::Image
2135 *newImage;
2136
2137 RectangleInfo
2138 borderInfo=geometry_;
2139
2140 GetPPException;
2141 newImage=BorderImage(constImage(),&borderInfo,image()->compose,
2142 exceptionInfo);
2143 replaceImage(newImage);
2144 ThrowImageException;
2145 }
2146
2147 void Magick::Image::brightnessContrast(const double brightness_,
2148 const double contrast_)
2149 {
2150 modifyImage();
2151 GetPPException;
2152 BrightnessContrastImage(image(),brightness_,contrast_,exceptionInfo);
2153 ThrowImageException;
2154 }
2155
2156 void Magick::Image::brightnessContrastChannel(const ChannelType channel_,
2157 const double brightness_,const double contrast_)
2158 {
2159 modifyImage();
2160 GetPPException;
2161 GetAndSetPPChannelMask(channel_);
2162 BrightnessContrastImage(image(),brightness_,contrast_,exceptionInfo);
2163 RestorePPChannelMask;
2164 ThrowImageException;
2165 }
2166
2167 void Magick::Image::cannyEdge(const double radius_,const double sigma_,
2168 const double lowerPercent_,const double upperPercent_)
2169 {
2170 MagickCore::Image
2171 *newImage;
2172
2173 modifyImage();
2174 GetPPException;
2175 newImage=CannyEdgeImage(constImage(),radius_,sigma_,lowerPercent_,
2176 upperPercent_,exceptionInfo);
2177 replaceImage(newImage);
2178 ThrowImageException;
2179 }
2180
2181 void Magick::Image::cdl(const std::string &cdl_)
2182 {
2183 modifyImage();
2184 GetPPException;
2185 (void) ColorDecisionListImage(image(),cdl_.c_str(),exceptionInfo);
2186 ThrowImageException;
2187 }
2188
2189 void Magick::Image::channel(const ChannelType channel_)
2190 {
2191 MagickCore::Image
2192 *newImage;
2193
2194 GetPPException;
2195 newImage=SeparateImage(image(),channel_,exceptionInfo);
2196 replaceImage(newImage);
2197 ThrowImageException;
2198 }
2199
2200 void Magick::Image::charcoal(const double radius_,const double sigma_)
2201 {
2202 MagickCore::Image
2203 *newImage;
2204
2205 GetPPException;
2206 newImage=CharcoalImage(image(),radius_,sigma_,exceptionInfo);
2207 replaceImage(newImage);
2208 ThrowImageException;
2209 }
2210
2211 void Magick::Image::charcoalChannel(const ChannelType channel_,
2212 const double radius_,const double sigma_)
2213 {
2214 MagickCore::Image
2215 *newImage;
2216
2217 GetPPException;
2218 GetAndSetPPChannelMask(channel_);
2219 newImage=CharcoalImage(image(),radius_,sigma_,exceptionInfo);
2220 RestorePPChannelMask;
2221 replaceImage(newImage);
2222 ThrowImageException;
2223 }
2224
2225 void Magick::Image::chop(const Geometry &geometry_)
2226 {
2227 MagickCore::Image
2228 *newImage;
2229
2230 RectangleInfo
2231 chopInfo=geometry_;
2232
2233 GetPPException;
2234 newImage=ChopImage(image(),&chopInfo,exceptionInfo);
2235 replaceImage(newImage);
2236 ThrowImageException;
2237 }
2238
2239 void Magick::Image::chromaBluePrimary(const double x_,const double y_,
2240 const double z_)
2241 {
2242 modifyImage();
2243 image()->chromaticity.blue_primary.x=x_;
2244 image()->chromaticity.blue_primary.y=y_;
2245 image()->chromaticity.blue_primary.z=z_;
2246 }
2247
2248 void Magick::Image::chromaBluePrimary(double *x_,double *y_,double *z_) const
2249 {
2250 *x_=constImage()->chromaticity.blue_primary.x;
2251 *y_=constImage()->chromaticity.blue_primary.y;
2252 *z_=constImage()->chromaticity.blue_primary.z;
2253 }
2254
2255 void Magick::Image::chromaGreenPrimary(const double x_,const double y_,
2256 const double z_)
2257 {
2258 modifyImage();
2259 image()->chromaticity.green_primary.x=x_;
2260 image()->chromaticity.green_primary.y=y_;
2261 image()->chromaticity.green_primary.z=z_;
2262 }
2263
2264 void Magick::Image::chromaGreenPrimary(double *x_,double *y_,double *z_) const
2265 {
2266 *x_=constImage()->chromaticity.green_primary.x;
2267 *y_=constImage()->chromaticity.green_primary.y;
2268 *z_=constImage()->chromaticity.green_primary.z;
2269 }
2270
2271 void Magick::Image::chromaRedPrimary(const double x_,const double y_,
2272 const double z_)
2273 {
2274 modifyImage();
2275 image()->chromaticity.red_primary.x=x_;
2276 image()->chromaticity.red_primary.y=y_;
2277 image()->chromaticity.red_primary.z=z_;
2278 }
2279
2280 void Magick::Image::chromaRedPrimary(double *x_,double *y_,double *z_) const
2281 {
2282 *x_=constImage()->chromaticity.red_primary.x;
2283 *y_=constImage()->chromaticity.red_primary.y;
2284 *z_=constImage()->chromaticity.red_primary.z;
2285 }
2286
2287 void Magick::Image::chromaWhitePoint(const double x_,const double y_,
2288 const double z_)
2289 {
2290 modifyImage();
2291 image()->chromaticity.white_point.x=x_;
2292 image()->chromaticity.white_point.y=y_;
2293 image()->chromaticity.white_point.z=z_;
2294 }
2295
2296 void Magick::Image::chromaWhitePoint(double *x_,double *y_,double *z_) const
2297 {
2298 *x_=constImage()->chromaticity.white_point.x;
2299 *y_=constImage()->chromaticity.white_point.y;
2300 *z_=constImage()->chromaticity.white_point.z;
2301 }
2302
2303 void Magick::Image::clamp(void)
2304 {
2305 modifyImage();
2306 GetPPException;
2307 ClampImage(image(),exceptionInfo);
2308 ThrowImageException;
2309 }
2310
2311 void Magick::Image::clampChannel(const ChannelType channel_)
2312 {
2313 modifyImage();
2314 GetPPException;
2315 GetAndSetPPChannelMask(channel_);
2316 ClampImage(image(),exceptionInfo);
2317 RestorePPChannelMask;
2318 ThrowImageException;
2319 }
2320
2321 void Magick::Image::clip(void)
2322 {
2323 modifyImage();
2324 GetPPException;
2325 ClipImage(image(),exceptionInfo);
2326 ThrowImageException;
2327 }
2328
2329 void Magick::Image::clipPath(const std::string pathname_,const bool inside_)
2330 {
2331 modifyImage();
2332 GetPPException;
2333 ClipImagePath(image(),pathname_.c_str(),(MagickBooleanType) inside_,
2334 exceptionInfo);
2335 ThrowImageException;
2336 }
2337
2338 void Magick::Image::clut(const Image &clutImage_,
2339 const PixelInterpolateMethod method)
2340 {
2341 modifyImage();
2342 GetPPException;
2343 ClutImage(image(),clutImage_.constImage(),method,exceptionInfo);
2344 ThrowImageException;
2345 }
2346
2347 void Magick::Image::clutChannel(const ChannelType channel_,
2348 const Image &clutImage_,const PixelInterpolateMethod method)
2349 {
2350 modifyImage();
2351 GetPPException;
2352 GetAndSetPPChannelMask(channel_);
2353 ClutImage(image(),clutImage_.constImage(),method,exceptionInfo);
2354 RestorePPChannelMask;
2355 ThrowImageException;
2356 }
2357
2358 void Magick::Image::colorize(const unsigned int alpha_,const Color &penColor_)
2359 {
2360 colorize(alpha_,alpha_,alpha_,penColor_);
2361 }
2362
2363 void Magick::Image::colorize(const unsigned int alphaRed_,
2364 const unsigned int alphaGreen_,const unsigned int alphaBlue_,
2365 const Color &penColor_)
2366 {
2367 char
2368 blend[MagickPathExtent];
2369
2370 MagickCore::Image
2371 *newImage;
2372
2373 PixelInfo
2374 target;
2375
2376 if (!penColor_.isValid())
2377 throwExceptionExplicit(MagickCore::OptionError,
2378 "Pen color argument is invalid");
2379
2380 FormatLocaleString(blend,MagickPathExtent,"%u/%u/%u",alphaRed_,alphaGreen_,
2381 alphaBlue_);
2382
2383 target=static_cast<PixelInfo>(penColor_);
2384 GetPPException;
2385 newImage=ColorizeImage(image(),blend,&target,exceptionInfo);
2386 replaceImage(newImage);
2387 ThrowImageException;
2388 }
2389
2390 void Magick::Image::colorMap(const size_t index_,const Color &color_)
2391 {
2392 MagickCore::Image
2393 *imageptr;
2394
2395 imageptr=image();
2396
2397 if (index_ > (MaxColormapSize-1))
2398 throwExceptionExplicit(MagickCore::OptionError,
2399 "Colormap index must be less than MaxColormapSize");
2400
2401 if (!color_.isValid())
2402 throwExceptionExplicit(MagickCore::OptionError,
2403 "Color argument is invalid");
2404
2405 modifyImage();
2406
2407 // Ensure that colormap size is large enough
2408 if (colorMapSize() < (index_+1))
2409 colorMapSize(index_+1);
2410
2411 // Set color at index in colormap
2412 (imageptr->colormap)[index_]=color_;
2413 }
2414
2415 Magick::Color Magick::Image::colorMap(const size_t index_) const
2416 {
2417 if (!constImage()->colormap)
2418 {
2419 throwExceptionExplicit(MagickCore::OptionError,
2420 "Image does not contain a colormap");
2421 return(Color());
2422 }
2423
2424 if (index_ > constImage()->colors-1)
2425 throwExceptionExplicit(MagickCore::OptionError,"Index out of range");
2426
2427 return(Magick::Color((constImage()->colormap)[index_]));
2428 }
2429
2430 void Magick::Image::colorMatrix(const size_t order_,
2431 const double *color_matrix_)
2432 {
2433 KernelInfo
2434 *kernel_info;
2435
2436 GetPPException;
2437 kernel_info=AcquireKernelInfo((const char *) NULL,exceptionInfo);
2438 if (kernel_info != (KernelInfo *) NULL)
2439 {
2440 kernel_info->width=order_;
2441 kernel_info->height=order_;
2442 kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
2443 order_*sizeof(*kernel_info->values));
2444 if (kernel_info->values != (MagickRealType *) NULL)
2445 {
2446 MagickCore::Image
2447 *newImage;
2448
2449 for (ssize_t i=0; i < (ssize_t) (order_*order_); i++)
2450 kernel_info->values[i]=color_matrix_[i];
2451 newImage=ColorMatrixImage(image(),kernel_info,exceptionInfo);
2452 replaceImage(newImage);
2453 }
2454 kernel_info=DestroyKernelInfo(kernel_info);
2455 }
2456 ThrowImageException;
2457 }
2458
2459 bool Magick::Image::compare(const Image &reference_) const
2460 {
2461 bool
2462 status;
2463
2464 Image
2465 ref=reference_;
2466
2467 GetPPException;
2468 status=static_cast<bool>(IsImagesEqual(constImage(),ref.constImage(),
2469 exceptionInfo));
2470 ThrowImageException;
2471 return(status);
2472 }
2473
2474 double Magick::Image::compare(const Image &reference_,const MetricType metric_)
2475 {
2476 double
2477 distortion=0.0;
2478
2479 GetPPException;
2480 GetImageDistortion(image(),reference_.constImage(),metric_,&distortion,
2481 exceptionInfo);
2482 ThrowImageException;
2483 return(distortion);
2484 }
2485
2486 double Magick::Image::compareChannel(const ChannelType channel_,
2487 const Image &reference_,const MetricType metric_)
2488 {
2489 double
2490 distortion=0.0;
2491
2492 GetPPException;
2493 GetAndSetPPChannelMask(channel_);
2494 GetImageDistortion(image(),reference_.constImage(),metric_,&distortion,
2495 exceptionInfo);
2496 RestorePPChannelMask;
2497 ThrowImageException;
2498 return(distortion);
2499 }
2500
2501 Magick::Image Magick::Image::compare(const Image &reference_,
2502 const MetricType metric_,double *distortion)
2503 {
2504 MagickCore::Image
2505 *newImage;
2506
2507 GetPPException;
2508 newImage=CompareImages(image(),reference_.constImage(),metric_,distortion,
2509 exceptionInfo);
2510 ThrowImageException;
2511 if (newImage == (MagickCore::Image *) NULL)
2512 return(Magick::Image());
2513 else
2514 return(Magick::Image(newImage));
2515 }
2516
2517 Magick::Image Magick::Image::compareChannel(const ChannelType channel_,
2518 const Image &reference_,const MetricType metric_,double *distortion)
2519 {
2520 MagickCore::Image
2521 *newImage;
2522
2523 GetPPException;
2524 GetAndSetPPChannelMask(channel_);
2525 newImage=CompareImages(image(),reference_.constImage(),metric_,distortion,
2526 exceptionInfo);
2527 RestorePPChannelMask;
2528 ThrowImageException;
2529 if (newImage == (MagickCore::Image *) NULL)
2530 return(Magick::Image());
2531 else
2532 return(Magick::Image(newImage));
2533 }
2534
2535 void Magick::Image::composite(const Image &compositeImage_,
2536 const Geometry &offset_,const CompositeOperator compose_)
2537 {
2538 size_t
2539 height=rows(),
2540 width=columns();
2541
2542 ssize_t
2543 x=offset_.xOff(),
2544 y=offset_.yOff();
2545
2546 ParseMetaGeometry(static_cast<std::string>(offset_).c_str(),&x,&y,&width,
2547 &height);
2548
2549 modifyImage();
2550 GetPPException;
2551 CompositeImage(image(),compositeImage_.constImage(),compose_,MagickTrue,
2552 x,y,exceptionInfo);
2553 ThrowImageException;
2554 }
2555
2556 void Magick::Image::composite(const Image &compositeImage_,
2557 const GravityType gravity_,const CompositeOperator compose_)
2558 {
2559 RectangleInfo
2560 geometry;
2561
2562 modifyImage();
2563 SetGeometry(compositeImage_.constImage(),&geometry);
2564 GravityAdjustGeometry(columns(),rows(),gravity_,&geometry);
2565
2566 GetPPException;
2567 CompositeImage(image(),compositeImage_.constImage(),compose_,MagickTrue,
2568 geometry.x,geometry.y,exceptionInfo);
2569 ThrowImageException;
2570 }
2571
2572 void Magick::Image::composite(const Image &compositeImage_,
2573 const ssize_t xOffset_,const ssize_t yOffset_,
2574 const CompositeOperator compose_)
2575 {
2576 // Image supplied as compositeImage is composited with current image and
2577 // results in updating current image.
2578 modifyImage();
2579 GetPPException;
2580 CompositeImage(image(),compositeImage_.constImage(),compose_,MagickTrue,
2581 xOffset_,yOffset_,exceptionInfo);
2582 ThrowImageException;
2583 }
2584
2585 void Magick::Image::connectedComponents(const size_t connectivity_)
2586 {
2587 MagickCore::Image
2588 *newImage;
2589
2590 GetPPException;
2591 newImage=ConnectedComponentsImage(constImage(),connectivity_,
2592 (CCObjectInfo **) NULL,exceptionInfo);
2593 replaceImage(newImage);
2594 ThrowImageException;
2595 }
2596
2597 void Magick::Image::contrast(const bool sharpen_)
2598 {
2599 modifyImage();
2600 GetPPException;
2601 ContrastImage(image(),(MagickBooleanType) sharpen_,exceptionInfo);
2602 ThrowImageException;
2603 }
2604
2605 void Magick::Image::contrastStretch(const double blackPoint_,
2606 const double whitePoint_)
2607 {
2608 modifyImage();
2609 GetPPException;
2610 ContrastStretchImage(image(),blackPoint_,whitePoint_,exceptionInfo);
2611 ThrowImageException;
2612 }
2613
2614 void Magick::Image::contrastStretchChannel(const ChannelType channel_,
2615 const double blackPoint_,const double whitePoint_)
2616 {
2617 modifyImage();
2618 GetPPException;
2619 GetAndSetPPChannelMask(channel_);
2620 ContrastStretchImage(image(),blackPoint_,whitePoint_,exceptionInfo);
2621 RestorePPChannelMask;
2622 ThrowImageException;
2623 }
2624
2625 void Magick::Image::convolve(const size_t order_,const double *kernel_)
2626 {
2627 KernelInfo
2628 *kernel_info;
2629
2630 GetPPException;
2631 kernel_info=AcquireKernelInfo((const char *) NULL,exceptionInfo);
2632 kernel_info->width=order_;
2633 kernel_info->height=order_;
2634 kernel_info->x=(ssize_t) (order_-1)/2;
2635 kernel_info->y=(ssize_t) (order_-1)/2;
2636 kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
2637 order_*sizeof(*kernel_info->values));
2638 if (kernel_info->values != (MagickRealType *) NULL)
2639 {
2640 MagickCore::Image
2641 *newImage;
2642
2643 for (ssize_t i=0; i < (ssize_t) (order_*order_); i++)
2644 kernel_info->values[i]=kernel_[i];
2645 newImage=ConvolveImage(image(),kernel_info,exceptionInfo);
2646 replaceImage(newImage);
2647 }
2648 kernel_info=DestroyKernelInfo(kernel_info);
2649 ThrowImageException;
2650 }
2651
2652 void Magick::Image::copyPixels(const Image &source_,const Geometry &geometry_,
2653 const Offset &offset_)
2654 {
2655 const OffsetInfo
2656 offset=offset_;
2657
2658 const RectangleInfo
2659 geometry=geometry_;
2660
2661 GetPPException;
2662 (void) CopyImagePixels(image(),source_.constImage(),&geometry,&offset,
2663 exceptionInfo);
2664 ThrowImageException;
2665 }
2666
2667 void Magick::Image::crop(const Geometry &geometry_)
2668 {
2669 MagickCore::Image
2670 *newImage;
2671
2672 RectangleInfo
2673 cropInfo=geometry_;
2674
2675 GetPPException;
2676 newImage=CropImage(constImage(),&cropInfo,exceptionInfo);
2677 replaceImage(newImage);
2678 ThrowImageException;
2679 }
2680
2681 void Magick::Image::cycleColormap(const ssize_t amount_)
2682 {
2683 modifyImage();
2684 GetPPException;
2685 CycleColormapImage(image(),amount_,exceptionInfo);
2686 ThrowImageException;
2687 }
2688
2689 void Magick::Image::decipher(const std::string &passphrase_)
2690 {
2691 modifyImage();
2692 GetPPException;
2693 DecipherImage(image(),passphrase_.c_str(),exceptionInfo);
2694 ThrowImageException;
2695 }
2696
2697 void Magick::Image::defineSet(const std::string &magick_,
2698 const std::string &key_,bool flag_)
2699 {
2700 std::string
2701 definition;
2702
2703 modifyImage();
2704 definition=magick_ + ":" + key_;
2705 if (flag_)
2706 (void) SetImageOption(imageInfo(),definition.c_str(),"");
2707 else
2708 DeleteImageOption(imageInfo(),definition.c_str());
2709 }
2710
2711 bool Magick::Image::defineSet(const std::string &magick_,
2712 const std::string &key_ ) const
2713 {
2714 const char
2715 *option;
2716
2717 std::string
2718 key;
2719
2720 key=magick_ + ":" + key_;
2721 option=GetImageOption(constImageInfo(),key.c_str());
2722 if (option)
2723 return(true);
2724 return(false);
2725 }
2726
2727 void Magick::Image::defineValue(const std::string &magick_,
2728 const std::string &key_,const std::string &value_)
2729 {
2730 std::string
2731 format,
2732 option;
2733
2734 modifyImage();
2735 format=magick_ + ":" + key_;
2736 option=value_;
2737 (void) SetImageOption(imageInfo(),format.c_str(),option.c_str());
2738 }
2739
2740 std::string Magick::Image::defineValue(const std::string &magick_,
2741 const std::string &key_) const
2742 {
2743 const char
2744 *option;
2745
2746 std::string
2747 definition;
2748
2749 definition=magick_ + ":" + key_;
2750 option=GetImageOption(constImageInfo(),definition.c_str());
2751 if (option)
2752 return(std::string(option));
2753 return(std::string());
2754 }
2755
2756 void Magick::Image::deskew(const double threshold_)
2757 {
2758 MagickCore::Image
2759 *newImage;
2760
2761 GetPPException;
2762 newImage=DeskewImage(constImage(),threshold_,exceptionInfo);
2763 replaceImage(newImage);
2764 ThrowImageException;
2765 }
2766
2767 void Magick::Image::despeckle(void)
2768 {
2769 MagickCore::Image
2770 *newImage;
2771
2772 GetPPException;
2773 newImage=DespeckleImage(constImage(),exceptionInfo);
2774 replaceImage(newImage);
2775 ThrowImageException;
2776 }
2777
2778 void Magick::Image::display(void)
2779 {
2780 GetPPException;
2781 DisplayImages(imageInfo(),image(),exceptionInfo);
2782 ThrowImageException;
2783 }
2784
2785 void Magick::Image::distort(const DistortMethod method_,
2786 const size_t numberArguments_,const double *arguments_,const bool bestfit_)
2787 {
2788 MagickCore::Image
2789 *newImage;
2790
2791 GetPPException;
2792 newImage=DistortImage(constImage(), method_,numberArguments_,arguments_,
2793 bestfit_ == true ? MagickTrue : MagickFalse,exceptionInfo);
2794 replaceImage(newImage);
2795 ThrowImageException;
2796 }
2797
2798 void Magick::Image::draw(const Magick::Drawable &drawable_)
2799 {
2800 DrawingWand
2801 *wand;
2802
2803 modifyImage();
2804
2805 wand=AcquireDrawingWand(options()->drawInfo(),image());
2806
2807 if(wand)
2808 {
2809 drawable_.operator()(wand);
2810
2811 DrawRender(wand);
2812
2813 ClonePPDrawException(wand);
2814 wand=DestroyDrawingWand(wand);
2815 ThrowPPDrawException(quiet());
2816 }
2817 }
2818
2819 void Magick::Image::draw(const std::vector<Magick::Drawable> &drawable_)
2820 {
2821 DrawingWand
2822 *wand;
2823
2824 modifyImage();
2825
2826 wand= AcquireDrawingWand(options()->drawInfo(),image());
2827
2828 if(wand)
2829 {
2830 for (std::vector<Magick::Drawable>::const_iterator p = drawable_.begin();
2831 p != drawable_.end(); p++ )
2832 {
2833 p->operator()(wand);
2834 if (DrawGetExceptionType(wand) != MagickCore::UndefinedException)
2835 break;
2836 }
2837
2838 if (DrawGetExceptionType(wand) == MagickCore::UndefinedException)
2839 DrawRender(wand);
2840
2841 ClonePPDrawException(wand);
2842 wand=DestroyDrawingWand(wand);
2843 ThrowPPDrawException(quiet());
2844 }
2845 }
2846
2847 void Magick::Image::edge(const double radius_)
2848 {
2849 MagickCore::Image
2850 *newImage;
2851
2852 GetPPException;
2853 newImage=EdgeImage(constImage(),radius_,exceptionInfo);
2854 replaceImage(newImage);
2855 ThrowImageException;
2856 }
2857
2858 void Magick::Image::emboss(const double radius_,const double sigma_)
2859 {
2860 MagickCore::Image
2861 *newImage;
2862
2863 GetPPException;
2864 newImage=EmbossImage(constImage(),radius_,sigma_,exceptionInfo);
2865 replaceImage(newImage);
2866 ThrowImageException;
2867 }
2868
2869 void Magick::Image::encipher(const std::string &passphrase_)
2870 {
2871 modifyImage();
2872 GetPPException;
2873 EncipherImage(image(),passphrase_.c_str(),exceptionInfo);
2874 ThrowImageException;
2875 }
2876
2877 void Magick::Image::enhance(void)
2878 {
2879 MagickCore::Image
2880 *newImage;
2881
2882 GetPPException;
2883 newImage=EnhanceImage(constImage(),exceptionInfo);
2884 replaceImage(newImage);
2885 ThrowImageException;
2886 }
2887
2888 void Magick::Image::equalize(void)
2889 {
2890 modifyImage();
2891 GetPPException;
2892 EqualizeImage(image(),exceptionInfo);
2893 ThrowImageException;
2894 }
2895
2896 void Magick::Image::erase(void)
2897 {
2898 modifyImage();
2899 GetPPException;
2900 (void) SetImageBackgroundColor(image(),exceptionInfo);
2901 ThrowImageException;
2902 }
2903
2904 void Magick::Image::evaluate(const ChannelType channel_,
2905 const MagickEvaluateOperator operator_,double rvalue_)
2906 {
2907 GetPPException;
2908 GetAndSetPPChannelMask(channel_);
2909 EvaluateImage(image(),operator_,rvalue_,exceptionInfo);
2910 RestorePPChannelMask;
2911 ThrowImageException;
2912 }
2913
2914 void Magick::Image::evaluate(const ChannelType channel_,
2915 const MagickFunction function_,const size_t number_parameters_,
2916 const double *parameters_)
2917 {
2918 GetPPException;
2919 GetAndSetPPChannelMask(channel_);
2920 FunctionImage(image(),function_,number_parameters_,parameters_,
2921 exceptionInfo);
2922 RestorePPChannelMask;
2923 ThrowImageException;
2924 }
2925
2926 void Magick::Image::evaluate(const ChannelType channel_,const ssize_t x_,
2927 const ssize_t y_,const size_t columns_,const size_t rows_,
2928 const MagickEvaluateOperator operator_,const double rvalue_)
2929 {
2930 RectangleInfo
2931 geometry;
2932
2933 MagickCore::Image
2934 *cropImage;
2935
2936 geometry.width = columns_;
2937 geometry.height = rows_;
2938 geometry.x = x_;
2939 geometry.y = y_;
2940
2941 GetPPException;
2942 cropImage=CropImage(image(),&geometry,exceptionInfo);
2943 GetAndSetPPChannelMask(channel_);
2944 EvaluateImage(cropImage,operator_,rvalue_,exceptionInfo);
2945 RestorePPChannelMask;
2946 (void) CompositeImage(image(),cropImage,image()->alpha_trait ==
2947 BlendPixelTrait ? OverCompositeOp : CopyCompositeOp,MagickFalse,
2948 geometry.x,geometry.y,exceptionInfo );
2949 cropImage=DestroyImageList(cropImage);
2950 ThrowImageException;
2951 }
2952
2953 void Magick::Image::extent(const Geometry &geometry_ )
2954 {
2955 MagickCore::Image
2956 *newImage;
2957
2958 RectangleInfo
2959 extentInfo=geometry_;
2960
2961 modifyImage();
2962 extentInfo.x=geometry_.xOff();
2963 extentInfo.y=geometry_.yOff();
2964 GetPPException;
2965 newImage=ExtentImage(image(),&extentInfo,exceptionInfo);
2966 replaceImage(newImage);
2967 ThrowImageException;
2968 }
2969
2970 void Magick::Image::extent(const Geometry &geometry_,
2971 const Color &backgroundColor_)
2972 {
2973 backgroundColor(backgroundColor_);
2974 extent(geometry_);
2975 }
2976
2977 void Magick::Image::extent(const Geometry &geometry_,
2978 const Color &backgroundColor_,const GravityType gravity_)
2979 {
2980 backgroundColor(backgroundColor_);
2981 extent(geometry_,gravity_);
2982 }
2983
2984 void Magick::Image::extent(const Geometry &geometry_,
2985 const GravityType gravity_)
2986 {
2987 RectangleInfo
2988 geometry;
2989
2990 SetGeometry(image(),&geometry);
2991 geometry.width=geometry_.width();
2992 geometry.height=geometry_.height();
2993 GravityAdjustGeometry(image()->columns,image()->rows,gravity_,&geometry);
2994 extent(geometry);
2995 }
2996
2997 void Magick::Image::flip(void)
2998 {
2999 MagickCore::Image
3000 *newImage;
3001
3002 GetPPException;
3003 newImage=FlipImage(constImage(),exceptionInfo);
3004 replaceImage(newImage);
3005 ThrowImageException;
3006 }
3007
3008 void Magick::Image::floodFillAlpha(const ssize_t x_,const ssize_t y_,
3009 const unsigned int alpha_,const bool invert_)
3010 {
3011 PixelInfo
3012 target;
3013
3014 modifyImage();
3015
3016 target=static_cast<PixelInfo>(pixelColor(x_,y_));
3017 target.alpha=alpha_;
3018 GetPPException;
3019 GetAndSetPPChannelMask(AlphaChannel);
3020 FloodfillPaintImage(image(),options()->drawInfo(),&target,x_,y_,
3021 (MagickBooleanType)invert_,exceptionInfo);
3022 RestorePPChannelMask;
3023 ThrowImageException;
3024 }
3025
3026 void Magick::Image::floodFillAlpha(const ssize_t x_,const ssize_t y_,
3027 const unsigned int alpha_,const Color &target_,const bool invert_)
3028 {
3029 PixelInfo
3030 target;
3031
3032 modifyImage();
3033
3034 target=static_cast<PixelInfo>(target_);
3035 target.alpha=alpha_;
3036 GetPPException;
3037 GetAndSetPPChannelMask(AlphaChannel);
3038 FloodfillPaintImage(image(),options()->drawInfo(),&target,x_,y_,
3039 (MagickBooleanType)invert_,exceptionInfo);
3040 RestorePPChannelMask;
3041 ThrowImageException;
3042 }
3043
3044 void Magick::Image::floodFillColor(const Geometry &point_,
3045 const Magick::Color &fillColor_,const bool invert_)
3046 {
3047 floodFillColor(point_.xOff(),point_.yOff(),fillColor_,invert_);
3048 }
3049
3050 void Magick::Image::floodFillColor(const ssize_t x_,const ssize_t y_,
3051 const Magick::Color &fillColor_,const bool invert_)
3052 {
3053 PixelInfo
3054 pixel;
3055
3056 modifyImage();
3057
3058 pixel=static_cast<PixelInfo>(pixelColor(x_,y_));
3059 floodFill(x_,y_,(Magick::Image *)NULL,fillColor_,&pixel,invert_);
3060 }
3061
3062 void Magick::Image::floodFillColor(const Geometry &point_,
3063 const Magick::Color &fillColor_,const Magick::Color &borderColor_,
3064 const bool invert_)
3065 {
3066 floodFillColor(point_.xOff(),point_.yOff(),fillColor_,borderColor_,invert_);
3067 }
3068
3069 void Magick::Image::floodFillColor(const ssize_t x_,const ssize_t y_,
3070 const Magick::Color &fillColor_,const Magick::Color &borderColor_,
3071 const bool invert_)
3072 {
3073 PixelInfo
3074 pixel;
3075
3076 modifyImage();
3077
3078 pixel=static_cast<PixelInfo>(borderColor_);
3079 floodFill(x_,y_,(Magick::Image *)NULL,fillColor_,&pixel,invert_);
3080 }
3081
3082 void Magick::Image::floodFillTexture(const Magick::Geometry &point_,
3083 const Magick::Image &texture_,const bool invert_)
3084 {
3085 floodFillTexture(point_.xOff(),point_.yOff(),texture_,invert_);
3086 }
3087
3088 void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_,
3089 const Magick::Image &texture_,const bool invert_)
3090 {
3091 PixelInfo
3092 pixel;
3093
3094 modifyImage();
3095
3096 pixel=static_cast<PixelInfo>(pixelColor(x_,y_));
3097 floodFill(x_,y_,&texture_,Magick::Color(),&pixel,invert_);
3098 }
3099
3100 void Magick::Image::floodFillTexture(const Magick::Geometry &point_,
3101 const Magick::Image &texture_,const Magick::Color &borderColor_,
3102 const bool invert_)
3103 {
3104 floodFillTexture(point_.xOff(),point_.yOff(),texture_,borderColor_,invert_);
3105 }
3106
3107 void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_,
3108 const Magick::Image &texture_,const Magick::Color &borderColor_,
3109 const bool invert_)
3110 {
3111 PixelInfo
3112 pixel;
3113
3114 modifyImage();
3115
3116 pixel=static_cast<PixelInfo>(borderColor_);
3117 floodFill(x_,y_,&texture_,Magick::Color(),&pixel,invert_);
3118 }
3119
3120 void Magick::Image::flop(void)
3121 {
3122 MagickCore::Image
3123 *newImage;
3124
3125 GetPPException;
3126 newImage=FlopImage(constImage(),exceptionInfo);
3127 replaceImage(newImage);
3128 ThrowImageException;
3129 }
3130
3131 void Magick::Image::fontTypeMetrics(const std::string &text_,
3132 TypeMetric *metrics)
3133 {
3134 DrawInfo
3135 *drawInfo;
3136
3137 drawInfo=options()->drawInfo();
3138 drawInfo->text=DestroyString(drawInfo->text);
3139 drawInfo->text=const_cast<char *>(text_.c_str());
3140 GetPPException;
3141 GetTypeMetrics(image(),drawInfo,&(metrics->_typeMetric),exceptionInfo);
3142 drawInfo->text=(char *) NULL;
3143 ThrowImageException;
3144 }
3145
3146 void Magick::Image::fontTypeMetricsMultiline(const std::string &text_,
3147 TypeMetric *metrics)
3148 {
3149 DrawInfo
3150 *drawInfo;
3151
3152 drawInfo=options()->drawInfo();
3153 drawInfo->text=DestroyString(drawInfo->text);
3154 drawInfo->text=const_cast<char *>(text_.c_str());
3155 GetPPException;
3156 (void) GetMultilineTypeMetrics(image(),drawInfo,&(metrics->_typeMetric),
3157 exceptionInfo);
3158 drawInfo->text=(char *) NULL;
3159 ThrowImageException;
3160 }
3161
3162 void Magick::Image::frame(const Geometry &geometry_)
3163 {
3164 FrameInfo
3165 info;
3166
3167 MagickCore::Image
3168 *newImage;
3169
3170 info.x=static_cast<ssize_t>(geometry_.width());
3171 info.y=static_cast<ssize_t>(geometry_.height());
3172 info.width=columns() + (static_cast<size_t>(info.x) << 1);
3173 info.height=rows() + (static_cast<size_t>(info.y) << 1);
3174 info.outer_bevel=geometry_.xOff();
3175 info.inner_bevel=geometry_.yOff();
3176
3177 GetPPException;
3178 newImage=FrameImage(constImage(),&info,image()->compose,exceptionInfo);
3179 replaceImage(newImage);
3180 ThrowImageException;
3181 }
3182
3183 void Magick::Image::frame(const size_t width_,const size_t height_,
3184 const ssize_t innerBevel_,const ssize_t outerBevel_)
3185 {
3186 FrameInfo
3187 info;
3188
3189 MagickCore::Image
3190 *newImage;
3191
3192 info.x=static_cast<ssize_t>(width_);
3193 info.y=static_cast<ssize_t>(height_);
3194 info.width=columns() + (static_cast<size_t>(info.x) << 1);
3195 info.height=rows() + (static_cast<size_t>(info.y) << 1);
3196 info.outer_bevel=static_cast<ssize_t>(outerBevel_);
3197 info.inner_bevel=static_cast<ssize_t>(innerBevel_);
3198
3199 GetPPException;
3200 newImage=FrameImage(constImage(),&info,image()->compose,exceptionInfo);
3201 replaceImage(newImage);
3202 ThrowImageException;
3203 }
3204
3205 void Magick::Image::fx(const std::string expression_)
3206 {
3207 MagickCore::Image
3208 *newImage;
3209
3210 GetPPException;
3211 newImage=FxImage(constImage(),expression_.c_str(),exceptionInfo);
3212 replaceImage(newImage);
3213 ThrowImageException;
3214 }
3215
3216 void Magick::Image::fx(const std::string expression_,
3217 const Magick::ChannelType channel_)
3218 {
3219 MagickCore::Image
3220 *newImage;
3221
3222 GetPPException;
3223 GetAndSetPPChannelMask(channel_);
3224 newImage=FxImage(constImage(),expression_.c_str(),exceptionInfo);
3225 RestorePPChannelMask;
3226 replaceImage(newImage);
3227 ThrowImageException;
3228 }
3229
3230 void Magick::Image::gamma(const double gamma_)
3231 {
3232 modifyImage();
3233 GetPPException;
3234 GammaImage(image(),gamma_,exceptionInfo);
3235 ThrowImageException;
3236 }
3237
3238 void Magick::Image::gamma(const double gammaRed_,const double gammaGreen_,
3239 const double gammaBlue_)
3240 {
3241 modifyImage();
3242 GetPPException;
3243 GetAndSetPPChannelMask(RedChannel);
3244 (void) GammaImage(image(),gammaRed_,exceptionInfo);
3245 SetPPChannelMask(GreenChannel);
3246 (void) GammaImage(image(),gammaGreen_,exceptionInfo);
3247 SetPPChannelMask(BlueChannel);
3248 (void) GammaImage(image(),gammaBlue_,exceptionInfo);
3249 RestorePPChannelMask;
3250 ThrowImageException;
3251 }
3252
3253 void Magick::Image::gaussianBlur(const double radius_,const double sigma_)
3254 {
3255 MagickCore::Image
3256 *newImage;
3257
3258 GetPPException;
3259 newImage=GaussianBlurImage(constImage(),radius_,sigma_,exceptionInfo);
3260 replaceImage(newImage);
3261 ThrowImageException;
3262 }
3263
3264 void Magick::Image::gaussianBlurChannel(const ChannelType channel_,
3265 const double radius_,const double sigma_)
3266 {
3267 MagickCore::Image
3268 *newImage;
3269
3270 GetPPException;
3271 GetAndSetPPChannelMask(channel_);
3272 newImage=GaussianBlurImage(constImage(),radius_,sigma_,exceptionInfo);
3273 RestorePPChannelMask;
3274 replaceImage(newImage);
3275 ThrowImageException;
3276 }
3277
3278 const Magick::Quantum *Magick::Image::getConstPixels(const ssize_t x_,
3279 const ssize_t y_,const size_t columns_,const size_t rows_) const
3280 {
3281 const Quantum
3282 *p;
3283
3284 GetPPException;
3285 p=GetVirtualPixels(constImage(),x_, y_,columns_, rows_,exceptionInfo);
3286 ThrowImageException;
3287 return(p);
3288 }
3289
3290 const void *Magick::Image::getConstMetacontent(void) const
3291 {
3292 const void
3293 *result;
3294
3295 result=GetVirtualMetacontent(constImage());
3296
3297 if(!result)
3298 throwExceptionExplicit(MagickCore::OptionError,
3299 "Unable to retrieve meta content.");
3300
3301 return(result);
3302 }
3303
3304 void *Magick::Image::getMetacontent(void )
3305 {
3306 void
3307 *result;
3308
3309 result=GetAuthenticMetacontent(image());
3310
3311 if(!result)
3312 throwExceptionExplicit(MagickCore::OptionError,
3313 "Unable to retrieve meta content.");
3314
3315 return(result);
3316 }
3317
3318 Magick::Quantum *Magick::Image::getPixels(const ssize_t x_,const ssize_t y_,
3319 const size_t columns_,const size_t rows_)
3320 {
3321 Quantum
3322 *result;
3323
3324 modifyImage();
3325 GetPPException;
3326 result=GetAuthenticPixels(image(),x_, y_,columns_,rows_,exceptionInfo);
3327 ThrowImageException;
3328
3329 return(result);
3330 }
3331
3332 void Magick::Image::grayscale(const PixelIntensityMethod method_)
3333 {
3334 modifyImage();
3335 GetPPException;
3336 (void) GrayscaleImage(image(),method_,exceptionInfo);
3337 ThrowImageException;
3338 }
3339
3340 void Magick::Image::haldClut(const Image &clutImage_)
3341 {
3342 modifyImage();
3343 GetPPException;
3344 (void) HaldClutImage(image(),clutImage_.constImage(),exceptionInfo);
3345 ThrowImageException;
3346 }
3347
3348 void Magick::Image::houghLine(const size_t width_,const size_t height_,
3349 const size_t threshold_)
3350 {
3351 MagickCore::Image
3352 *newImage;
3353
3354 GetPPException;
3355 newImage=HoughLineImage(constImage(),width_,height_,threshold_,
3356 exceptionInfo);
3357 replaceImage(newImage);
3358 ThrowImageException;
3359 }
3360
3361 Magick::ImageType Magick::Image::identifyType(void) const
3362 {
3363 ImageType
3364 image_type;
3365
3366 GetPPException;
3367 image_type=IdentifyImageType(constImage(),exceptionInfo);
3368 ThrowImageException;
3369 return(image_type);
3370 }
3371
3372 void Magick::Image::implode(const double factor_)
3373 {
3374 MagickCore::Image
3375 *newImage;
3376
3377 GetPPException;
3378 newImage=ImplodeImage(constImage(),factor_,image()->interpolate,
3379 exceptionInfo);
3380 replaceImage(newImage);
3381 ThrowImageException;
3382 }
3383
3384 void Magick::Image::inverseFourierTransform(const Image &phase_)
3385 {
3386 inverseFourierTransform(phase_,true);
3387 }
3388
3389 void Magick::Image::inverseFourierTransform(const Image &phase_,
3390 const bool magnitude_)
3391 {
3392 MagickCore::Image
3393 *newImage;
3394
3395 GetPPException;
3396 newImage=InverseFourierTransformImage(constImage(),phase_.constImage(),
3397 magnitude_ == true ? MagickTrue : MagickFalse,exceptionInfo);
3398 replaceImage(newImage);
3399 ThrowImageException;
3400 }
3401
3402 void Magick::Image::kuwahara(const double radius_,const double sigma_)
3403 {
3404 MagickCore::Image
3405 *newImage;
3406
3407 GetPPException;
3408 newImage=KuwaharaImage(constImage(),radius_,sigma_,exceptionInfo);
3409 replaceImage(newImage);
3410 ThrowImageException;
3411 }
3412
3413 void Magick::Image::kuwaharaChannel(const ChannelType channel_,
3414 const double radius_,const double sigma_)
3415 {
3416 MagickCore::Image
3417 *newImage;
3418
3419 GetPPException;
3420 GetAndSetPPChannelMask(channel_);
3421 newImage=KuwaharaImage(constImage(),radius_,sigma_,exceptionInfo);
3422 replaceImage(newImage);
3423 RestorePPChannelMask;
3424 ThrowImageException;
3425 }
3426
3427 void Magick::Image::level(const double blackPoint_,const double whitePoint_,
3428 const double gamma_)
3429 {
3430 modifyImage();
3431 GetPPException;
3432 (void) LevelImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo);
3433 ThrowImageException;
3434 }
3435
3436 void Magick::Image::levelChannel(const ChannelType channel_,
3437 const double blackPoint_,const double whitePoint_,const double gamma_)
3438 {
3439 modifyImage();
3440 GetPPException;
3441 GetAndSetPPChannelMask(channel_);
3442 (void) LevelImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo);
3443 RestorePPChannelMask;
3444 ThrowImageException;
3445 }
3446
3447 void Magick::Image::levelColors(const Color &blackColor_,
3448 const Color &whiteColor_,const bool invert_)
3449 {
3450 PixelInfo
3451 black,
3452 white;
3453
3454 modifyImage();
3455
3456 black=static_cast<PixelInfo>(blackColor_);
3457 white=static_cast<PixelInfo>(whiteColor_);
3458 GetPPException;
3459 (void) LevelImageColors(image(),&black,&white,invert_ == true ?
3460 MagickTrue : MagickFalse,exceptionInfo);
3461 ThrowImageException;
3462 }
3463
3464 void Magick::Image::levelColorsChannel(const ChannelType channel_,
3465 const Color &blackColor_,const Color &whiteColor_,const bool invert_)
3466 {
3467 PixelInfo
3468 black,
3469 white;
3470
3471 modifyImage();
3472
3473 black=static_cast<PixelInfo>(blackColor_);
3474 white=static_cast<PixelInfo>(whiteColor_);
3475 GetPPException;
3476 GetAndSetPPChannelMask(channel_);
3477 (void) LevelImageColors(image(),&black,&white,invert_ == true ?
3478 MagickTrue : MagickFalse,exceptionInfo);
3479 RestorePPChannelMask;
3480 ThrowImageException;
3481 }
3482
3483 void Magick::Image::levelize(const double blackPoint_,const double whitePoint_,
3484 const double gamma_)
3485 {
3486 modifyImage();
3487 GetPPException;
3488 (void) LevelizeImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo);
3489 ThrowImageException;
3490 }
3491
3492 void Magick::Image::levelizeChannel(const ChannelType channel_,
3493 const double blackPoint_,const double whitePoint_,const double gamma_)
3494 {
3495 modifyImage();
3496 GetPPException;
3497 GetAndSetPPChannelMask(channel_);
3498 (void) LevelizeImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo);
3499 RestorePPChannelMask;
3500 ThrowImageException;
3501 }
3502
3503 void Magick::Image::linearStretch(const double blackPoint_,
3504 const double whitePoint_)
3505 {
3506 modifyImage();
3507 GetPPException;
3508 LinearStretchImage(image(),blackPoint_,whitePoint_,exceptionInfo);
3509 ThrowImageException;
3510 }
3511
3512 void Magick::Image::liquidRescale(const Geometry &geometry_)
3513 {
3514 MagickCore::Image
3515 *newImage;
3516
3517 size_t
3518 height=rows(),
3519 width=columns();
3520
3521 ssize_t
3522 x=0,
3523 y=0;
3524
3525 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
3526 &height);
3527
3528 GetPPException;
3529 newImage=LiquidRescaleImage(image(),width,height,x,y,exceptionInfo);
3530 replaceImage(newImage);
3531 ThrowImageException;
3532 }
3533
3534 void Magick::Image::localContrast(const double radius_,const double strength_)
3535 {
3536 MagickCore::Image
3537 *newImage;
3538
3539 GetPPException;
3540 newImage=LocalContrastImage(constImage(),radius_,strength_,exceptionInfo);
3541 replaceImage(newImage);
3542 ThrowImageException;
3543 }
3544
3545 void Magick::Image::localContrastChannel(const ChannelType channel_,
3546 const double radius_,const double strength_)
3547 {
3548 MagickCore::Image
3549 *newImage;
3550
3551 GetPPException;
3552 GetAndSetPPChannelMask(channel_);
3553 newImage=LocalContrastImage(constImage(),radius_,strength_,exceptionInfo);
3554 RestorePPChannelMask;
3555 replaceImage(newImage);
3556 ThrowImageException;
3557 }
3558
3559 void Magick::Image::magnify(void)
3560 {
3561 MagickCore::Image
3562 *newImage;
3563
3564 GetPPException;
3565 newImage=MagnifyImage(constImage(),exceptionInfo);
3566 replaceImage(newImage);
3567 ThrowImageException;
3568 }
3569
3570 void Magick::Image::map(const Image &mapImage_,const bool dither_)
3571 {
3572 modifyImage();
3573 GetPPException;
3574 options()->quantizeDither(dither_);
3575 RemapImage(options()->quantizeInfo(),image(),mapImage_.constImage(),
3576 exceptionInfo);
3577 ThrowImageException;
3578 }
3579
3580 void Magick::Image::meanShift(const size_t width_,const size_t height_,
3581 const double color_distance_)
3582 {
3583 MagickCore::Image
3584 *newImage;
3585
3586 GetPPException;
3587 newImage=MeanShiftImage(constImage(),width_,height_,color_distance_,
3588 exceptionInfo);
3589 replaceImage(newImage);
3590 ThrowImageException;
3591 }
3592
3593 void Magick::Image::medianFilter(const double radius_)
3594 {
3595 MagickCore::Image
3596 *newImage;
3597
3598 GetPPException;
3599 newImage=StatisticImage(image(),MedianStatistic,(size_t) radius_,
3600 (size_t) radius_,exceptionInfo);
3601 replaceImage(newImage);
3602 ThrowImageException;
3603 }
3604
3605 void Magick::Image::minify(void)
3606 {
3607 MagickCore::Image
3608 *newImage;
3609
3610 GetPPException;
3611 newImage=MinifyImage(constImage(),exceptionInfo);
3612 replaceImage(newImage);
3613 ThrowImageException;
3614 }
3615
3616 void Magick::Image::modulate(const double brightness_,const double saturation_,
3617 const double hue_)
3618 {
3619 char
3620 modulate[MagickPathExtent + 1];
3621
3622 FormatLocaleString(modulate,MagickPathExtent,"%3.6f,%3.6f,%3.6f",brightness_,
3623 saturation_,hue_);
3624
3625 modifyImage();
3626 GetPPException;
3627 ModulateImage(image(),modulate,exceptionInfo);
3628 ThrowImageException;
3629 }
3630
3631 Magick::ImageMoments Magick::Image::moments(void) const
3632 {
3633 return(ImageMoments(*this));
3634 }
3635
3636 void Magick::Image::morphology(const MorphologyMethod method_,
3637 const std::string kernel_,const ssize_t iterations_)
3638 {
3639 KernelInfo
3640 *kernel;
3641
3642 MagickCore::Image
3643 *newImage;
3644
3645 GetPPException;
3646 kernel=AcquireKernelInfo(kernel_.c_str(),exceptionInfo);
3647 if (kernel == (KernelInfo *) NULL)
3648 throwExceptionExplicit(MagickCore::OptionError,"Unable to parse kernel.");
3649 newImage=MorphologyImage(constImage(),method_,iterations_,kernel,
3650 exceptionInfo);
3651 replaceImage(newImage);
3652 kernel=DestroyKernelInfo(kernel);
3653 ThrowImageException;
3654 }
3655
3656 void Magick::Image::morphology(const MorphologyMethod method_,
3657 const KernelInfoType kernel_,const std::string arguments_,
3658 const ssize_t iterations_)
3659 {
3660 const char
3661 *option;
3662
3663 std::string
3664 kernel;
3665
3666 option=CommandOptionToMnemonic(MagickKernelOptions,kernel_);
3667 if (option == (const char *)NULL)
3668 {
3669 throwExceptionExplicit(MagickCore::OptionError,
3670 "Unable to determine kernel type.");
3671 return;
3672 }
3673 kernel=std::string(option);
3674 if (!arguments_.empty())
3675 kernel+=":"+arguments_;
3676
3677 morphology(method_,kernel,iterations_);
3678 }
3679
3680 void Magick::Image::morphologyChannel(const ChannelType channel_,
3681 const MorphologyMethod method_,const std::string kernel_,
3682 const ssize_t iterations_)
3683 {
3684 KernelInfo
3685 *kernel;
3686
3687 MagickCore::Image
3688 *newImage;
3689
3690
3691 GetPPException;
3692 kernel=AcquireKernelInfo(kernel_.c_str(),exceptionInfo);
3693 if (kernel == (KernelInfo *)NULL)
3694 {
3695 throwExceptionExplicit(MagickCore::OptionError,
3696 "Unable to parse kernel.");
3697 return;
3698 }
3699 GetAndSetPPChannelMask(channel_);
3700 newImage=MorphologyImage(constImage(),method_,iterations_,kernel,
3701 exceptionInfo);
3702 RestorePPChannelMask;
3703 replaceImage(newImage);
3704 kernel=DestroyKernelInfo(kernel);
3705 ThrowImageException;
3706 }
3707
3708 void Magick::Image::morphologyChannel(const ChannelType channel_,
3709 const MorphologyMethod method_,const KernelInfoType kernel_,
3710 const std::string arguments_,const ssize_t iterations_)
3711 {
3712 const char
3713 *option;
3714
3715 std::string
3716 kernel;
3717
3718 option=CommandOptionToMnemonic(MagickKernelOptions,kernel_);
3719 if (option == (const char *)NULL)
3720 {
3721 throwExceptionExplicit(MagickCore::OptionError,
3722 "Unable to determine kernel type.");
3723 return;
3724 }
3725
3726 kernel=std::string(option);
3727 if (!arguments_.empty())
3728 kernel+=":"+arguments_;
3729
3730 morphologyChannel(channel_,method_,kernel,iterations_);
3731 }
3732
3733 void Magick::Image::motionBlur(const double radius_,const double sigma_,
3734 const double angle_)
3735 {
3736 MagickCore::Image
3737 *newImage;
3738
3739 GetPPException;
3740 newImage=MotionBlurImage(constImage(),radius_,sigma_,angle_,exceptionInfo);
3741 replaceImage(newImage);
3742 ThrowImageException;
3743 }
3744
3745 void Magick::Image::negate(const bool grayscale_)
3746 {
3747 modifyImage();
3748 GetPPException;
3749 NegateImage(image(),(MagickBooleanType) grayscale_,exceptionInfo);
3750 ThrowImageException;
3751 }
3752
3753 void Magick::Image::negateChannel(const ChannelType channel_,
3754 const bool grayscale_)
3755 {
3756 modifyImage();
3757 GetPPException;
3758 GetAndSetPPChannelMask(channel_);
3759 NegateImage(image(),(MagickBooleanType) grayscale_,exceptionInfo);
3760 RestorePPChannelMask;
3761 ThrowImageException;
3762 }
3763
3764 void Magick::Image::normalize(void)
3765 {
3766 modifyImage();
3767 GetPPException;
3768 NormalizeImage(image(),exceptionInfo);
3769 ThrowImageException;
3770 }
3771
3772 void Magick::Image::oilPaint(const double radius_,const double sigma_)
3773 {
3774 MagickCore::Image
3775 *newImage;
3776
3777 GetPPException;
3778 newImage=OilPaintImage(constImage(),radius_,sigma_,exceptionInfo);
3779 replaceImage(newImage);
3780 ThrowImageException;
3781 }
3782
3783 void Magick::Image::opaque(const Color &opaqueColor_,const Color &penColor_,
3784 const bool invert_)
3785 {
3786 std::string
3787 opaqueColor,
3788 penColor;
3789
3790 PixelInfo
3791 opaque,
3792 pen;
3793
3794 if (!opaqueColor_.isValid())
3795 throwExceptionExplicit(MagickCore::OptionError,
3796 "Opaque color argument is invalid");
3797
3798 if (!penColor_.isValid())
3799 throwExceptionExplicit(MagickCore::OptionError,
3800 "Pen color argument is invalid");
3801
3802 modifyImage();
3803 opaqueColor=opaqueColor_;
3804 penColor=penColor_;
3805
3806 GetPPException;
3807 (void) QueryColorCompliance(opaqueColor.c_str(),AllCompliance,&opaque,
3808 exceptionInfo);
3809 (void) QueryColorCompliance(penColor.c_str(),AllCompliance,&pen,
3810 exceptionInfo);
3811 OpaquePaintImage(image(),&opaque,&pen,invert_ ? MagickTrue : MagickFalse,
3812 exceptionInfo);
3813 ThrowImageException;
3814 }
3815
3816 void Magick::Image::orderedDither(std::string thresholdMap_)
3817 {
3818 modifyImage();
3819 GetPPException;
3820 (void) OrderedDitherImage(image(),thresholdMap_.c_str(),exceptionInfo);
3821 ThrowImageException;
3822 }
3823
3824 void Magick::Image::orderedDitherChannel(const ChannelType channel_,
3825 std::string thresholdMap_)
3826 {
3827 modifyImage();
3828 GetPPException;
3829 GetAndSetPPChannelMask(channel_);
3830 (void)OrderedDitherImage(image(),thresholdMap_.c_str(),exceptionInfo);
3831 RestorePPChannelMask;
3832 ThrowImageException;
3833 }
3834
3835 void Magick::Image::perceptible(const double epsilon_)
3836 {
3837 modifyImage();
3838 GetPPException;
3839 PerceptibleImage(image(),epsilon_,exceptionInfo);
3840 ThrowImageException;
3841 }
3842
3843 void Magick::Image::perceptibleChannel(const ChannelType channel_,
3844 const double epsilon_)
3845 {
3846 modifyImage();
3847 GetPPException;
3848 GetAndSetPPChannelMask(channel_);
3849 PerceptibleImage(image(),epsilon_,exceptionInfo);
3850 RestorePPChannelMask;
3851 ThrowImageException;
3852 }
3853
3854 Magick::ImagePerceptualHash Magick::Image::perceptualHash() const
3855 {
3856 return(ImagePerceptualHash(*this));
3857 }
3858
3859 void Magick::Image::ping(const std::string &imageSpec_)
3860 {
3861 MagickCore::Image
3862 *newImage;
3863
3864 GetPPException;
3865 options()->fileName(imageSpec_);
3866 newImage=PingImage(imageInfo(),exceptionInfo);
3867 read(newImage,exceptionInfo);
3868 }
3869
3870 void Magick::Image::ping(const Blob& blob_)
3871 {
3872 MagickCore::Image
3873 *newImage;
3874
3875 GetPPException;
3876 newImage=PingBlob(imageInfo(),blob_.data(),blob_.length(),exceptionInfo);
3877 read(newImage,exceptionInfo);
3878 }
3879
3880 void Magick::Image::pixelColor(const ssize_t x_,const ssize_t y_,
3881 const Color &color_)
3882 {
3883 PixelInfo
3884 packet;
3885
3886 Quantum
3887 *pixel;
3888
3889 // Test arguments to ensure they are within the image.
3890 if (y_ > (ssize_t) rows() || x_ > (ssize_t) columns())
3891 throwExceptionExplicit(MagickCore::OptionError,
3892 "Access outside of image boundary");
3893
3894 modifyImage();
3895
3896 // Set image to DirectClass
3897 classType(DirectClass );
3898
3899 // Get pixel view
3900 Pixels pixels(*this);
3901 // Set pixel value
3902 pixel=pixels.get(x_, y_, 1, 1 );
3903 packet=color_;
3904 MagickCore::SetPixelViaPixelInfo(constImage(),&packet,pixel);
3905 // Tell ImageMagick that pixels have been updated
3906 pixels.sync();
3907 }
3908
3909 Magick::Color Magick::Image::pixelColor(const ssize_t x_,
3910 const ssize_t y_) const
3911 {
3912 const Quantum
3913 *pixel;
3914
3915 pixel=getConstPixels(x_,y_,1,1);
3916 if (pixel)
3917 {
3918 PixelInfo
3919 packet;
3920
3921 MagickCore::GetPixelInfoPixel(constImage(),pixel,&packet);
3922 return(Color(packet));
3923 }
3924
3925 return(Color()); // invalid
3926 }
3927
3928 void Magick::Image::polaroid(const std::string &caption_,const double angle_,
3929 const PixelInterpolateMethod method_)
3930 {
3931 MagickCore::Image
3932 *newImage;
3933
3934 GetPPException;
3935 newImage=PolaroidImage(constImage(),options()->drawInfo(),caption_.c_str(),
3936 angle_,method_,exceptionInfo);
3937 replaceImage(newImage);
3938 ThrowImageException;
3939 }
3940
3941 void Magick::Image::posterize(const size_t levels_,const DitherMethod method_)
3942 {
3943 modifyImage();
3944 GetPPException;
3945 PosterizeImage(image(),levels_,method_,exceptionInfo);
3946 ThrowImageException;
3947 }
3948
3949 void Magick::Image::posterizeChannel(const ChannelType channel_,
3950 const size_t levels_,const DitherMethod method_)
3951 {
3952 modifyImage();
3953 GetPPException;
3954 GetAndSetPPChannelMask(channel_);
3955 PosterizeImage(image(),levels_,method_,exceptionInfo);
3956 RestorePPChannelMask;
3957 ThrowImageException;
3958 }
3959
3960 void Magick::Image::process(std::string name_,const ssize_t argc,
3961 const char **argv)
3962 {
3963 modifyImage();
3964
3965 GetPPException;
3966 (void) InvokeDynamicImageFilter(name_.c_str(),&image(),argc,argv,
3967 exceptionInfo);
3968 ThrowImageException;
3969 }
3970
3971 void Magick::Image::profile(const std::string name_,
3972 const Magick::Blob &profile_)
3973 {
3974 modifyImage();
3975 GetPPException;
3976 (void) ProfileImage(image(),name_.c_str(),(unsigned char *)profile_.data(),
3977 profile_.length(),exceptionInfo);
3978 ThrowImageException;
3979 }
3980
3981 Magick::Blob Magick::Image::profile(const std::string name_) const
3982 {
3983 const StringInfo
3984 *profile;
3985
3986 profile=GetImageProfile(constImage(),name_.c_str());
3987
3988 if (profile == (StringInfo *) NULL)
3989 return(Blob());
3990 return(Blob((void*) GetStringInfoDatum(profile),GetStringInfoLength(
3991 profile)));
3992 }
3993
3994 void Magick::Image::quantize(const bool measureError_)
3995 {
3996 modifyImage();
3997
3998 if (measureError_)
3999 options()->quantizeInfo()->measure_error=MagickTrue;
4000 else
4001 options()->quantizeInfo()->measure_error=MagickFalse;
4002
4003 GetPPException;
4004 QuantizeImage(options()->quantizeInfo(),image(),exceptionInfo);
4005 ThrowImageException;
4006 }
4007
4008 void Magick::Image::raise(const Geometry &geometry_,const bool raisedFlag_)
4009 {
4010 RectangleInfo
4011 raiseInfo=geometry_;
4012
4013 GetPPException;
4014 modifyImage();
4015 RaiseImage(image(),&raiseInfo,raisedFlag_ == true ? MagickTrue : MagickFalse,
4016 exceptionInfo);
4017 ThrowImageException;
4018 }
4019
4020 void Magick::Image::randomThreshold(const double low_,const double high_)
4021 {
4022 GetPPException;
4023 (void) RandomThresholdImage(image(),low_,high_,exceptionInfo);
4024 ThrowImageException;
4025 }
4026
4027 void Magick::Image::randomThresholdChannel(const ChannelType channel_,
4028 const double low_,const double high_)
4029 {
4030 modifyImage();
4031 GetPPException;
4032 GetAndSetPPChannelMask(channel_);
4033 (void) RandomThresholdImage(image(),low_,high_,exceptionInfo);
4034 RestorePPChannelMask;
4035 ThrowImageException;
4036 }
4037
4038 void Magick::Image::read(const Blob &blob_)
4039 {
4040 MagickCore::Image
4041 *newImage;
4042
4043 GetPPException;
4044 newImage=BlobToImage(imageInfo(),static_cast<const void *>(blob_.data()),
4045 blob_.length(),exceptionInfo);
4046 read(newImage,exceptionInfo);
4047 }
4048
4049 void Magick::Image::read(const Blob &blob_,const Geometry &size_)
4050 {
4051 size(size_);
4052 read(blob_);
4053 }
4054
4055 void Magick::Image::read(const Blob &blob_,const Geometry &size_,
4056 const size_t depth_)
4057 {
4058 size(size_);
4059 depth(depth_);
4060 read(blob_);
4061 }
4062
4063 void Magick::Image::read(const Blob &blob_,const Geometry &size_,
4064 const size_t depth_,const std::string &magick_)
4065 {
4066 size(size_);
4067 depth(depth_);
4068 magick(magick_);
4069 // Set explicit image format
4070 fileName(magick_ + ':');
4071 read(blob_);
4072 }
4073
4074 void Magick::Image::read(const Blob &blob_,const Geometry &size_,
4075 const std::string &magick_)
4076 {
4077 size(size_);
4078 magick(magick_);
4079 // Set explicit image format
4080 fileName(magick_ + ':');
4081 read(blob_);
4082 }
4083
4084 void Magick::Image::read(const Geometry &size_,const std::string &imageSpec_)
4085 {
4086 size(size_);
4087 read(imageSpec_);
4088 }
4089
4090 void Magick::Image::read(const size_t width_,const size_t height_,
4091 const std::string &map_,const StorageType type_,const void *pixels_)
4092 {
4093 MagickCore::Image
4094 *newImage;
4095
4096 GetPPException;
4097 newImage=ConstituteImage(width_,height_,map_.c_str(),type_, pixels_,
4098 exceptionInfo);
4099 replaceImage(newImage);
4100 ThrowImageException;
4101 }
4102
4103 void Magick::Image::read(const std::string &imageSpec_)
4104 {
4105 MagickCore::Image
4106 *newImage;
4107
4108 GetPPException;
4109 options()->fileName(imageSpec_);
4110 newImage=ReadImage(imageInfo(),exceptionInfo);
4111 read(newImage,exceptionInfo);
4112 }
4113
4114 void Magick::Image::readMask(const Magick::Image &mask_)
4115 {
4116 mask(mask_,ReadPixelMask);
4117 }
4118
4119 Magick::Image Magick::Image::readMask(void) const
4120 {
4121 return(mask(ReadPixelMask));
4122 }
4123
4124 void Magick::Image::readPixels(const Magick::QuantumType quantum_,
4125 const unsigned char *source_)
4126 {
4127 QuantumInfo
4128 *quantum_info;
4129
4130 quantum_info=AcquireQuantumInfo(imageInfo(),image());
4131 GetPPException;
4132 ImportQuantumPixels(image(),(MagickCore::CacheView *) NULL,quantum_info,
4133 quantum_,source_,exceptionInfo);
4134 quantum_info=DestroyQuantumInfo(quantum_info);
4135 ThrowImageException;
4136 }
4137
4138 void Magick::Image::reduceNoise(void)
4139 {
4140 reduceNoise(3);
4141 }
4142
4143 void Magick::Image::reduceNoise(const size_t order_)
4144 {
4145 MagickCore::Image
4146 *newImage;
4147
4148 GetPPException;
4149 newImage=StatisticImage(constImage(),NonpeakStatistic,order_,
4150 order_,exceptionInfo);
4151 replaceImage(newImage);
4152 ThrowImageException;
4153 }
4154
4155 void Magick::Image::repage()
4156 {
4157 modifyImage();
4158 options()->page(Geometry());
4159 image()->page.width = 0;
4160 image()->page.height = 0;
4161 image()->page.x = 0;
4162 image()->page.y = 0;
4163 }
4164
4165 void Magick::Image::resample(const Point &density_)
4166 {
4167 MagickCore::Image
4168 *newImage;
4169
4170 GetPPException;
4171 newImage=ResampleImage(constImage(),density_.x(),density_.y(),
4172 image()->filter,exceptionInfo);
4173 replaceImage(newImage);
4174 ThrowImageException;
4175 }
4176
4177 void Magick::Image::resize(const Geometry &geometry_)
4178 {
4179 MagickCore::Image
4180 *newImage;
4181
4182 size_t
4183 height=rows(),
4184 width=columns();
4185
4186 ssize_t
4187 x=0,
4188 y=0;
4189
4190 // Calculate new size. This code should be supported using binary arguments
4191 // in the ImageMagick library.
4192 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
4193 &height);
4194
4195 GetPPException;
4196 newImage=ResizeImage(constImage(),width,height,image()->filter,
4197 exceptionInfo);
4198 replaceImage(newImage);
4199 ThrowImageException;
4200 }
4201
4202 void Magick::Image::roll(const Geometry &roll_)
4203 {
4204 MagickCore::Image
4205 *newImage;
4206
4207 GetPPException;
4208 newImage=RollImage(constImage(),roll_.xOff(),roll_.yOff(),exceptionInfo);
4209 replaceImage(newImage);
4210 ThrowImageException;
4211 }
4212
4213 void Magick::Image::roll(const size_t columns_,const size_t rows_)
4214 {
4215 MagickCore::Image
4216 *newImage;
4217
4218 GetPPException;
4219 newImage=RollImage(constImage(),static_cast<ssize_t>(columns_),
4220 static_cast<ssize_t>(rows_),exceptionInfo);
4221 replaceImage(newImage);
4222 ThrowImageException;
4223 }
4224
4225 void Magick::Image::rotate(const double degrees_)
4226 {
4227 MagickCore::Image
4228 *newImage;
4229
4230 GetPPException;
4231 newImage=RotateImage(constImage(),degrees_,exceptionInfo);
4232 replaceImage(newImage);
4233 ThrowImageException;
4234 }
4235
4236 void Magick::Image::rotationalBlur(const double angle_)
4237 {
4238 MagickCore::Image
4239 *newImage;
4240
4241 GetPPException;
4242 newImage=RotationalBlurImage(constImage(),angle_,exceptionInfo);
4243 replaceImage(newImage);
4244 ThrowImageException;
4245 }
4246
4247 void Magick::Image::rotationalBlurChannel(const ChannelType channel_,
4248 const double angle_)
4249 {
4250 MagickCore::Image
4251 *newImage;
4252
4253 GetPPException;
4254 GetAndSetPPChannelMask(channel_);
4255 newImage=RotationalBlurImage(constImage(),angle_,exceptionInfo);
4256 RestorePPChannelMask;
4257 replaceImage(newImage);
4258 ThrowImageException;
4259 }
4260
4261 void Magick::Image::sample(const Geometry &geometry_)
4262 {
4263 MagickCore::Image
4264 *newImage;
4265
4266 size_t
4267 height=rows(),
4268 width=columns();
4269
4270 ssize_t
4271 x=0,
4272 y=0;
4273
4274 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
4275 &height);
4276
4277 GetPPException;
4278 newImage=SampleImage(constImage(),width,height,exceptionInfo);
4279 replaceImage(newImage);
4280 ThrowImageException;
4281 }
4282
4283 void Magick::Image::scale(const Geometry &geometry_)
4284 {
4285 MagickCore::Image
4286 *newImage;
4287
4288 size_t
4289 height=rows(),
4290 width=columns();
4291
4292 ssize_t
4293 x=0,
4294 y=0;
4295
4296 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
4297 &height);
4298
4299 GetPPException;
4300 newImage=ScaleImage(constImage(),width,height,exceptionInfo);
4301 replaceImage(newImage);
4302 ThrowImageException;
4303 }
4304
4305 void Magick::Image::segment(const double clusterThreshold_,
4306 const double smoothingThreshold_)
4307 {
4308 modifyImage();
4309 GetPPException;
4310 SegmentImage(image(),options()->quantizeColorSpace(),
4311 (MagickBooleanType) options()->verbose(),clusterThreshold_,
4312 smoothingThreshold_,exceptionInfo);
4313 SyncImage(image(),exceptionInfo);
4314 ThrowImageException;
4315 }
4316
4317 void Magick::Image::selectiveBlur(const double radius_,const double sigma_,
4318 const double threshold_)
4319 {
4320 MagickCore::Image
4321 *newImage;
4322
4323 GetPPException;
4324 newImage=SelectiveBlurImage(constImage(),radius_,sigma_,threshold_,
4325 exceptionInfo);
4326 replaceImage(newImage);
4327 ThrowImageException;
4328 }
4329
4330 void Magick::Image::selectiveBlurChannel(const ChannelType channel_,
4331 const double radius_,const double sigma_,const double threshold_)
4332 {
4333 MagickCore::Image
4334 *newImage;
4335
4336 GetPPException;
4337 GetAndSetPPChannelMask(channel_);
4338 newImage=SelectiveBlurImage(constImage(),radius_,sigma_,threshold_,
4339 exceptionInfo);
4340 RestorePPChannelMask;
4341 replaceImage(newImage);
4342 ThrowImageException;
4343 }
4344
4345 Magick::Image Magick::Image::separate(const ChannelType channel_) const
4346 {
4347 MagickCore::Image
4348 *image;
4349
4350 GetPPException;
4351 image=SeparateImage(constImage(),channel_,exceptionInfo);
4352 ThrowImageException;
4353 if (image == (MagickCore::Image *) NULL)
4354 return(Magick::Image());
4355 else
4356 return(Magick::Image(image));
4357 }
4358
4359 void Magick::Image::sepiaTone(const double threshold_)
4360 {
4361 MagickCore::Image
4362 *newImage;
4363
4364 GetPPException;
4365 newImage=SepiaToneImage(constImage(),threshold_,exceptionInfo);
4366 replaceImage(newImage);
4367 ThrowImageException;
4368 }
4369
4370 bool Magick::Image::setColorMetric(const Image &reference_)
4371 {
4372 bool
4373 status;
4374
4375 Image
4376 ref=reference_;
4377
4378 GetPPException;
4379 modifyImage();
4380 status=static_cast<bool>(SetImageColorMetric(image(),ref.constImage(),
4381 exceptionInfo));
4382 ThrowImageException;
4383 return(status);
4384 }
4385
4386 Magick::Quantum *Magick::Image::setPixels(const ssize_t x_,const ssize_t y_,
4387 const size_t columns_,const size_t rows_)
4388 {
4389 Quantum
4390 *result;
4391
4392 modifyImage();
4393 GetPPException;
4394 result=QueueAuthenticPixels(image(),x_,y_,columns_,rows_,exceptionInfo);
4395 ThrowImageException;
4396 return(result);
4397 }
4398
4399 void Magick::Image::shade(const double azimuth_,const double elevation_,
4400 const bool colorShading_)
4401 {
4402 MagickCore::Image
4403 *newImage;
4404
4405 GetPPException;
4406 newImage=ShadeImage(constImage(),colorShading_ == true ?
4407 MagickTrue : MagickFalse,azimuth_,elevation_,exceptionInfo);
4408 replaceImage(newImage);
4409 ThrowImageException;
4410 }
4411
4412 void Magick::Image::shadow(const double percent_opacity_,const double sigma_,
4413 const ssize_t x_,const ssize_t y_)
4414 {
4415 MagickCore::Image
4416 *newImage;
4417
4418 GetPPException;
4419 newImage=ShadowImage(constImage(),percent_opacity_, sigma_,x_, y_,
4420 exceptionInfo);
4421 replaceImage(newImage);
4422 ThrowImageException;
4423 }
4424
4425 void Magick::Image::sharpen(const double radius_,const double sigma_)
4426 {
4427 MagickCore::Image
4428 *newImage;
4429
4430 GetPPException;
4431 newImage=SharpenImage(constImage(),radius_,sigma_,exceptionInfo);
4432 replaceImage(newImage);
4433 ThrowImageException;
4434 }
4435
4436 void Magick::Image::sharpenChannel(const ChannelType channel_,
4437 const double radius_,const double sigma_)
4438 {
4439 MagickCore::Image
4440 *newImage;
4441
4442 GetPPException;
4443 GetAndSetPPChannelMask(channel_);
4444 newImage=SharpenImage(constImage(),radius_,sigma_,exceptionInfo);
4445 RestorePPChannelMask;
4446 replaceImage(newImage);
4447 ThrowImageException;
4448 }
4449
4450 void Magick::Image::shave(const Geometry &geometry_)
4451 {
4452 MagickCore::Image
4453 *newImage;
4454
4455 RectangleInfo
4456 shaveInfo=geometry_;
4457
4458 GetPPException;
4459 newImage=ShaveImage(constImage(),&shaveInfo,exceptionInfo);
4460 replaceImage(newImage);
4461 ThrowImageException;
4462 }
4463
4464 void Magick::Image::shear(const double xShearAngle_,const double yShearAngle_)
4465 {
4466 MagickCore::Image
4467 *newImage;
4468
4469 GetPPException;
4470 newImage=ShearImage(constImage(),xShearAngle_,yShearAngle_,exceptionInfo);
4471 replaceImage(newImage);
4472 ThrowImageException;
4473 }
4474
4475 void Magick::Image::sigmoidalContrast(const bool sharpen_,
4476 const double contrast,const double midpoint)
4477 {
4478 modifyImage();
4479 GetPPException;
4480 (void) SigmoidalContrastImage(image(),(MagickBooleanType) sharpen_,contrast,
4481 midpoint,exceptionInfo);
4482 ThrowImageException;
4483 }
4484
4485 std::string Magick::Image::signature(const bool force_) const
4486 {
4487 return(_imgRef->signature(force_));
4488 }
4489
4490 void Magick::Image::sketch(const double radius_,const double sigma_,
4491 const double angle_)
4492 {
4493 MagickCore::Image
4494 *newImage;
4495
4496 GetPPException;
4497 newImage=SketchImage(constImage(),radius_,sigma_,angle_,exceptionInfo);
4498 replaceImage(newImage);
4499 ThrowImageException;
4500 }
4501
4502 void Magick::Image::solarize(const double factor_)
4503 {
4504 modifyImage();
4505 GetPPException;
4506 SolarizeImage(image(),factor_,exceptionInfo);
4507 ThrowImageException;
4508 }
4509
4510 void Magick::Image::sparseColor(const ChannelType channel_,
4511 const SparseColorMethod method_,const size_t numberArguments_,
4512 const double *arguments_)
4513 {
4514 MagickCore::Image
4515 *newImage;
4516
4517 GetPPException;
4518 GetAndSetPPChannelMask(channel_);
4519 newImage=SparseColorImage(constImage(),method_,numberArguments_,arguments_,
4520 exceptionInfo);
4521 RestorePPChannelMask;
4522 replaceImage(newImage);
4523 ThrowImageException;
4524 }
4525
4526 void Magick::Image::splice(const Geometry &geometry_)
4527 {
4528 MagickCore::Image
4529 *newImage;
4530
4531 RectangleInfo
4532 spliceInfo=geometry_;
4533
4534 GetPPException;
4535 newImage=SpliceImage(constImage(),&spliceInfo,exceptionInfo);
4536 replaceImage(newImage);
4537 ThrowImageException;
4538 }
4539
4540 void Magick::Image::splice(const Geometry &geometry_,
4541 const Color &backgroundColor_)
4542 {
4543 backgroundColor(backgroundColor_);
4544 splice(geometry_);
4545 }
4546
4547 void Magick::Image::splice(const Geometry &geometry_,
4548 const Color &backgroundColor_,const GravityType gravity_)
4549 {
4550 backgroundColor(backgroundColor_);
4551 image()->gravity=gravity_;
4552 splice(geometry_);
4553 }
4554
4555 void Magick::Image::spread(const double amount_)
4556 {
4557 MagickCore::Image
4558 *newImage;
4559
4560 GetPPException;
4561 newImage=SpreadImage(constImage(),image()->interpolate,amount_,exceptionInfo);
4562 replaceImage(newImage);
4563 ThrowImageException;
4564 }
4565
4566 Magick::ImageStatistics Magick::Image::statistics() const
4567 {
4568 return(ImageStatistics(*this));
4569 }
4570
4571 void Magick::Image::stegano(const Image &watermark_)
4572 {
4573 MagickCore::Image
4574 *newImage;
4575
4576 GetPPException;
4577 newImage=SteganoImage(constImage(),watermark_.constImage(),exceptionInfo);
4578 replaceImage(newImage);
4579 ThrowImageException;
4580 }
4581
4582 void Magick::Image::stereo(const Image &rightImage_)
4583 {
4584 MagickCore::Image
4585 *newImage;
4586
4587 GetPPException;
4588 newImage=StereoImage(constImage(),rightImage_.constImage(),exceptionInfo);
4589 replaceImage(newImage);
4590 ThrowImageException;
4591 }
4592
4593 void Magick::Image::strip(void)
4594 {
4595 modifyImage();
4596 GetPPException;
4597 StripImage(image(),exceptionInfo);
4598 ThrowImageException;
4599 }
4600
4601 Magick::Image Magick::Image::subImageSearch(const Image &reference_,
4602 const MetricType metric_,Geometry *offset_,double *similarityMetric_,
4603 const double similarityThreshold)
4604 {
4605 MagickCore::Image
4606 *newImage;
4607
4608 RectangleInfo
4609 offset;
4610
4611 GetPPException;
4612 newImage=SimilarityImage(image(),reference_.constImage(),metric_,
4613 similarityThreshold,&offset,similarityMetric_,exceptionInfo);
4614 ThrowImageException;
4615 if (offset_ != (Geometry *) NULL)
4616 *offset_=offset;
4617 if (newImage == (MagickCore::Image *) NULL)
4618 return(Magick::Image());
4619 else
4620 return(Magick::Image(newImage));
4621 }
4622
4623 void Magick::Image::swirl(const double degrees_)
4624 {
4625 MagickCore::Image
4626 *newImage;
4627
4628 GetPPException;
4629 newImage=SwirlImage(constImage(),degrees_,image()->interpolate,
4630 exceptionInfo);
4631 replaceImage(newImage);
4632 ThrowImageException;
4633 }
4634
4635 void Magick::Image::syncPixels(void)
4636 {
4637 GetPPException;
4638 (void) SyncAuthenticPixels(image(),exceptionInfo);
4639 ThrowImageException;
4640 }
4641
4642 void Magick::Image::texture(const Image &texture_)
4643 {
4644 modifyImage();
4645 GetPPException;
4646 TextureImage(image(),texture_.constImage(),exceptionInfo);
4647 ThrowImageException;
4648 }
4649
4650 void Magick::Image::threshold(const double threshold_)
4651 {
4652 modifyImage();
4653 GetPPException;
4654 BilevelImage(image(),threshold_,exceptionInfo);
4655 ThrowImageException;
4656 }
4657
4658 void Magick::Image::thumbnail(const Geometry &geometry_)
4659 {
4660 MagickCore::Image
4661 *newImage;
4662
4663 size_t
4664 height=rows(),
4665 width=columns();
4666
4667 ssize_t
4668 x=0,
4669 y=0;
4670
4671 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
4672 &height);
4673
4674 GetPPException;
4675 newImage=ThumbnailImage(constImage(),width,height,exceptionInfo);
4676 replaceImage(newImage);
4677 ThrowImageException;
4678 }
4679
4680 void Magick::Image::tint(const std::string opacity_)
4681 {
4682 MagickCore::Image
4683 *newImage;
4684
4685 PixelInfo
4686 color;
4687
4688 GetPPException;
4689 color=static_cast<PixelInfo>(constOptions()->fillColor());
4690 newImage=TintImage(constImage(),opacity_.c_str(),&color,exceptionInfo);
4691 replaceImage(newImage);
4692 ThrowImageException;
4693 }
4694
4695 void Magick::Image::transformOrigin(const double x_,const double y_)
4696 {
4697 modifyImage();
4698 options()->transformOrigin(x_,y_);
4699 }
4700
4701 void Magick::Image::transformReset(void)
4702 {
4703 modifyImage();
4704 options()->transformReset();
4705 }
4706
4707 void Magick::Image::transformScale(const double sx_,const double sy_)
4708 {
4709 modifyImage();
4710 options()->transformScale(sx_,sy_);
4711 }
4712
4713 void Magick::Image::transparent(const Color &color_,const bool inverse_)
4714 {
4715 PixelInfo
4716 target;
4717
4718 std::string
4719 color;
4720
4721 if (!color_.isValid())
4722 throwExceptionExplicit(MagickCore::OptionError,
4723 "Color argument is invalid");
4724
4725 color=color_;
4726 GetPPException;
4727 (void) QueryColorCompliance(color.c_str(),AllCompliance,&target,
4728 exceptionInfo);
4729 modifyImage();
4730 TransparentPaintImage(image(),&target,TransparentAlpha,
4731 inverse_ == true ? MagickTrue : MagickFalse,exceptionInfo);
4732 ThrowImageException;
4733 }
4734
4735 void Magick::Image::transparentChroma(const Color &colorLow_,
4736 const Color &colorHigh_)
4737 {
4738 std::string
4739 colorHigh,
4740 colorLow;
4741
4742 PixelInfo
4743 targetHigh,
4744 targetLow;
4745
4746 if (!colorLow_.isValid() || !colorHigh_.isValid())
4747 throwExceptionExplicit(MagickCore::OptionError,
4748 "Color argument is invalid");
4749
4750 colorLow=colorLow_;
4751 colorHigh=colorHigh_;
4752
4753 GetPPException;
4754 (void) QueryColorCompliance(colorLow.c_str(),AllCompliance,&targetLow,
4755 exceptionInfo);
4756 (void) QueryColorCompliance(colorHigh.c_str(),AllCompliance,&targetHigh,
4757 exceptionInfo);
4758 modifyImage();
4759 TransparentPaintImageChroma(image(),&targetLow,&targetHigh,TransparentAlpha,
4760 MagickFalse,exceptionInfo);
4761 ThrowImageException;
4762 }
4763
4764 void Magick::Image::transpose(void)
4765 {
4766 MagickCore::Image
4767 *newImage;
4768
4769 GetPPException;
4770 newImage=TransposeImage(constImage(),exceptionInfo);
4771 replaceImage(newImage);
4772 ThrowImageException;
4773 }
4774
4775 void Magick::Image::transverse(void)
4776 {
4777 MagickCore::Image
4778 *newImage;
4779
4780 GetPPException;
4781 newImage=TransverseImage(constImage(),exceptionInfo);
4782 replaceImage(newImage);
4783 ThrowImageException;
4784 }
4785
4786 void Magick::Image::trim(void)
4787 {
4788 MagickCore::Image
4789 *newImage;
4790
4791 GetPPException;
4792 newImage=TrimImage(constImage(),exceptionInfo);
4793 replaceImage(newImage);
4794 ThrowImageException;
4795 }
4796
4797 Magick::Image Magick::Image::uniqueColors(void) const
4798 {
4799 MagickCore::Image
4800 *image;
4801
4802 GetPPException;
4803 image=UniqueImageColors(constImage(),exceptionInfo);
4804 ThrowImageException;
4805 if (image == (MagickCore::Image *) NULL)
4806 return(Magick::Image());
4807 else
4808 return(Magick::Image(image));
4809 }
4810
4811 void Magick::Image::unsharpmask(const double radius_,const double sigma_,
4812 const double amount_,const double threshold_)
4813 {
4814 MagickCore::Image
4815 *newImage;
4816
4817 GetPPException;
4818 newImage=UnsharpMaskImage(constImage(),radius_,sigma_,amount_,threshold_,
4819 exceptionInfo);
4820 replaceImage(newImage);
4821 ThrowImageException;
4822 }
4823
4824 void Magick::Image::unsharpmaskChannel(const ChannelType channel_,
4825 const double radius_,const double sigma_,const double amount_,
4826 const double threshold_)
4827 {
4828 MagickCore::Image
4829 *newImage;
4830
4831 GetPPException;
4832 GetAndSetPPChannelMask(channel_);
4833 newImage=UnsharpMaskImage(constImage(),radius_,sigma_,amount_,threshold_,
4834 exceptionInfo);
4835 RestorePPChannelMask;
4836 replaceImage(newImage);
4837 ThrowImageException;
4838 }
4839
4840 void Magick::Image::vignette(const double radius_,const double sigma_,
4841 const ssize_t x_,const ssize_t y_)
4842 {
4843 MagickCore::Image
4844 *newImage;
4845
4846 GetPPException;
4847 newImage=VignetteImage(constImage(),radius_,sigma_,x_,y_,exceptionInfo);
4848 replaceImage(newImage);
4849 ThrowImageException;
4850 }
4851
4852 void Magick::Image::wave(const double amplitude_,const double wavelength_)
4853 {
4854 MagickCore::Image
4855 *newImage;
4856
4857 GetPPException;
4858 newImage=WaveImage(constImage(),amplitude_,wavelength_,image()->interpolate,
4859 exceptionInfo);
4860 replaceImage(newImage);
4861 ThrowImageException;
4862 }
4863
4864 void Magick::Image::waveletDenoise(const double threshold_,
4865 const double softness_)
4866 {
4867 MagickCore::Image
4868 *newImage;
4869
4870 GetPPException;
4871 newImage=WaveletDenoiseImage(constImage(),threshold_,softness_,
4872 exceptionInfo);
4873 replaceImage(newImage);
4874 ThrowImageException;
4875 }
4876
4877 void Magick::Image::whiteThreshold(const std::string &threshold_)
4878 {
4879 modifyImage();
4880 GetPPException;
4881 WhiteThresholdImage(image(),threshold_.c_str(),exceptionInfo);
4882 ThrowImageException;
4883 }
4884
4885 void Magick::Image::whiteThresholdChannel(const ChannelType channel_,
4886 const std::string &threshold_)
4887 {
4888 modifyImage();
4889 GetPPException;
4890 GetAndSetPPChannelMask(channel_);
4891 WhiteThresholdImage(image(),threshold_.c_str(),exceptionInfo);
4892 RestorePPChannelMask;
4893 ThrowImageException;
4894 }
4895
4896 void Magick::Image::write(Blob *blob_)
4897 {
4898 size_t
4899 length=0;
4900
4901 void
4902 *data;
4903
4904 modifyImage();
4905 GetPPException;
4906 data=ImagesToBlob(constImageInfo(),image(),&length,exceptionInfo);
4907 if (length > 0)
4908 blob_->updateNoCopy(data,length,Blob::MallocAllocator);
4909 else
4910 data=RelinquishMagickMemory(data);
4911 ThrowImageException;
4912 }
4913
4914 void Magick::Image::write(Blob *blob_,const std::string &magick_)
4915 {
4916 size_t
4917 length=0;
4918
4919 void
4920 *data;
4921
4922 modifyImage();
4923 magick(magick_);
4924 GetPPException;
4925 data=ImagesToBlob(constImageInfo(),image(),&length,exceptionInfo);
4926 if (length > 0)
4927 blob_->updateNoCopy(data,length,Blob::MallocAllocator);
4928 else
4929 data=RelinquishMagickMemory(data);
4930 ThrowImageException;
4931 }
4932
4933 void Magick::Image::write(Blob *blob_,const std::string &magick_,
4934 const size_t depth_)
4935 {
4936 size_t
4937 length=0;
4938
4939 void
4940 *data;
4941
4942 modifyImage();
4943 magick(magick_);
4944 depth(depth_);
4945 GetPPException;
4946 data=ImagesToBlob(constImageInfo(),image(),&length,exceptionInfo);
4947 if (length > 0)
4948 blob_->updateNoCopy(data,length,Blob::MallocAllocator);
4949 else
4950 data=RelinquishMagickMemory(data);
4951 ThrowImageException;
4952 }
4953
4954 void Magick::Image::write(const ssize_t x_,const ssize_t y_,
4955 const size_t columns_,const size_t rows_,const std::string &map_,
4956 const StorageType type_,void *pixels_)
4957 {
4958 GetPPException;
4959 ExportImagePixels(image(),x_,y_,columns_,rows_,map_.c_str(),type_,pixels_,
4960 exceptionInfo);
4961 ThrowImageException;
4962 }
4963
4964 void Magick::Image::write(const std::string &imageSpec_)
4965 {
4966 modifyImage();
4967 fileName(imageSpec_);
4968 GetPPException;
4969 WriteImage(constImageInfo(),image(),exceptionInfo);
4970 ThrowImageException;
4971 }
4972
4973 void Magick::Image::writeMask(const Magick::Image &mask_)
4974 {
4975 mask(mask_,WritePixelMask);
4976 }
4977
4978 Magick::Image Magick::Image::writeMask(void) const
4979 {
4980 return(mask(WritePixelMask));
4981 }
4982
4983 void Magick::Image::writePixels(const Magick::QuantumType quantum_,
4984 unsigned char *destination_)
4985 {
4986 QuantumInfo
4987 *quantum_info;
4988
4989 quantum_info=AcquireQuantumInfo(imageInfo(),image());
4990 GetPPException;
4991 ExportQuantumPixels(image(),(MagickCore::CacheView *) NULL,quantum_info,
4992 quantum_,destination_, exceptionInfo);
4993 quantum_info=DestroyQuantumInfo(quantum_info);
4994 ThrowImageException;
4995 }
4996
4997 void Magick::Image::zoom(const Geometry &geometry_)
4998 {
4999 MagickCore::Image
5000 *newImage;
5001
5002 size_t
5003 height=rows(),
5004 width=columns();
5005
5006 ssize_t
5007 x=0,
5008 y=0;
5009
5010 ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
5011 &height);
5012
5013 GetPPException;
5014 newImage=ResizeImage(constImage(),width,height,image()->filter,exceptionInfo);
5015 replaceImage(newImage);
5016 ThrowImageException;
5017 }
5018
5019 Magick::Image::Image(MagickCore::Image *image_)
5020 : _imgRef(new ImageRef(image_))
5021 {
5022 }
5023
5024 MagickCore::Image *&Magick::Image::image(void)
5025 {
5026 return(_imgRef->image());
5027 }
5028
5029 const MagickCore::Image *Magick::Image::constImage(void) const
5030 {
5031 return(_imgRef->image());
5032 }
5033
5034 MagickCore::ImageInfo *Magick::Image::imageInfo(void)
5035 {
5036 return(_imgRef->options()->imageInfo());
5037 }
5038
5039 const MagickCore::ImageInfo *Magick::Image::constImageInfo(void) const
5040 {
5041 return(_imgRef->options()->imageInfo());
5042 }
5043
5044 Magick::Options *Magick::Image::options(void)
5045 {
5046 return(_imgRef->options());
5047 }
5048
5049 const Magick::Options *Magick::Image::constOptions(void) const
5050 {
5051 return(_imgRef->options());
5052 }
5053
5054 MagickCore::QuantizeInfo *Magick::Image::quantizeInfo(void)
5055 {
5056 return(_imgRef->options()->quantizeInfo());
5057 }
5058
5059 const MagickCore::QuantizeInfo *Magick::Image::constQuantizeInfo(void) const
5060 {
5061 return(_imgRef->options()->quantizeInfo());
5062 }
5063
5064 void Magick::Image::modifyImage(void)
5065 {
5066 if (!_imgRef->isShared())
5067 return;
5068
5069 GetPPException;
5070 replaceImage(CloneImage(image(),0,0,MagickTrue,exceptionInfo));
5071 ThrowImageException;
5072 }
5073
5074 MagickCore::Image *Magick::Image::replaceImage(MagickCore::Image *replacement_)
5075 {
5076 MagickCore::Image
5077 *image;
5078
5079 if (replacement_)
5080 image=replacement_;
5081 else
5082 {
5083 GetPPException;
5084 image=AcquireImage(constImageInfo(),exceptionInfo);
5085 ThrowImageException;
5086 }
5087
5088 _imgRef=ImageRef::replaceImage(_imgRef,image);
5089 return(image);
5090 }
5091
5092 void Magick::Image::read(MagickCore::Image *image,
5093 MagickCore::ExceptionInfo *exceptionInfo)
5094 {
5095 // Ensure that multiple image frames were not read.
5096 if (image != (MagickCore::Image *) NULL &&
5097 image->next != (MagickCore::Image *) NULL)
5098 {
5099 MagickCore::Image
5100 *next;
5101
5102 // Destroy any extra image frames
5103 next=image->next;
5104 image->next=(MagickCore::Image *) NULL;
5105 next->previous=(MagickCore::Image *) NULL;
5106 DestroyImageList(next);
5107 }
5108 replaceImage(image);
5109 if (exceptionInfo->severity == MagickCore::UndefinedException &&
5110 image == (MagickCore::Image *) NULL)
5111 {
5112 (void) MagickCore::DestroyExceptionInfo(exceptionInfo);
5113 if (!quiet())
5114 throwExceptionExplicit(MagickCore::ImageWarning,
5115 "No image was loaded.");
5116 return;
5117 }
5118 ThrowImageException;
5119 }
5120
5121 void Magick::Image::floodFill(const ssize_t x_,const ssize_t y_,
5122 const Magick::Image *fillPattern_,const Magick::Color &fill_,
5123 const MagickCore::PixelInfo *target_,const bool invert_)
5124 {
5125 Magick::Color
5126 fillColor;
5127
5128 MagickCore::Image
5129 *fillPattern;
5130
5131 // Set drawing fill pattern or fill color
5132 fillColor=options()->fillColor();
5133 fillPattern=(MagickCore::Image *)NULL;
5134 if (options()->fillPattern() != (MagickCore::Image *)NULL)
5135 {
5136 GetPPException;
5137 fillPattern=CloneImage(options()->fillPattern(),0,0,MagickTrue,
5138 exceptionInfo);
5139 ThrowImageException;
5140 }
5141
5142 if (fillPattern_ == (Magick::Image *)NULL)
5143 {
5144 options()->fillPattern((MagickCore::Image *)NULL);
5145 options()->fillColor(fill_);
5146 }
5147 else
5148 options()->fillPattern(fillPattern_->constImage());
5149
5150 GetPPException;
5151 (void) FloodfillPaintImage(image(),options()->drawInfo(),
5152 target_,static_cast<ssize_t>(x_),static_cast<ssize_t>(y_),
5153 (MagickBooleanType) invert_,exceptionInfo);
5154
5155 options()->fillColor(fillColor);
5156 options()->fillPattern(fillPattern);
5157 ThrowImageException;
5158 }
5159
5160 void Magick::Image::mask(const Magick::Image &mask_,const PixelMask type)
5161 {
5162 modifyImage();
5163
5164 GetPPException;
5165 if (mask_.isValid())
5166 SetImageMask(image(),type,mask_.constImage(),exceptionInfo);
5167 else
5168 SetImageMask(image(),type,(MagickCore::Image *) NULL,exceptionInfo);
5169 ThrowImageException;
5170 }
5171
5172 Magick::Image Magick::Image::mask(const PixelMask type) const
5173 {
5174 MagickCore::Image
5175 *image;
5176
5177 GetPPException;
5178 image = GetImageMask(constImage(),type,exceptionInfo);
5179 ThrowImageException;
5180
5181 if (image == (MagickCore::Image *) NULL)
5182 return(Magick::Image());
5183 else
5184 return(Magick::Image(image));
5185 }
Magick::Image::localContrast
void localContrast(const double radius_, const double strength_)
Definition: Image.cpp:3534
Magick::Image::density
Point density(void) const
Definition: Image.cpp:673
Magick::Image::gaussianBlur
void gaussianBlur(const double radius_, const double sigma_)
Definition: Image.cpp:3253
Magick::Image::swirl
void swirl(const double degrees_)
Definition: Image.cpp:4623
Magick::Color
class MagickPPExport Color
Definition: Color.h:18
Magick::borderGeometryDefault
MagickPPExport const char * borderGeometryDefault
Definition: Image.cpp:34
Magick::Image::morphology
void morphology(const MorphologyMethod method_, const std::string kernel_, const ssize_t iterations_=1)
Definition: Image.cpp:3636
Magick::Image::decipher
void decipher(const std::string &passphrase_)
Definition: Image.cpp:2689
Functions.h
Magick::Image::clip
void clip(void)
Definition: Image.cpp:2321
Magick::Image::scene
size_t scene(void) const
Definition: Image.cpp:1374
Magick::operator!=
MagickPPExport int operator!=(const Magick::Color &left_, const Magick::Color &right_)
Definition: Color.cpp:38
Magick::Image::moments
ImageMoments moments(void) const
Definition: Image.cpp:3631
Magick::Image::splice
void splice(const Geometry &geometry_)
Definition: Image.cpp:4526
Magick::Geometry::width
void width(size_t width_)
Definition: Geometry.cpp:399
RestorePPChannelMask
#define RestorePPChannelMask
Definition: Include.h:1573
Magick::Image::animationDelay
size_t animationDelay(void) const
Definition: Image.cpp:360
Magick::Image::resize
void resize(const Geometry &geometry_)
Definition: Image.cpp:4177
Magick::Image::adjoin
bool adjoin(void) const
Definition: Image.cpp:302
Magick::Image::writeMask
Image writeMask(void) const
Definition: Image.cpp:4978
Magick::Image::localContrastChannel
void localContrastChannel(const ChannelType channel_, const double radius_, const double strength_)
Definition: Image.cpp:3545
Magick::Image::brightnessContrastChannel
void brightnessContrastChannel(const ChannelType channel_, const double brightness_=0.0, const double contrast_=0.0)
Definition: Image.cpp:2156
Magick::Image::renderingIntent
RenderingIntent renderingIntent(void) const
Definition: Image.cpp:1334
Magick::Image::fontStyle
StyleType fontStyle(void) const
Definition: Image.cpp:891
Magick::DrawableAffine::ty
void ty(const double ty_)
Definition: Drawable.h:289
ImageRef.h
Magick::Image::~Image
virtual ~Image()
Definition: Image.cpp:268
Magick::Image::modulate
void modulate(const double brightness_, const double saturation_, const double hue_)
Definition: Image.cpp:3616
Magick::Image::strokeMiterLimit
size_t strokeMiterLimit(void) const
Definition: Image.cpp:1469
Magick::Image::annotate
void annotate(const std::string &text_, const Geometry &location_)
Definition: Image.cpp:1858
Magick::Image::transformSkewX
void transformSkewX(const double skewx_)
Definition: Image.cpp:1650
Magick::Blob::MallocAllocator
Definition: Blob.h:28
Magick::Image::virtualPixelMethod
VirtualPixelMethod virtualPixelMethod(void) const
Definition: Image.cpp:1698
Magick::Image::statistics
Magick::ImageStatistics statistics() const
Definition: Image.cpp:4566
Magick::Image::setColorMetric
bool setColorMetric(const Image &reference_)
Definition: Image.cpp:4370
Magick::Image::chromaGreenPrimary
void chromaGreenPrimary(const double x_, const double y_, const double z_)
Definition: Image.cpp:2255
Magick::Image::fx
void fx(const std::string expression_)
Definition: Image.cpp:3205
ThrowImageException
#define ThrowImageException
Definition: Image.cpp:32
Magick::Image::matteColor
Color matteColor(void) const
Definition: Image.cpp:349
Magick::Image::orientation
OrientationType orientation(void) const
Definition: Image.cpp:1230
Magick::Image::meanErrorPerPixel
double meanErrorPerPixel(void) const
Definition: Image.cpp:1166
Magick::Image::process
void process(std::string name_, const ::ssize_t argc_, const char **argv_)
Definition: Image.cpp:3960
Magick::Image::exifProfile
Blob exifProfile(void) const
Definition: Image.cpp:747
Magick::Image::adaptiveThreshold
void adaptiveThreshold(const size_t width_, const size_t height_, const double bias_=0.0)
Definition: Image.cpp:1782
Magick::Image::writePixels
void writePixels(const QuantumType quantum_, unsigned char *destination_)
Definition: Image.cpp:4983
Magick::Image::charcoal
void charcoal(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:2200
Magick::Image::endian
EndianType endian(void) const
Definition: Image.cpp:724
Magick::Image::getConstPixels
const Quantum * getConstPixels(const ::ssize_t x_, const ::ssize_t y_, const size_t columns_, const size_t rows_) const
Definition: Image.cpp:3278
Magick::Image::blur
void blur(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:2107
Magick::Image::borderColor
Color borderColor(void) const
Definition: Image.cpp:441
Magick::Image::label
std::string label(void) const
Definition: Image.cpp:1107
Magick::Image::contrast
void contrast(const bool sharpen_)
Definition: Image.cpp:2597
Magick::Image::profile
void profile(const std::string name_, const Blob &colorProfile_)
Definition: Image.cpp:3971
Magick::Image::iccColorProfile
Blob iccColorProfile(void) const
Definition: Image.cpp:1001
Magick::Error
Definition: Exception.h:66
Magick::Image::constImage
const MagickCore::Image * constImage(void) const
Definition: Image.cpp:5029
Magick::Image::medianFilter
void medianFilter(const double radius_=0.0)
Definition: Image.cpp:3593
Magick::Image::enhance
void enhance(void)
Definition: Image.cpp:2877
Magick::Image::subRange
size_t subRange(void) const
Definition: Image.cpp:1540
Magick::Geometry::height
void height(size_t height_)
Definition: Geometry.cpp:359
Magick::Image::chop
void chop(const Geometry &geometry_)
Definition: Image.cpp:2225
Magick::raiseGeometryDefault
MagickPPExport const char * raiseGeometryDefault
Definition: Image.cpp:36
Magick::Image::composite
void composite(const Image &compositeImage_, const Geometry &offset_, const CompositeOperator compose_=InCompositeOp)
Definition: Image.cpp:2535
Magick::Image::liquidRescale
void liquidRescale(const Geometry &geometry_)
Definition: Image.cpp:3512
Magick::Image::unsharpmask
void unsharpmask(const double radius_, const double sigma_, const double amount_, const double threshold_)
Definition: Image.cpp:4811
Magick::ImagePerceptualHash
Definition: Statistic.h:244
Magick::Image::textUnderColor
Color textUnderColor(void) const
Definition: Image.cpp:1628
Magick::Point
Definition: Geometry.h:208
DegreesToRadians
#define DegreesToRadians(x)
Definition: Image.cpp:31
Magick::Image::readPixels
void readPixels(const QuantumType quantum_, const unsigned char *source_)
Definition: Image.cpp:4124
Magick::Image::negate
void negate(const bool grayscale_=false)
Definition: Image.cpp:3745
Magick::Image::connectedComponents
void connectedComponents(const size_t connectivity_)
Definition: Image.cpp:2585
Magick::Options
Definition: Options.h:30
Magick::Image::raise
void raise(const Geometry &geometry_=raiseGeometryDefault, const bool raisedFlag_=false)
Definition: Image.cpp:4008
Magick::Image::sparseColor
void sparseColor(const ChannelType channel_, const SparseColorMethod method_, const size_t numberArguments_, const double *arguments_)
Definition: Image.cpp:4510
Magick::Image::clutChannel
void clutChannel(const ChannelType channel_, const Image &clutImage_, const PixelInterpolateMethod method)
Definition: Image.cpp:2347
Magick::Image::whiteThreshold
void whiteThreshold(const std::string &threshold_)
Definition: Image.cpp:4877
Magick::ImageMoments
Definition: Statistic.h:219
Magick::Image::directory
std::string directory(void) const
Definition: Image.cpp:705
Magick::Image::crop
void crop(const Geometry &geometry_)
Definition: Image.cpp:2667
Magick::Image::adaptiveResize
void adaptiveResize(const Geometry &geometry_)
Definition: Image.cpp:1735
Magick::Image::type
ImageType type(void) const
Definition: Image.cpp:1662
Magick::Image::alpha
bool alpha(void) const
Definition: Image.cpp:323
Magick::Image::backgroundTexture
std::string backgroundTexture(void) const
Definition: Image.cpp:399
Magick::Image::font
std::string font(void) const
Definition: Image.cpp:858
Magick::Point::isValid
bool isValid() const
Definition: Geometry.cpp:698
Magick::DrawableAffine::tx
void tx(const double tx_)
Definition: Drawable.h:280
Magick::Image::clipPath
void clipPath(const std::string pathname_, const bool inside_)
Definition: Image.cpp:2329
Magick::Image::posterizeChannel
void posterizeChannel(const ChannelType channel_, const size_t levels_, const DitherMethod method_)
Definition: Image.cpp:3949
Magick::Image::quality
size_t quality(void) const
Definition: Image.cpp:1255
Magick::Image::defineValue
void defineValue(const std::string &magick_, const std::string &key_, const std::string &value_)
Definition: Image.cpp:2727
Magick::Image::vignette
void vignette(const double radius_=0.0, const double sigma_=1.0, const ssize_t x_=0, const ssize_t y_=0)
Definition: Image.cpp:4840
Magick::Image::comment
std::string comment(void) const
Definition: Image.cpp:605
Magick::Image::separate
Image separate(const ChannelType channel_) const
Definition: Image.cpp:4345
Magick::Image::textAntiAlias
bool textAntiAlias(void) const
Definition: Image.cpp:1551
Magick::Image::magick
std::string magick(void) const
Definition: Image.cpp:1149
Magick::Image::shade
void shade(const double azimuth_=30, const double elevation_=30, const bool colorShading_=false)
Definition: Image.cpp:4399
std
STL namespace.
Magick::Image::modulusDepth
size_t modulusDepth(void) const
Definition: Image.cpp:1180
Magick::Image::waveletDenoise
void waveletDenoise(const double threshold_, const double softness_)
Definition: Image.cpp:4864
Magick::Image::operator=
Image & operator=(const Image &image_)
Definition: Image.cpp:282
Magick::ImageRef
Definition: ImageRef.h:28
Magick::Image::write
void write(Blob *blob_)
Definition: Image.cpp:4896
Magick::Image::meanShift
void meanShift(const size_t width_, const size_t height_, const double color_distance_)
Definition: Image.cpp:3580
Magick::Image::kuwaharaChannel
void kuwaharaChannel(const ChannelType channel_, const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:3413
Magick::Image::fileSize
MagickSizeType fileSize(void) const
Definition: Image.cpp:781
Magick::Image::equalize
void equalize(void)
Definition: Image.cpp:2888
Magick::Image::zoom
void zoom(const Geometry &geometry_)
Definition: Image.cpp:4997
Magick::Image::autoThreshold
void autoThreshold(const AutoThresholdMethod method_)
Definition: Image.cpp:2069
Magick::Image::blurChannel
void blurChannel(const ChannelType channel_, const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:2118
Magick::Image::morphologyChannel
void morphologyChannel(const ChannelType channel_, const MorphologyMethod method_, const std::string kernel_, const ssize_t iterations_=1)
Definition: Image.cpp:3680
Magick::Image::highlightColor
void highlightColor(const Color color_)
Definition: Image.cpp:987
Magick::Image::fileName
std::string fileName(void) const
Definition: Image.cpp:776
Magick::Image::colorSpace
ColorspaceType colorSpace(void) const
Definition: Image.cpp:571
Magick::Image::constOptions
const Options * constOptions(void) const
Definition: Image.cpp:5049
Magick::operator<
MagickPPExport int operator<(const Magick::Color &left_, const Magick::Color &right_)
Definition: Color.cpp:50
Magick::Image::quantizeColors
size_t quantizeColors(void) const
Definition: Image.cpp:1266
Magick::Geometry::yOff
void yOff(::ssize_t yOff_)
Definition: Geometry.cpp:430
Magick::Image::uniqueColors
Image uniqueColors(void) const
Definition: Image.cpp:4797
Magick::Image::readMask
Image readMask(void) const
Definition: Image.cpp:4119
Magick::Image::constImageInfo
const MagickCore::ImageInfo * constImageInfo(void) const
Definition: Image.cpp:5039
Magick::Image::posterize
void posterize(const size_t levels_, const DitherMethod method_)
Definition: Image.cpp:3941
Magick::Image::rotationalBlurChannel
void rotationalBlurChannel(const ChannelType channel_, const double angle_)
Definition: Image.cpp:4247
Magick::Image::adaptiveSharpen
void adaptiveSharpen(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:1757
Magick::Image::fontFamily
std::string fontFamily(void) const
Definition: Image.cpp:869
Magick::Image::oilPaint
void oilPaint(const double radius_=0.0, const double sigma=1.0)
Definition: Image.cpp:3772
Magick::Image::contrastStretchChannel
void contrastStretchChannel(const ChannelType channel_, const double blackPoint_, const double whitePoint_)
Definition: Image.cpp:2614
Magick::Image::replaceImage
MagickCore::Image * replaceImage(MagickCore::Image *replacement_)
Definition: Image.cpp:5074
Magick::Image::floodFillTexture
void floodFillTexture(const Geometry &point_, const Image &texture_, const bool invert_=false)
Definition: Image.cpp:3082
Magick::Image::transformScale
void transformScale(const double sx_, const double sy_)
Definition: Image.cpp:4707
Magick::Image::fillRule
FillRule fillRule(void) const
Definition: Image.cpp:803
Magick::Image::encipher
void encipher(const std::string &passphrase_)
Definition: Image.cpp:2869
Magick::Image::spread
void spread(const double amount_=3.0)
Definition: Image.cpp:4555
Magick::Image::compressType
CompressionType compressType(void) const
Definition: Image.cpp:637
Magick::Image::verbose
bool verbose(void) const
Definition: Image.cpp:1684
Magick::Image::compareChannel
double compareChannel(const ChannelType channel_, const Image &reference_, const MetricType metric_)
Definition: Image.cpp:2486
Magick::Image::linearStretch
void linearStretch(const double blackPoint_, const double whitePoint_)
Definition: Image.cpp:3503
Magick::Image::randomThresholdChannel
void randomThresholdChannel(const ChannelType channel_, const double low_, const double high_)
Definition: Image.cpp:4027
Magick::Image::quantizeTreeDepth
size_t quantizeTreeDepth(void) const
Definition: Image.cpp:1311
Magick::Image::extent
void extent(const Geometry &geometry_)
Definition: Image.cpp:2953
Magick::Image::colorMatrix
void colorMatrix(const size_t order_, const double *color_matrix_)
Definition: Image.cpp:2430
Magick::Image::pixelColor
void pixelColor(const ::ssize_t x_, const ::ssize_t y_, const Color &color_)
Magick::Image::baseFilename
std::string baseFilename(void) const
Definition: Image.cpp:409
Magick::Image::strokePattern
Image strokePattern(void) const
Definition: Image.cpp:1483
Magick::Image::fontTypeMetricsMultiline
void fontTypeMetricsMultiline(const std::string &text_, TypeMetric *metrics)
Definition: Image.cpp:3146
Magick::Image::page
Geometry page(void) const
Definition: Image.cpp:1242
Magick::Image::motionBlur
void motionBlur(const double radius_, const double sigma_, const double angle_)
Definition: Image.cpp:3733
Magick::Image::debug
bool debug(void) const
Definition: Image.cpp:648
Magick::Image::perceptibleChannel
void perceptibleChannel(const ChannelType channel_, const double epsilon_)
Definition: Image.cpp:3843
Magick::Image::emboss
void emboss(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:2858
Magick::Image::magnify
void magnify(void)
Definition: Image.cpp:3559
Magick::Image::identifyType
ImageType identifyType(void) const
Definition: Image.cpp:3361
Magick::Image::polaroid
void polaroid(const std::string &caption_, const double angle_, const PixelInterpolateMethod method_)
Definition: Image.cpp:3928
Magick::Image::levelColors
void levelColors(const Color &blackColor_, const Color &whiteColor_, const bool invert_=true)
Definition: Image.cpp:3447
Magick::Image::segment
void segment(const double clusterThreshold_=1.0, const double smoothingThreshold_=1.5)
Definition: Image.cpp:4305
Magick::Image::grayscale
void grayscale(const PixelIntensityMethod method_)
Definition: Image.cpp:3332
Magick::Image::reduceNoise
void reduceNoise(void)
Definition: Image.cpp:4138
Magick::Image::clampChannel
void clampChannel(const ChannelType channel_)
Definition: Image.cpp:2311
Magick::Image::strokeDashOffset
double strokeDashOffset(void) const
Definition: Image.cpp:1436
Magick::Image::channelDepth
void channelDepth(const ChannelType channel_, const size_t depth_)
Definition: Image.cpp:468
Magick::Image::orderedDither
void orderedDither(std::string thresholdMap_)
Definition: Image.cpp:3816
Magick::Image::quantizeDitherMethod
DitherMethod quantizeDitherMethod(void) const
Definition: Image.cpp:1300
Magick::Pixels
Definition: Pixels.h:20
Magick::Image::stegano
void stegano(const Image &watermark_)
Definition: Image.cpp:4571
Magick::Image::sharpen
void sharpen(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:4425
Magick::Image::subImage
size_t subImage(void) const
Definition: Image.cpp:1529
Magick::Image::resample
void resample(const Point &density_)
Definition: Image.cpp:4165
Magick::Image::image
MagickCore::Image *& image(void)
Definition: Image.cpp:5024
Magick::Image::floodFillAlpha
void floodFillAlpha(const ::ssize_t x_, const ::ssize_t y_, const unsigned int alpha_, const bool invert_=false)
Magick::Image::isOpaque
bool isOpaque(void) const
Definition: Image.cpp:1065
Magick::Image::trim
void trim(void)
Definition: Image.cpp:4786
Magick::Image::depth
size_t depth(void) const
Definition: Image.cpp:700
Image.h
Magick::operator<=
MagickPPExport int operator<=(const Magick::Color &left_, const Magick::Color &right_)
Definition: Color.cpp:72
Magick::Image::solarize
void solarize(const double factor_=50.0)
Definition: Image.cpp:4502
Magick::Image::fontPointsize
double fontPointsize(void) const
Definition: Image.cpp:880
Magick::Blob::updateNoCopy
void updateNoCopy(void *data_, const size_t length_, const Allocator allocator_=NewAllocator)
Definition: Blob.cpp:123
Magick::operator>=
MagickPPExport int operator>=(const Magick::Color &left_, const Magick::Color &right_)
Definition: Color.cpp:66
Magick::Image::stereo
void stereo(const Image &rightImage_)
Definition: Image.cpp:4582
Magick::Image::defineSet
void defineSet(const std::string &magick_, const std::string &key_, bool flag_)
Definition: Image.cpp:2697
Magick::Image::quantize
void quantize(const bool measureError_=false)
Definition: Image.cpp:3994
Magick::Image::read
void read(const Blob &blob_)
Definition: Image.cpp:4038
Magick::Image::autoGammaChannel
void autoGammaChannel(const ChannelType channel_)
Definition: Image.cpp:2025
Magick::Image::frame
void frame(const Geometry &geometry_=frameGeometryDefault)
Definition: Image.cpp:3162
Magick::Image::orderedDitherChannel
void orderedDitherChannel(const ChannelType channel_, std::string thresholdMap_)
Definition: Image.cpp:3824
Magick::Blob
Definition: Blob.h:22
ThrowPPDrawException
#define ThrowPPDrawException(quiet)
Definition: Include.h:1577
Magick::Image::iptcProfile
Blob iptcProfile(void) const
Definition: Image.cpp:1053
Magick::Image::Image
Image(void)
Definition: Image.cpp:79
Magick::Image::getPixels
Quantum * getPixels(const ::ssize_t x_, const ::ssize_t y_, const size_t columns_, const size_t rows_)
Definition: Image.cpp:3318
Magick::Image::flip
void flip(void)
Definition: Image.cpp:2997
Magick::Image::strokeLineCap
LineCap strokeLineCap(void) const
Definition: Image.cpp:1447
Magick::Image::shave
void shave(const Geometry &geometry_)
Definition: Image.cpp:4450
Magick::Image::textEncoding
std::string textEncoding(void) const
Definition: Image.cpp:1573
MagickPPExport
#define MagickPPExport
Definition: Include.h:297
Magick::Image::tint
void tint(const std::string opacity_)
Definition: Image.cpp:4680
Magick::Image::perceptible
void perceptible(const double epsilon_)
Definition: Image.cpp:3835
Magick::Image::blackThreshold
void blackThreshold(const std::string &threshold_)
Definition: Image.cpp:2077
Magick::Image::isValid
bool isValid(void) const
Definition: Image.cpp:1092
Magick::Image::erase
void erase(void)
Definition: Image.cpp:2896
Magick::Geometry
class MagickPPExport Geometry
Definition: Geometry.h:21
Magick::Image::sharpenChannel
void sharpenChannel(const ChannelType channel_, const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:4436
Magick::Image::filterType
FilterType filterType(void) const
Definition: Image.cpp:847
Magick::Image::xResolution
double xResolution(void) const
Definition: Image.cpp:1714
Magick::Offset
Definition: Geometry.h:151
Magick::Image::quantizeDither
bool quantizeDither(void) const
Definition: Image.cpp:1289
Magick::Image::interlaceType
InterlaceType interlaceType(void) const
Definition: Image.cpp:1020
Magick::Image::fillPattern
void fillPattern(const Image &fillPattern_)
Definition: Image.cpp:808
Magick::Image::getConstMetacontent
const void * getConstMetacontent(void) const
Definition: Image.cpp:3290
Magick::Exception
Definition: Exception.h:24
Magick::Image::format
std::string format(void) const
Definition: Image.cpp:907
Magick::Image::blackThresholdChannel
void blackThresholdChannel(const ChannelType channel_, const std::string &threshold_)
Definition: Image.cpp:2085
Magick::Image::edge
void edge(const double radius_=0.0)
Definition: Image.cpp:2847
Magick::Image::colorMapSize
size_t colorMapSize(void) const
Definition: Image.cpp:551
Magick::Image::kuwahara
void kuwahara(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:3402
Magick::Image::signature
std::string signature(const bool force_=false) const
Definition: Image.cpp:4485
Magick::Image::texture
void texture(const Image &texture_)
Definition: Image.cpp:4642
Magick::Geometry::xOff
void xOff(::ssize_t xOff_)
Definition: Geometry.cpp:420
Magick::Image::sepiaTone
void sepiaTone(const double threshold_)
Definition: Image.cpp:4359
Magick::Image::totalColors
size_t totalColors(void) const
Definition: Image.cpp:1633
Magick::Image::interpolate
PixelInterpolateMethod interpolate(void) const
Definition: Image.cpp:1031
Magick::Image::transparentChroma
void transparentChroma(const Color &colorLow_, const Color &colorHigh_)
Definition: Image.cpp:4735
Magick::DrawableAffine::sy
void sy(const double sy_)
Definition: Drawable.h:253
Magick::Image::shadow
void shadow(const double percentAlpha_=80.0, const double sigma_=0.5, const ssize_t x_=5, const ssize_t y_=5)
Definition: Image.cpp:4412
Magick::Image::whiteThresholdChannel
void whiteThresholdChannel(const ChannelType channel_, const std::string &threshold_)
Definition: Image.cpp:4885
Magick::Image::minify
void minify(void)
Definition: Image.cpp:3605
Magick::Image::syncPixels
void syncPixels(void)
Definition: Image.cpp:4635
Magick::Image::scale
void scale(const Geometry &geometry_)
Definition: Image.cpp:4283
Magick::Image::imageInfo
MagickCore::ImageInfo * imageInfo(void)
Definition: Image.cpp:5034
Magick::Image::subImageSearch
Image subImageSearch(const Image &reference_, const MetricType metric_, Geometry *offset_, double *similarityMetric_, const double similarityThreshold=(-1.0))
Definition: Image.cpp:4601
Magick::Image::unsharpmaskChannel
void unsharpmaskChannel(const ChannelType channel_, const double radius_, const double sigma_, const double amount_, const double threshold_)
Definition: Image.cpp:4824
Magick::Image::transformRotation
void transformRotation(const double angle_)
Definition: Image.cpp:1644
Magick::Image::artifact
void artifact(const std::string &name_, const std::string &value_)
Definition: Image.cpp:1968
Magick::Image::textKerning
double textKerning(void) const
Definition: Image.cpp:1617
Magick::Image::colorFuzz
double colorFuzz(void) const
Definition: Image.cpp:534
Magick::Color
Definition: Color.h:36
Magick::Image::transverse
void transverse(void)
Definition: Image.cpp:4775
Magick::DrawableAffine::sx
void sx(const double sx_)
Definition: Drawable.h:244
Magick::Image::cannyEdge
void cannyEdge(const double radius_=0.0, const double sigma_=1.0, const double lowerPercent_=0.1, const double upperPercent_=0.3)
Definition: Image.cpp:2167
Magick::frameGeometryDefault
MagickPPExport const char * frameGeometryDefault
Definition: Image.cpp:35
Magick::Image::constQuantizeInfo
const MagickCore::QuantizeInfo * constQuantizeInfo(void) const
Definition: Image.cpp:5059
Magick::DrawableAffine
Definition: Drawable.h:226
Magick::Image::draw
void draw(const Drawable &drawable_)
Definition: Image.cpp:2798
Magick::Image::randomThreshold
void randomThreshold(const double low_, const double high_)
Definition: Image.cpp:4020
Magick::throwExceptionExplicit
MagickPPExport void throwExceptionExplicit(const MagickCore::ExceptionType severity_, const char *reason_, const char *description_=(char *) NULL)
Definition: Exception.cpp:808
Magick::Image::evaluate
void evaluate(const ChannelType channel_, const MagickEvaluateOperator operator_, double rvalue_)
Definition: Image.cpp:2904
Magick::Geometry
Definition: Geometry.h:37
Magick::Image::rotationalBlur
void rotationalBlur(const double angle_)
Definition: Image.cpp:4236
Magick::Image::colorSpaceType
ColorspaceType colorSpaceType(void) const
Definition: Image.cpp:585
Magick::Image::boundingBox
Geometry boundingBox(void) const
Definition: Image.cpp:446
Magick::Image::implode
void implode(const double factor_)
Definition: Image.cpp:3372
Magick::Image::samplingFactor
std::string samplingFactor(void) const
Definition: Image.cpp:1363
Magick::Image::addNoiseChannel
void addNoiseChannel(const ChannelType channel_, const NoiseType noiseType_, const double attenuate_=1.0)
Definition: Image.cpp:1807
Magick::Image::strokeColor
Color strokeColor(void) const
Definition: Image.cpp:1414
Magick::Image::normalizedMeanError
double normalizedMeanError(void) const
Definition: Image.cpp:1219
ClonePPDrawException
#define ClonePPDrawException(wand)
Definition: Include.h:1569
Magick::Image::masklightColor
void masklightColor(const Color color_)
Definition: Image.cpp:1157
Magick::Image::chromaBluePrimary
void chromaBluePrimary(const double x_, const double y_, const double z_)
Definition: Image.cpp:2239
Magick::Image::clamp
void clamp(void)
Definition: Image.cpp:2303
Magick::Image::strokeDashArray
const double * strokeDashArray(void) const
Definition: Image.cpp:1425
Magick::Image::levelize
void levelize(const double blackPoint_, const double whitePoint_, const double gamma_=1.0)
Definition: Image.cpp:3483
Magick::Image::adaptiveSharpenChannel
void adaptiveSharpenChannel(const ChannelType channel_, const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:1768
Magick::Image::wave
void wave(const double amplitude_=25.0, const double wavelength_=150.0)
Definition: Image.cpp:4852
Magick::Image::gamma
double gamma(void) const
Definition: Image.cpp:947
Magick::Image::threshold
void threshold(const double threshold_)
Definition: Image.cpp:4650
Magick::Image::convolve
void convolve(const size_t order_, const double *kernel_)
Definition: Image.cpp:2625
Magick::Image::roll
void roll(const Geometry &roll_)
Definition: Image.cpp:4202
Magick::DrawableAffine::rx
void rx(const double rx_)
Definition: Drawable.h:262
Magick::Image::yResolution
double yResolution(void) const
Definition: Image.cpp:1719
Options.h
Magick::Image::strip
void strip(void)
Definition: Image.cpp:4593
Magick::ImageRef::increase
void increase()
Definition: ImageRef.cpp:73
Magick::Image::gaussianBlurChannel
void gaussianBlurChannel(const ChannelType channel_, const double radius_, const double sigma_)
Definition: Image.cpp:3264
Magick::Image::thumbnail
void thumbnail(const Geometry &geometry_)
Definition: Image.cpp:4658
Magick::Image::alphaChannel
void alphaChannel(AlphaChannelOption alphaOption_)
Definition: Image.cpp:1850
Magick::Image::compose
CompositeOperator compose(void) const
Definition: Image.cpp:625
Magick::Image::blackPointCompensation
bool blackPointCompensation(void) const
Definition: Image.cpp:424
Magick::Image::adaptiveBlur
void adaptiveBlur(const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:1724
Magick::Image::display
void display(void)
Definition: Image.cpp:2778
Magick::Image::ping
void ping(const std::string &imageSpec_)
Definition: Image.cpp:3859
Magick::Image::selectiveBlur
void selectiveBlur(const double radius_, const double sigma_, const double threshold_)
Definition: Image.cpp:4317
Magick::Image::autoOrient
void autoOrient(void)
Definition: Image.cpp:2054
Magick::Image::transparent
void transparent(const Color &color_, const bool inverse_=false)
Definition: Image.cpp:4713
Include.h
Magick::Image::inverseFourierTransform
void inverseFourierTransform(const Image &phase_)
Definition: Image.cpp:3384
Magick::Image::colorize
void colorize(const unsigned int alpha_, const Color &penColor_)
Definition: Image.cpp:2358
Magick::Point::x
double x(void) const
Definition: Geometry.cpp:703
Magick::Image::textDirection
DirectionType textDirection() const
Definition: Image.cpp:1562
GetAndSetPPChannelMask
#define GetAndSetPPChannelMask(channel)
Definition: Include.h:1565
Magick::Image::cdl
void cdl(const std::string &cdl_)
Definition: Image.cpp:2181
Magick::Image::geometry
Geometry geometry(void) const
Definition: Image.cpp:952
Magick::Image::animationIterations
size_t animationIterations(void) const
Definition: Image.cpp:371
Magick::Image::distort
void distort(const DistortMethod method_, const size_t numberArguments_, const double *arguments_, const bool bestfit_=false)
Definition: Image.cpp:2785
Magick::Image::isValid
void isValid(const bool isValid_)
Definition: Image.cpp:1076
Magick::Image::border
void border(const Geometry &geometry_=borderGeometryDefault)
Definition: Image.cpp:2132
Magick::Image::addNoise
void addNoise(const NoiseType noiseType_, const double attenuate_=1.0)
Definition: Image.cpp:1796
Magick::Image::backgroundColor
Color backgroundColor(void) const
Definition: Image.cpp:388
Magick::Image::sample
void sample(const Geometry &geometry_)
Definition: Image.cpp:4261
Magick::Image::clut
void clut(const Image &clutImage_, const PixelInterpolateMethod method)
Definition: Image.cpp:2338
Magick::Image::affineTransform
void affineTransform(const DrawableAffine &affine)
Definition: Image.cpp:1821
Magick::Image::normalizedMaxError
double normalizedMaxError(void) const
Definition: Image.cpp:1214
Magick::Image::rows
size_t rows(void) const
Definition: Image.cpp:1352
Magick::Color::isValid
void isValid(const bool valid_)
Definition: Color.cpp:301
Magick::Image::columns
size_t columns(void) const
Definition: Image.cpp:590
Magick::Image::perceptualHash
Magick::ImagePerceptualHash perceptualHash() const
Definition: Image.cpp:3854
Magick::Image::attribute
void attribute(const std::string name_, const char *value_)
Definition: Image.cpp:1985
Magick::Image::houghLine
void houghLine(const size_t width_, const size_t height_, const size_t threshold_=40)
Definition: Image.cpp:3348
Magick::Image::levelizeChannel
void levelizeChannel(const ChannelType channel_, const double blackPoint_, const double whitePoint_, const double gamma_=1.0)
Definition: Image.cpp:3492
Magick::Image::fillColor
Color fillColor(void) const
Definition: Image.cpp:792
Magick::Image::montageGeometry
Geometry montageGeometry(void) const
Definition: Image.cpp:1202
Magick::Image::sketch
void sketch(const double radius_=0.0, const double sigma_=1.0, const double angle_=0.0)
Definition: Image.cpp:4490
Magick::Point::y
double y(void) const
Definition: Geometry.cpp:708
Magick::Blob::data
const void * data(void) const
Definition: Blob.cpp:105
Magick::Image::fillPattern
Image fillPattern(void) const
Definition: Image.cpp:817
Magick::ImageStatistics
Definition: Statistic.h:282
Magick::Image::formatExpression
std::string formatExpression(const std::string expression)
Definition: Image.cpp:926
Magick::Image::strokeLineJoin
LineJoin strokeLineJoin(void) const
Definition: Image.cpp:1458
Magick::Drawable
Definition: Drawable.h:120
Magick::Image::blueShift
void blueShift(const double factor_=1.5)
Definition: Image.cpp:2096
Magick::ImageRef::replaceImage
static ImageRef * replaceImage(ImageRef *imgRef, MagickCore::Image *replacement_)
Definition: ImageRef.cpp:102
Magick::DrawableAffine::ry
void ry(const double ry_)
Definition: Drawable.h:271
Pixels.h
Magick::Image::chromaRedPrimary
void chromaRedPrimary(const double x_, const double y_, const double z_)
Definition: Image.cpp:2271
Magick::Image::baseColumns
size_t baseColumns(void) const
Definition: Image.cpp:404
Magick::Image::textInterwordSpacing
double textInterwordSpacing(void) const
Definition: Image.cpp:1606
Magick::operator>
MagickPPExport int operator>(const Magick::Color &left_, const Magick::Color &right_)
Definition: Color.cpp:44
Magick::Image::transpose
void transpose(void)
Definition: Image.cpp:4764
Magick::operator==
MagickPPExport int operator==(const Magick::Color &left_, const Magick::Color &right_)
Definition: Color.cpp:22
Magick::Image::quiet
bool quiet(void) const
Definition: Image.cpp:1322
Magick::Image::resolutionUnits
ResolutionType resolutionUnits(void) const
Definition: Image.cpp:1347
Magick::Point
class MagickPPExport Point
Definition: Geometry.h:200
Magick::Image::setPixels
Quantum * setPixels(const ::ssize_t x_, const ::ssize_t y_, const size_t columns_, const size_t rows_)
Definition: Image.cpp:4386
Magick::Image
class MagickPPExport Image
Definition: Drawable.h:722
Magick::Image::chromaWhitePoint
void chromaWhitePoint(const double x_, const double y_, const double z_)
Definition: Image.cpp:2287
Magick::Image::autoLevelChannel
void autoLevelChannel(const ChannelType channel_)
Definition: Image.cpp:2044
Magick::Image::negateChannel
void negateChannel(const ChannelType channel_, const bool grayscale_=false)
Definition: Image.cpp:3753
Magick::Image::x11Display
std::string x11Display(void) const
Definition: Image.cpp:1709
Magick::Image::fontWeight
size_t fontWeight(void) const
Definition: Image.cpp:902
Magick::Image::repage
void repage()
Definition: Image.cpp:4155
Magick::Image::textInterlineSpacing
double textInterlineSpacing(void) const
Definition: Image.cpp:1595
Magick::Image::textGravity
GravityType textGravity() const
Definition: Image.cpp:1584
Magick::Image::brightnessContrast
void brightnessContrast(const double brightness_=0.0, const double contrast_=0.0)
Definition: Image.cpp:2147
Magick::Image::quantizeInfo
MagickCore::QuantizeInfo * quantizeInfo(void)
Definition: Image.cpp:5054
Magick::Blob::length
size_t length(void) const
Definition: Blob.cpp:110
Magick::Image::floodFillColor
void floodFillColor(const Geometry &point_, const Color &fillColor_, const bool invert_=false)
Definition: Image.cpp:3044
Magick::Image::flop
void flop(void)
Definition: Image.cpp:3120
Magick::Image::classType
ClassType classType(void) const
Definition: Image.cpp:522
Magick::Image::levelChannel
void levelChannel(const ChannelType channel_, const double blackPoint_, const double whitePoint_, const double gamma_=1.0)
Definition: Image.cpp:3436
Magick::Image::despeckle
void despeckle(void)
Definition: Image.cpp:2767
Magick::Image::sigmoidalContrast
void sigmoidalContrast(const bool sharpen_, const double contrast, const double midpoint=QuantumRange/2.0)
Definition: Image.cpp:4475
Magick::Image::channel
void channel(const ChannelType channel_)
Definition: Image.cpp:2189
Magick::Image::strokePattern
void strokePattern(const Image &strokePattern_)
Definition: Image.cpp:1474
Magick::Image::normalize
void normalize(void)
Definition: Image.cpp:3764
Magick::Image::getMetacontent
void * getMetacontent(void)
Definition: Image.cpp:3304
Magick::ImageRef::options
void options(Options *options_)
Definition: ImageRef.cpp:91
Magick::Image::charcoalChannel
void charcoalChannel(const ChannelType channel_, const double radius_=0.0, const double sigma_=1.0)
Definition: Image.cpp:2211
GetPPException
#define GetPPException
Definition: Include.h:1561
Magick::Image::hasChannel
bool hasChannel(const PixelChannel channel) const
Definition: Image.cpp:976
Magick::Image::deskew
void deskew(const double threshold_)
Definition: Image.cpp:2756
Magick::Image::baseRows
size_t baseRows(void) const
Definition: Image.cpp:414
Magick::Image::fontTypeMetrics
void fontTypeMetrics(const std::string &text_, TypeMetric *metrics)
Definition: Image.cpp:3131
Magick::Image::transformOrigin
void transformOrigin(const double x_, const double y_)
Definition: Image.cpp:4695
Magick::Image::opaque
void opaque(const Color &opaqueColor_, const Color &penColor_, const bool invert_=false)
Definition: Image.cpp:3783
Magick::Image::colorMap
void colorMap(const size_t index_, const Color &color_)
Definition: Image.cpp:2390
Magick::Image::strokeWidth
double strokeWidth(void) const
Definition: Image.cpp:1518
Magick::Image
Definition: Image.h:55
Magick::Geometry::isValid
void isValid(bool isValid_)
Definition: Geometry.cpp:369
Magick::Image::copyPixels
void copyPixels(const Image &source_, const Geometry &geometry_, const Offset &offset_)
Definition: Image.cpp:2652
Magick::Image::quantizeColorSpace
ColorspaceType quantizeColorSpace(void) const
Definition: Image.cpp:1278
Magick::Image::autoGamma
void autoGamma(void)
Definition: Image.cpp:2016
Magick::Image::channels
size_t channels() const
Definition: Image.cpp:492
Magick::TypeMetric
Definition: TypeMetric.h:21
Magick::Image::monochrome
bool monochrome(void) const
Definition: Image.cpp:1197
Magick::Image::cycleColormap
void cycleColormap(const ::ssize_t amount_)
Definition: Image.cpp:2681
Magick::Image::level
void level(const double blackPoint_, const double whitePoint_, const double gamma_=1.0)
Definition: Image.cpp:3427
Magick::Image::options
Options * options(void)
Definition: Image.cpp:5044
Magick::cropImage
Definition: STL.h:312
Magick::Image::modifyImage
void modifyImage(void)
Definition: Image.cpp:5064
Magick::Image::strokeAntiAlias
bool strokeAntiAlias(void) const
Definition: Image.cpp:1398
Magick::Image::compare
bool compare(const Image &reference_) const
Definition: Image.cpp:2459
Magick::Image::autoLevel
void autoLevel(void)
Definition: Image.cpp:2036
Magick::Image::contrastStretch
void contrastStretch(const double blackPoint_, const double whitePoint_)
Definition: Image.cpp:2605
Magick::Image::selectiveBlurChannel
void selectiveBlurChannel(const ChannelType channel_, const double radius_, const double sigma_, const double threshold_)
Definition: Image.cpp:4330
Magick::Image::levelColorsChannel
void levelColorsChannel(const ChannelType channel_, const Color &blackColor_, const Color &whiteColor_, const bool invert_=true)
Definition: Image.cpp:3464
Magick::Image::boxColor
Color boxColor(void) const
Definition: Image.cpp:463
Magick::Image::haldClut
void haldClut(const Image &clutImage_)
Definition: Image.cpp:3340
Magick::Image::transformSkewY
void transformSkewY(const double skewy_)
Definition: Image.cpp:1656
Magick::Image::shear
void shear(const double xShearAngle_, const double yShearAngle_)
Definition: Image.cpp:4464
SetPPChannelMask
#define SetPPChannelMask(channel)
Definition: Include.h:1575
Magick::Image::gifDisposeMethod
DisposeType gifDisposeMethod(void) const
Definition: Image.cpp:971
Magick::Image::size
Geometry size(void) const
Definition: Image.cpp:1387
Magick::Image::transformReset
void transformReset(void)
Definition: Image.cpp:4701
Magick::Image::rotate
void rotate(const double degrees_)
Definition: Image.cpp:4225
Magick::Image::map
void map(const Image &mapImage_, const bool dither_=false)
Definition: Image.cpp:3570
Magick::Image::lowlightColor
void lowlightColor(const Color color_)
Definition: Image.cpp:1122