2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % PPPP IIIII X X EEEEE L %
10 % P IIIII X X EEEEE LLLLL %
14 % W W W AAAAA N N N D D %
15 % WW WW A A N NN D D %
19 % MagickWand Image Pixel Wand Methods %
26 % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "MagickWand/studio.h"
50 #include "MagickWand/MagickWand.h"
51 #include "MagickWand/magick-wand-private.h"
52 #include "MagickWand/pixel-wand-private.h"
53 #include "MagickWand/wand.h"
58 #define PixelWandId "PixelWand"
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92 % C l e a r P i x e l W a n d %
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 % ClearPixelWand() clears resources associated with the wand.
100 % The format of the ClearPixelWand method is:
102 % void ClearPixelWand(PixelWand *wand)
104 % A description of each parameter follows:
106 % o wand: the pixel wand.
109 WandExport void ClearPixelWand(PixelWand *wand)
111 assert(wand != (PixelWand *) NULL);
112 assert(wand->signature == WandSignature);
113 if (wand->debug != MagickFalse)
114 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
115 ClearMagickException(wand->exception);
116 wand->pixel.colorspace=RGBColorspace;
117 wand->debug=IsEventLogging();
121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125 % C l o n e P i x e l W a n d %
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
131 % ClonePixelWand() makes an exact copy of the specified wand.
133 % The format of the ClonePixelWand method is:
135 % PixelWand *ClonePixelWand(const PixelWand *wand)
137 % A description of each parameter follows:
139 % o wand: the magick wand.
142 WandExport PixelWand *ClonePixelWand(const PixelWand *wand)
147 assert(wand != (PixelWand *) NULL);
148 assert(wand->signature == WandSignature);
149 if (wand->debug != MagickFalse)
150 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
151 clone_wand=(PixelWand *) AcquireMagickMemory(sizeof(*clone_wand));
152 if (clone_wand == (PixelWand *) NULL)
153 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
155 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
156 clone_wand->id=AcquireWandId();
157 (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g",
158 PixelWandId,(double) clone_wand->id);
159 clone_wand->exception=AcquireExceptionInfo();
160 InheritException(clone_wand->exception,wand->exception);
161 clone_wand->pixel=wand->pixel;
162 clone_wand->count=wand->count;
163 clone_wand->debug=IsEventLogging();
164 if (clone_wand->debug != MagickFalse)
165 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
166 clone_wand->signature=WandSignature;
171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
175 % C l o n e P i x e l W a n d s %
179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 % ClonePixelWands() makes an exact copy of the specified wands.
183 % The format of the ClonePixelWands method is:
185 % PixelWand **ClonePixelWands(const PixelWand **wands,
186 % const size_t number_wands)
188 % A description of each parameter follows:
190 % o wands: the magick wands.
192 % o number_wands: the number of wands.
195 WandExport PixelWand **ClonePixelWands(const PixelWand **wands,
196 const size_t number_wands)
204 clone_wands=(PixelWand **) AcquireQuantumMemory((size_t) number_wands,
205 sizeof(*clone_wands));
206 if (clone_wands == (PixelWand **) NULL)
207 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
208 GetExceptionMessage(errno));
209 for (i=0; i < (ssize_t) number_wands; i++)
210 clone_wands[i]=ClonePixelWand(wands[i]);
215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
219 % D e s t r o y P i x e l W a n d %
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225 % DestroyPixelWand() deallocates resources associated with a PixelWand.
227 % The format of the DestroyPixelWand method is:
229 % PixelWand *DestroyPixelWand(PixelWand *wand)
231 % A description of each parameter follows:
233 % o wand: the pixel wand.
236 WandExport PixelWand *DestroyPixelWand(PixelWand *wand)
238 assert(wand != (PixelWand *) NULL);
239 assert(wand->signature == WandSignature);
240 if (wand->debug != MagickFalse)
241 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
242 wand->exception=DestroyExceptionInfo(wand->exception);
243 wand->signature=(~WandSignature);
244 RelinquishWandId(wand->id);
245 wand=(PixelWand *) RelinquishMagickMemory(wand);
250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254 % D e s t r o y P i x e l W a n d s %
258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 % DestroyPixelWands() deallocates resources associated with an array of
263 % The format of the DestroyPixelWands method is:
265 % PixelWand **DestroyPixelWands(PixelWand **wand,
266 % const size_t number_wands)
268 % A description of each parameter follows:
270 % o wand: the pixel wand.
272 % o number_wands: the number of wands.
275 WandExport PixelWand **DestroyPixelWands(PixelWand **wand,
276 const size_t number_wands)
281 assert(wand != (PixelWand **) NULL);
282 assert(*wand != (PixelWand *) NULL);
283 assert((*wand)->signature == WandSignature);
284 if ((*wand)->debug != MagickFalse)
285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",(*wand)->name);
286 for (i=(ssize_t) number_wands-1; i >= 0; i--)
287 wand[i]=DestroyPixelWand(wand[i]);
288 wand=(PixelWand **) RelinquishMagickMemory(wand);
293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
297 % I s P i x e l W a n d S i m i l a r %
301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303 % IsPixelWandSimilar() returns MagickTrue if the distance between two
304 % colors is less than the specified distance.
306 % The format of the IsPixelWandSimilar method is:
308 % MagickBooleanType IsPixelWandSimilar(PixelWand *p,PixelWand *q,
311 % A description of each parameter follows:
313 % o p: the pixel wand.
315 % o q: the pixel wand.
317 % o fuzz: any two colors that are less than or equal to this distance
318 % squared are consider similar.
321 WandExport MagickBooleanType IsPixelWandSimilar(PixelWand *p,PixelWand *q,
324 assert(p != (PixelWand *) NULL);
325 assert(p->signature == WandSignature);
326 if (p->debug != MagickFalse)
327 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",p->name);
328 assert(q != (PixelWand *) NULL);
329 assert(q->signature == WandSignature);
330 if (q->debug != MagickFalse)
331 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",q->name);
334 return(IsFuzzyEquivalencePixelInfo(&p->pixel,&q->pixel));
338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
342 % I s P i x e l W a n d %
346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348 % IsPixelWand() returns MagickTrue if the wand is verified as a pixel wand.
350 % The format of the IsPixelWand method is:
352 % MagickBooleanType IsPixelWand(const PixelWand *wand)
354 % A description of each parameter follows:
356 % o wand: the magick wand.
359 WandExport MagickBooleanType IsPixelWand(const PixelWand *wand)
361 if (wand == (const PixelWand *) NULL)
363 if (wand->signature != WandSignature)
365 if (LocaleNCompare(wand->name,PixelWandId,strlen(PixelWandId)) != 0)
371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
375 % N e w P i x e l W a n d %
379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
381 % NewPixelWand() returns a new pixel wand.
383 % The format of the NewPixelWand method is:
385 % PixelWand *NewPixelWand(void)
388 WandExport PixelWand *NewPixelWand(void)
399 depth=MAGICKCORE_QUANTUM_DEPTH;
400 quantum=GetMagickQuantumDepth(&depth);
401 if (depth != MAGICKCORE_QUANTUM_DEPTH)
402 ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);
403 wand=(PixelWand *) AcquireMagickMemory(sizeof(*wand));
404 if (wand == (PixelWand *) NULL)
405 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
406 GetExceptionMessage(errno));
407 (void) ResetMagickMemory(wand,0,sizeof(*wand));
408 wand->id=AcquireWandId();
409 (void) FormatLocaleString(wand->name,MaxTextExtent,"%s-%.20g",PixelWandId,
411 wand->exception=AcquireExceptionInfo();
412 GetPixelInfo((Image *) NULL,&wand->pixel);
413 wand->debug=IsEventLogging();
414 if (wand->debug != MagickFalse)
415 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
416 wand->signature=WandSignature;
421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
425 % N e w P i x e l W a n d s %
429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
431 % NewPixelWands() returns an array of pixel wands.
433 % The format of the NewPixelWands method is:
435 % PixelWand **NewPixelWands(const size_t number_wands)
437 % A description of each parameter follows:
439 % o number_wands: the number of wands.
442 WandExport PixelWand **NewPixelWands(const size_t number_wands)
450 wands=(PixelWand **) AcquireQuantumMemory((size_t) number_wands,
452 if (wands == (PixelWand **) NULL)
453 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
454 GetExceptionMessage(errno));
455 for (i=0; i < (ssize_t) number_wands; i++)
456 wands[i]=NewPixelWand();
461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
465 % P i x e l C l e a r E x c e p t i o n %
469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
471 % PixelClearException() clear any exceptions associated with the iterator.
473 % The format of the PixelClearException method is:
475 % MagickBooleanType PixelClearException(PixelWand *wand)
477 % A description of each parameter follows:
479 % o wand: the pixel wand.
482 WandExport MagickBooleanType PixelClearException(PixelWand *wand)
484 assert(wand != (PixelWand *) NULL);
485 assert(wand->signature == WandSignature);
486 if (wand->debug != MagickFalse)
487 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
488 ClearMagickException(wand->exception);
493 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
497 % P i x e l G e t A l p h a %
501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
503 % PixelGetAlpha() returns the normalized alpha color of the pixel wand.
505 % The format of the PixelGetAlpha method is:
507 % double PixelGetAlpha(const PixelWand *wand)
509 % A description of each parameter follows:
511 % o wand: the pixel wand.
514 WandExport double PixelGetAlpha(const PixelWand *wand)
516 assert(wand != (const PixelWand *) NULL);
517 assert(wand->signature == WandSignature);
518 if (wand->debug != MagickFalse)
519 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
520 return((double) QuantumScale*wand->pixel.alpha);
524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
528 % P i x e l G e t A l p h a Q u a n t u m %
532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
534 % PixelGetAlphaQuantum() returns the alpha value of the pixel wand.
536 % The format of the PixelGetAlphaQuantum method is:
538 % Quantum PixelGetAlphaQuantum(const PixelWand *wand)
540 % A description of each parameter follows:
542 % o wand: the pixel wand.
545 WandExport Quantum PixelGetAlphaQuantum(const PixelWand *wand)
547 assert(wand != (const PixelWand *) NULL);
548 assert(wand->signature == WandSignature);
549 if (wand->debug != MagickFalse)
550 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
551 return(ClampToQuantum(wand->pixel.alpha));
555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
559 % P i x e l G e t B l a c k %
563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
565 % PixelGetBlack() returns the normalized black color of the pixel wand.
567 % The format of the PixelGetBlack method is:
569 % double PixelGetBlack(const PixelWand *wand)
571 % A description of each parameter follows:
573 % o wand: the pixel wand.
576 WandExport double PixelGetBlack(const PixelWand *wand)
578 assert(wand != (const PixelWand *) NULL);
579 assert(wand->signature == WandSignature);
580 if (wand->debug != MagickFalse)
581 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
582 return((double) QuantumScale*wand->pixel.black);
586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
590 % P i x e l G e t B l a c k Q u a n t u m %
594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
596 % PixelGetBlackQuantum() returns the black color of the pixel wand.
598 % The format of the PixelGetBlackQuantum method is:
600 % Quantum PixelGetBlackQuantum(const PixelWand *wand)
602 % A description of each parameter follows:
604 % o wand: the pixel wand.
607 WandExport Quantum PixelGetBlackQuantum(const PixelWand *wand)
609 assert(wand != (const PixelWand *) NULL);
610 assert(wand->signature == WandSignature);
611 if (wand->debug != MagickFalse)
612 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
613 return(ClampToQuantum(wand->pixel.black));
617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
621 % P i x e l G e t B l u e %
625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
627 % PixelGetBlue() returns the normalized blue color of the pixel wand.
629 % The format of the PixelGetBlue method is:
631 % double PixelGetBlue(const PixelWand *wand)
633 % A description of each parameter follows:
635 % o wand: the pixel wand.
638 WandExport double PixelGetBlue(const PixelWand *wand)
640 assert(wand != (const PixelWand *) NULL);
641 assert(wand->signature == WandSignature);
642 if (wand->debug != MagickFalse)
643 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
644 return((double) QuantumScale*wand->pixel.blue);
648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
652 % P i x e l G e t B l u e Q u a n t u m %
656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
658 % PixelGetBlueQuantum() returns the blue color of the pixel wand.
660 % The format of the PixelGetBlueQuantum method is:
662 % Quantum PixelGetBlueQuantum(const PixelWand *wand)
664 % A description of each parameter follows:
666 % o wand: the pixel wand.
669 WandExport Quantum PixelGetBlueQuantum(const PixelWand *wand)
671 assert(wand != (const PixelWand *) NULL);
672 assert(wand->signature == WandSignature);
673 if (wand->debug != MagickFalse)
674 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
675 return(ClampToQuantum(wand->pixel.blue));
679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
683 % P i x e l G e t C o l o r A s S t r i n g %
687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
689 % PixelGetColorAsString() returnsd the color of the pixel wand as a string.
691 % The format of the PixelGetColorAsString method is:
693 % char *PixelGetColorAsString(PixelWand *wand)
695 % A description of each parameter follows:
697 % o wand: the pixel wand.
700 WandExport char *PixelGetColorAsString(const PixelWand *wand)
708 assert(wand != (const PixelWand *) NULL);
709 assert(wand->signature == WandSignature);
710 if (wand->debug != MagickFalse)
711 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
713 color=AcquireString((const char *) NULL);
714 GetColorTuple(&pixel,MagickFalse,color);
719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
723 % P i x e l G e t C o l o r A s N o r m a l i z e d S t r i n g %
727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
729 % PixelGetColorAsNormalizedString() returns the normalized color of the pixel
732 % The format of the PixelGetColorAsNormalizedString method is:
734 % char *PixelGetColorAsNormalizedString(PixelWand *wand)
736 % A description of each parameter follows:
738 % o wand: the pixel wand.
741 WandExport char *PixelGetColorAsNormalizedString(const PixelWand *wand)
744 color[MaxTextExtent];
746 assert(wand != (const PixelWand *) NULL);
747 assert(wand->signature == WandSignature);
748 if (wand->debug != MagickFalse)
749 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
750 (void) FormatLocaleString(color,MaxTextExtent,"%g,%g,%g",
751 (double) (QuantumScale*wand->pixel.red),
752 (double) (QuantumScale*wand->pixel.green),
753 (double) (QuantumScale*wand->pixel.blue));
754 if (wand->pixel.colorspace == CMYKColorspace)
755 (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
756 (double) (QuantumScale*wand->pixel.black));
757 if (wand->pixel.matte != MagickFalse)
758 (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
759 (double) (QuantumScale*wand->pixel.alpha));
760 return(ConstantString(color));
764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
768 % P i x e l G e t C o l o r C o u n t %
772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
774 % PixelGetColorCount() returns the color count associated with this color.
776 % The format of the PixelGetColorCount method is:
778 % size_t PixelGetColorCount(const PixelWand *wand)
780 % A description of each parameter follows:
782 % o wand: the pixel wand.
785 WandExport size_t PixelGetColorCount(const PixelWand *wand)
787 assert(wand != (const PixelWand *) NULL);
788 assert(wand->signature == WandSignature);
789 if (wand->debug != MagickFalse)
790 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
799 % P i x e l G e t C y a n %
803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
805 % PixelGetCyan() returns the normalized cyan color of the pixel wand.
807 % The format of the PixelGetCyan method is:
809 % double PixelGetCyan(const PixelWand *wand)
811 % A description of each parameter follows:
813 % o wand: the pixel wand.
816 WandExport double PixelGetCyan(const PixelWand *wand)
818 assert(wand != (const PixelWand *) NULL);
819 assert(wand->signature == WandSignature);
820 if (wand->debug != MagickFalse)
821 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
822 return((double) QuantumScale*wand->pixel.red);
826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
830 % P i x e l G e t C y a n Q u a n t u m %
834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
836 % PixelGetCyanQuantum() returns the cyan color of the pixel wand.
838 % The format of the PixelGetCyanQuantum method is:
840 % Quantum PixelGetCyanQuantum(const PixelWand *wand)
842 % A description of each parameter follows:
844 % o wand: the pixel wand.
847 WandExport Quantum PixelGetCyanQuantum(const PixelWand *wand)
849 assert(wand != (const PixelWand *) NULL);
850 assert(wand->signature == WandSignature);
851 if (wand->debug != MagickFalse)
852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
853 return(ClampToQuantum(wand->pixel.red));
857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
861 % P i x e l G e t E x c e p t i o n %
865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
867 % PixelGetException() returns the severity, reason, and description of any
868 % error that occurs when using other methods in this API.
870 % The format of the PixelGetException method is:
872 % char *PixelGetException(const PixelWand *wand,ExceptionType *severity)
874 % A description of each parameter follows:
876 % o wand: the pixel wand.
878 % o severity: the severity of the error is returned here.
881 WandExport char *PixelGetException(const PixelWand *wand,
882 ExceptionType *severity)
887 assert(wand != (const PixelWand *) NULL);
888 assert(wand->signature == WandSignature);
889 if (wand->debug != MagickFalse)
890 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
891 assert(severity != (ExceptionType *) NULL);
892 *severity=wand->exception->severity;
893 description=(char *) AcquireQuantumMemory(2UL*MaxTextExtent,
894 sizeof(*description));
895 if (description == (char *) NULL)
896 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
899 if (wand->exception->reason != (char *) NULL)
900 (void) CopyMagickString(description,GetLocaleExceptionMessage(
901 wand->exception->severity,wand->exception->reason),MaxTextExtent);
902 if (wand->exception->description != (char *) NULL)
904 (void) ConcatenateMagickString(description," (",MaxTextExtent);
905 (void) ConcatenateMagickString(description,GetLocaleExceptionMessage(
906 wand->exception->severity,wand->exception->description),MaxTextExtent);
907 (void) ConcatenateMagickString(description,")",MaxTextExtent);
913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
917 % P i x e l G e t E x c e p t i o n T y p e %
921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
923 % PixelGetExceptionType() the exception type associated with the wand. If
924 % no exception has occurred, UndefinedExceptionType is returned.
926 % The format of the PixelGetExceptionType method is:
928 % ExceptionType PixelGetExceptionType(const PixelWand *wand)
930 % A description of each parameter follows:
932 % o wand: the magick wand.
935 WandExport ExceptionType PixelGetExceptionType(const PixelWand *wand)
937 assert(wand != (const PixelWand *) NULL);
938 assert(wand->signature == WandSignature);
939 if (wand->debug != MagickFalse)
940 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
941 return(wand->exception->severity);
945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
949 % P i x e l G e t F u z z %
953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
955 % PixelGetFuzz() returns the normalized fuzz value of the pixel wand.
957 % The format of the PixelGetFuzz method is:
959 % double PixelGetFuzz(const PixelWand *wand)
961 % A description of each parameter follows:
963 % o wand: the pixel wand.
966 WandExport double PixelGetFuzz(const PixelWand *wand)
968 assert(wand != (const PixelWand *) NULL);
969 assert(wand->signature == WandSignature);
970 if (wand->debug != MagickFalse)
971 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
972 return((double) wand->pixel.fuzz);
976 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
980 % P i x e l G e t G r e e n %
984 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
986 % PixelGetGreen() returns the normalized green color of the pixel wand.
988 % The format of the PixelGetGreen method is:
990 % double PixelGetGreen(const PixelWand *wand)
992 % A description of each parameter follows:
994 % o wand: the pixel wand.
997 WandExport double PixelGetGreen(const PixelWand *wand)
999 assert(wand != (const PixelWand *) NULL);
1000 assert(wand->signature == WandSignature);
1001 if (wand->debug != MagickFalse)
1002 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1003 return((double) QuantumScale*wand->pixel.green);
1007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1011 % P i x e l G e t G r e e n Q u a n t u m %
1015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1017 % PixelGetGreenQuantum() returns the green color of the pixel wand.
1019 % The format of the PixelGetGreenQuantum method is:
1021 % Quantum PixelGetGreenQuantum(const PixelWand *wand)
1023 % A description of each parameter follows:
1025 % o wand: the pixel wand.
1028 WandExport Quantum PixelGetGreenQuantum(const PixelWand *wand)
1030 assert(wand != (const PixelWand *) NULL);
1031 assert(wand->signature == WandSignature);
1032 if (wand->debug != MagickFalse)
1033 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1034 return(ClampToQuantum(wand->pixel.green));
1038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1042 % P i x e l G e t H S L %
1046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1048 % PixelGetHSL() returns the normalized HSL color of the pixel wand.
1050 % The format of the PixelGetHSL method is:
1052 % void PixelGetHSL(const PixelWand *wand,double *hue,double *saturation,
1053 % double *lightness)
1055 % A description of each parameter follows:
1057 % o wand: the pixel wand.
1059 % o hue,saturation,lightness: Return the pixel hue, saturation, and
1063 WandExport void PixelGetHSL(const PixelWand *wand,double *hue,
1064 double *saturation,double *lightness)
1066 assert(wand != (const PixelWand *) NULL);
1067 assert(wand->signature == WandSignature);
1068 if (wand->debug != MagickFalse)
1069 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1070 ConvertRGBToHSL(ClampToQuantum(wand->pixel.red),ClampToQuantum(
1071 wand->pixel.green),ClampToQuantum(wand->pixel.blue),hue,saturation,
1076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1080 % P i x e l G e t I n d e x %
1084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1086 % PixelGetIndex() returns the colormap index from the pixel wand.
1088 % The format of the PixelGetIndex method is:
1090 % Quantum PixelGetIndex(const PixelWand *wand)
1092 % A description of each parameter follows:
1094 % o wand: the pixel wand.
1097 WandExport Quantum PixelGetIndex(const PixelWand *wand)
1099 assert(wand != (const PixelWand *) NULL);
1100 assert(wand->signature == WandSignature);
1101 if (wand->debug != MagickFalse)
1102 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1103 return((Quantum) wand->pixel.black);
1107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1111 % P i x e l G e t M a g e n t a %
1115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1117 % PixelGetMagenta() returns the normalized magenta color of the pixel wand.
1119 % The format of the PixelGetMagenta method is:
1121 % double PixelGetMagenta(const PixelWand *wand)
1123 % A description of each parameter follows:
1125 % o wand: the pixel wand.
1128 WandExport double PixelGetMagenta(const PixelWand *wand)
1130 assert(wand != (const PixelWand *) NULL);
1131 assert(wand->signature == WandSignature);
1132 if (wand->debug != MagickFalse)
1133 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1134 return((double) QuantumScale*wand->pixel.green);
1138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1142 % P i x e l G e t M a g e n t a Q u a n t u m %
1146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1148 % PixelGetMagentaQuantum() returns the magenta color of the pixel wand.
1150 % The format of the PixelGetMagentaQuantum method is:
1152 % Quantum PixelGetMagentaQuantum(const PixelWand *wand)
1154 % A description of each parameter follows:
1156 % o wand: the pixel wand.
1159 WandExport Quantum PixelGetMagentaQuantum(const PixelWand *wand)
1161 assert(wand != (const PixelWand *) NULL);
1162 assert(wand->signature == WandSignature);
1163 if (wand->debug != MagickFalse)
1164 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1165 return(ClampToQuantum(wand->pixel.green));
1169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1173 % P i x e l G e t M a g i c k C o l o r %
1177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179 % PixelGetMagickColor() gets the magick color of the pixel wand.
1181 % The format of the PixelGetMagickColor method is:
1183 % void PixelGetMagickColor(PixelWand *wand,PixelInfo *color)
1185 % A description of each parameter follows:
1187 % o wand: the pixel wand.
1189 % o color: The pixel wand color is returned here.
1192 WandExport void PixelGetMagickColor(const PixelWand *wand,
1195 assert(wand != (const PixelWand *) NULL);
1196 assert(wand->signature == WandSignature);
1197 if (wand->debug != MagickFalse)
1198 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1199 assert(color != (PixelInfo *) NULL);
1204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1208 % P i x e l G e t P i x e l %
1212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1214 % PixelGetPixel() returns the pixel wand pixel.
1216 % The format of the PixelGetPixel method is:
1218 % PixelInfo PixelGetPixel(const PixelWand *wand)
1220 % A description of each parameter follows:
1222 % o wand: the pixel wand.
1225 WandExport PixelInfo PixelGetPixel(const PixelWand *wand)
1227 assert(wand != (const PixelWand *) NULL);
1228 assert(wand->signature == WandSignature);
1229 if (wand->debug != MagickFalse)
1230 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1231 return(wand->pixel);
1235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1239 % P i x e l G e t Q u a n t u m P a c k e t %
1243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1245 % PixelGetQuantumPacket() gets the packet of the pixel wand as a PixelInfo.
1247 % The format of the PixelGetQuantumPacket method is:
1249 % void PixelGetQuantumPacket(PixelWand *wand,PixelInfo *packet)
1251 % A description of each parameter follows:
1253 % o wand: the pixel wand.
1255 % o packet: The pixel wand packet is returned here.
1258 WandExport void PixelGetQuantumPacket(const PixelWand *wand,PixelInfo *packet)
1260 assert(wand != (const PixelWand *) NULL);
1261 assert(wand->signature == WandSignature);
1262 if (wand->debug != MagickFalse)
1263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1264 assert(packet != (PixelInfo *) NULL);
1265 packet->alpha=ClampToQuantum(wand->pixel.alpha);
1266 if (wand->pixel.colorspace == CMYKColorspace)
1268 packet->red=ClampToQuantum((MagickRealType) QuantumRange-
1269 (wand->pixel.red*(QuantumRange-wand->pixel.black)+
1270 wand->pixel.black));
1271 packet->green=ClampToQuantum((MagickRealType) QuantumRange-
1272 (wand->pixel.green*(QuantumRange-wand->pixel.black)+
1273 wand->pixel.black));
1274 packet->blue=ClampToQuantum((MagickRealType) QuantumRange-
1275 (wand->pixel.blue*(QuantumRange-wand->pixel.black)+
1276 wand->pixel.black));
1277 packet->black=ClampToQuantum(wand->pixel.black);
1280 packet->red=ClampToQuantum(wand->pixel.red);
1281 packet->green=ClampToQuantum(wand->pixel.green);
1282 packet->blue=ClampToQuantum(wand->pixel.blue);
1286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1290 % P i x e l G e t Q u a n t u m P i x e l %
1294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1296 % PixelGetQuantumPixel() gets the pixel of the pixel wand as a PixelInfo.
1298 % The format of the PixelGetQuantumPixel method is:
1300 % void PixelGetQuantumPixel(const Image *image,const PixelWand *wand,
1303 % A description of each parameter follows:
1305 % o wand: the pixel wand.
1307 % o pixel: The pixel wand pixel is returned here.
1310 WandExport void PixelGetQuantumPixel(const Image *image,const PixelWand *wand,
1313 assert(wand != (const PixelWand *) NULL);
1314 assert(wand->signature == WandSignature);
1315 if (wand->debug != MagickFalse)
1316 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1317 assert(pixel != (Quantum *) NULL);
1318 SetPixelAlpha(image,ClampToQuantum(wand->pixel.alpha),pixel);
1319 if (wand->pixel.colorspace == CMYKColorspace)
1321 SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange-
1322 (wand->pixel.red*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
1324 SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange-
1325 (wand->pixel.green*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
1327 SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange-
1328 (wand->pixel.blue*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
1330 SetPixelBlack(image,ClampToQuantum(wand->pixel.black),pixel);
1333 SetPixelRed(image,ClampToQuantum(wand->pixel.red),pixel);
1334 SetPixelGreen(image,ClampToQuantum(wand->pixel.green),pixel);
1335 SetPixelBlue(image,ClampToQuantum(wand->pixel.blue),pixel);
1339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1343 % P i x e l G e t R e d %
1347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1349 % PixelGetRed() returns the normalized red color of the pixel wand.
1351 % The format of the PixelGetRed method is:
1353 % double PixelGetRed(const PixelWand *wand)
1355 % A description of each parameter follows:
1357 % o wand: the pixel wand.
1360 WandExport double PixelGetRed(const PixelWand *wand)
1362 assert(wand != (const PixelWand *) NULL);
1363 assert(wand->signature == WandSignature);
1364 if (wand->debug != MagickFalse)
1365 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1366 return((double) QuantumScale*wand->pixel.red);
1370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1374 % P i x e l G e t R e d Q u a n t u m %
1378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1380 % PixelGetRedQuantum() returns the red color of the pixel wand.
1382 % The format of the PixelGetRedQuantum method is:
1384 % Quantum PixelGetRedQuantum(const PixelWand *wand)
1386 % A description of each parameter follows:
1388 % o wand: the pixel wand.
1391 WandExport Quantum PixelGetRedQuantum(const PixelWand *wand)
1393 assert(wand != (const PixelWand *) NULL);
1394 assert(wand->signature == WandSignature);
1395 if (wand->debug != MagickFalse)
1396 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1397 return(ClampToQuantum(wand->pixel.red));
1401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1405 % P i x e l G e t Y e l l o w %
1409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1411 % PixelGetYellow() returns the normalized yellow color of the pixel wand.
1413 % The format of the PixelGetYellow method is:
1415 % double PixelGetYellow(const PixelWand *wand)
1417 % A description of each parameter follows:
1419 % o wand: the pixel wand.
1422 WandExport double PixelGetYellow(const PixelWand *wand)
1424 assert(wand != (const PixelWand *) NULL);
1425 assert(wand->signature == WandSignature);
1426 if (wand->debug != MagickFalse)
1427 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1428 return((double) QuantumScale*wand->pixel.blue);
1432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1436 % P i x e l G e t Y e l l o w Q u a n t u m %
1440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1442 % PixelGetYellowQuantum() returns the yellow color of the pixel wand.
1444 % The format of the PixelGetYellowQuantum method is:
1446 % Quantum PixelGetYellowQuantum(const PixelWand *wand)
1448 % A description of each parameter follows:
1450 % o wand: the pixel wand.
1453 WandExport Quantum PixelGetYellowQuantum(const PixelWand *wand)
1455 assert(wand != (const PixelWand *) NULL);
1456 assert(wand->signature == WandSignature);
1457 if (wand->debug != MagickFalse)
1458 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1459 return(ClampToQuantum(wand->pixel.blue));
1463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1467 % P i x e l S e t A l p h a %
1471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1473 % PixelSetAlpha() sets the normalized alpha color of the pixel wand.
1475 % The format of the PixelSetAlpha method is:
1477 % void PixelSetAlpha(PixelWand *wand,const double alpha)
1479 % A description of each parameter follows:
1481 % o wand: the pixel wand.
1483 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
1487 WandExport void PixelSetAlpha(PixelWand *wand,const double alpha)
1489 assert(wand != (const PixelWand *) NULL);
1490 assert(wand->signature == WandSignature);
1491 if (wand->debug != MagickFalse)
1492 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1493 wand->pixel.alpha=ClampToQuantum(QuantumRange*alpha);
1497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1501 % P i x e l S e t A l p h a Q u a n t u m %
1505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1507 % PixelSetAlphaQuantum() sets the alpha color of the pixel wand.
1509 % The format of the PixelSetAlphaQuantum method is:
1511 % void PixelSetAlphaQuantum(PixelWand *wand,
1512 % const Quantum alpha)
1514 % A description of each parameter follows:
1516 % o wand: the pixel wand.
1518 % o alpha: the alpha color.
1521 WandExport void PixelSetAlphaQuantum(PixelWand *wand,const Quantum alpha)
1523 assert(wand != (const PixelWand *) NULL);
1524 assert(wand->signature == WandSignature);
1525 if (wand->debug != MagickFalse)
1526 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1527 wand->pixel.alpha=(MagickRealType) alpha;
1531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1535 % P i x e l S e t B l a c k %
1539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1541 % PixelSetBlack() sets the normalized black color of the pixel wand.
1543 % The format of the PixelSetBlack method is:
1545 % void PixelSetBlack(PixelWand *wand,const double black)
1547 % A description of each parameter follows:
1549 % o wand: the pixel wand.
1551 % o black: the black color.
1554 WandExport void PixelSetBlack(PixelWand *wand,const double black)
1556 assert(wand != (const PixelWand *) NULL);
1557 assert(wand->signature == WandSignature);
1558 if (wand->debug != MagickFalse)
1559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1560 wand->pixel.black=(MagickRealType) ClampToQuantum((MagickRealType)
1561 QuantumRange*black);
1565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1569 % P i x e l S e t B l a c k Q u a n t u m %
1573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1575 % PixelSetBlackQuantum() sets the black color of the pixel wand.
1577 % The format of the PixelSetBlackQuantum method is:
1579 % void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
1581 % A description of each parameter follows:
1583 % o wand: the pixel wand.
1585 % o black: the black color.
1588 WandExport void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
1590 assert(wand != (const PixelWand *) NULL);
1591 assert(wand->signature == WandSignature);
1592 if (wand->debug != MagickFalse)
1593 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1594 wand->pixel.black=(MagickRealType) black;
1598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1602 % P i x e l S e t B l u e %
1606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1608 % PixelSetBlue() sets the normalized blue color of the pixel wand.
1610 % The format of the PixelSetBlue method is:
1612 % void PixelSetBlue(PixelWand *wand,const double blue)
1614 % A description of each parameter follows:
1616 % o wand: the pixel wand.
1618 % o blue: the blue color.
1621 WandExport void PixelSetBlue(PixelWand *wand,const double blue)
1623 assert(wand != (const PixelWand *) NULL);
1624 assert(wand->signature == WandSignature);
1625 if (wand->debug != MagickFalse)
1626 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1627 wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
1632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1636 % P i x e l S e t B l u e Q u a n t u m %
1640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1642 % PixelSetBlueQuantum() sets the blue color of the pixel wand.
1644 % The format of the PixelSetBlueQuantum method is:
1646 % void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
1648 % A description of each parameter follows:
1650 % o wand: the pixel wand.
1652 % o blue: the blue color.
1655 WandExport void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
1657 assert(wand != (const PixelWand *) NULL);
1658 assert(wand->signature == WandSignature);
1659 if (wand->debug != MagickFalse)
1660 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1661 wand->pixel.blue=(MagickRealType) blue;
1665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1669 % P i x e l S e t C o l o r %
1673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1675 % PixelSetColor() sets the color of the pixel wand with a string (e.g.
1676 % "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.).
1678 % The format of the PixelSetColor method is:
1680 % MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
1682 % A description of each parameter follows:
1684 % o wand: the pixel wand.
1686 % o color: the pixel wand color.
1689 WandExport MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
1697 assert(wand != (const PixelWand *) NULL);
1698 assert(wand->signature == WandSignature);
1699 if (wand->debug != MagickFalse)
1700 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1701 status=QueryMagickColorCompliance(color,AllCompliance,&pixel,wand->exception);
1702 if (status != MagickFalse)
1708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1712 % P i x e l S e t C o l o r C o u n t %
1716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1718 % PixelSetColorCount() sets the color count of the pixel wand.
1720 % The format of the PixelSetColorCount method is:
1722 % void PixelSetColorCount(PixelWand *wand,const size_t count)
1724 % A description of each parameter follows:
1726 % o wand: the pixel wand.
1728 % o count: the number of this particular color.
1731 WandExport void PixelSetColorCount(PixelWand *wand,const size_t count)
1733 assert(wand != (const PixelWand *) NULL);
1734 assert(wand->signature == WandSignature);
1735 if (wand->debug != MagickFalse)
1736 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1745 % P i x e l S e t C o l o r F r o m W a n d %
1749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1751 % PixelSetColorFromWand() sets the color of the pixel wand.
1753 % The format of the PixelSetColorFromWand method is:
1755 % PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
1757 % A description of each parameter follows:
1759 % o wand: the pixel wand.
1761 % o color: set the pixel wand color here.
1764 WandExport void PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
1766 assert(wand != (const PixelWand *) NULL);
1767 assert(wand->signature == WandSignature);
1768 if (wand->debug != MagickFalse)
1769 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1770 assert(color != (const PixelWand *) NULL);
1771 wand->pixel=color->pixel;
1775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1779 % P i x e l S e t C y a n %
1783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1785 % PixelSetCyan() sets the normalized cyan color of the pixel wand.
1787 % The format of the PixelSetCyan method is:
1789 % void PixelSetCyan(PixelWand *wand,const double cyan)
1791 % A description of each parameter follows:
1793 % o wand: the pixel wand.
1795 % o cyan: the cyan color.
1798 WandExport void PixelSetCyan(PixelWand *wand,const double cyan)
1800 assert(wand != (const PixelWand *) NULL);
1801 assert(wand->signature == WandSignature);
1802 if (wand->debug != MagickFalse)
1803 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1804 wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
1809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1813 % P i x e l S e t C y a n Q u a n t u m %
1817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1819 % PixelSetCyanQuantum() sets the cyan color of the pixel wand.
1821 % The format of the PixelSetCyanQuantum method is:
1823 % void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
1825 % A description of each parameter follows:
1827 % o wand: the pixel wand.
1829 % o cyan: the cyan color.
1832 WandExport void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
1834 assert(wand != (const PixelWand *) NULL);
1835 assert(wand->signature == WandSignature);
1836 if (wand->debug != MagickFalse)
1837 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1838 wand->pixel.red=(MagickRealType) cyan;
1842 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1846 % P i x e l S e t F u z z %
1850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1852 % PixelSetFuzz() sets the fuzz value of the pixel wand.
1854 % The format of the PixelSetFuzz method is:
1856 % void PixelSetFuzz(PixelWand *wand,const double fuzz)
1858 % A description of each parameter follows:
1860 % o wand: the pixel wand.
1862 % o fuzz: the fuzz value.
1865 WandExport void PixelSetFuzz(PixelWand *wand,const double fuzz)
1867 assert(wand != (const PixelWand *) NULL);
1868 assert(wand->signature == WandSignature);
1869 if (wand->debug != MagickFalse)
1870 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1871 wand->pixel.fuzz=(MagickRealType) fuzz;
1875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1879 % P i x e l S e t G r e e n %
1883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1885 % PixelSetGreen() sets the normalized green color of the pixel wand.
1887 % The format of the PixelSetGreen method is:
1889 % void PixelSetGreen(PixelWand *wand,const double green)
1891 % A description of each parameter follows:
1893 % o wand: the pixel wand.
1895 % o green: the green color.
1898 WandExport void PixelSetGreen(PixelWand *wand,const double green)
1900 assert(wand != (const PixelWand *) NULL);
1901 assert(wand->signature == WandSignature);
1902 if (wand->debug != MagickFalse)
1903 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1904 wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
1905 QuantumRange*green);
1909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1913 % P i x e l S e t G r e e n Q u a n t u m %
1917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1919 % PixelSetGreenQuantum() sets the green color of the pixel wand.
1921 % The format of the PixelSetGreenQuantum method is:
1923 % void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
1925 % A description of each parameter follows:
1927 % o wand: the pixel wand.
1929 % o green: the green color.
1932 WandExport void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
1934 assert(wand != (const PixelWand *) NULL);
1935 assert(wand->signature == WandSignature);
1936 if (wand->debug != MagickFalse)
1937 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1938 wand->pixel.green=(MagickRealType) green;
1942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1946 % P i x e l S e t H S L %
1950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1952 % PixelSetHSL() sets the normalized HSL color of the pixel wand.
1954 % The format of the PixelSetHSL method is:
1956 % void PixelSetHSL(PixelWand *wand,const double hue,
1957 % const double saturation,const double lightness)
1959 % A description of each parameter follows:
1961 % o wand: the pixel wand.
1963 % o hue,saturation,lightness: Return the pixel hue, saturation, and
1967 WandExport void PixelSetHSL(PixelWand *wand,const double hue,
1968 const double saturation,const double lightness)
1975 assert(wand != (const PixelWand *) NULL);
1976 assert(wand->signature == WandSignature);
1977 if (wand->debug != MagickFalse)
1978 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1979 ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
1980 wand->pixel.red=(MagickRealType) red;
1981 wand->pixel.green=(MagickRealType) green;
1982 wand->pixel.blue=(MagickRealType) blue;
1986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1990 % P i x e l S e t I n d e x %
1994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1996 % PixelSetIndex() sets the colormap index of the pixel wand.
1998 % The format of the PixelSetIndex method is:
2000 % void PixelSetIndex(PixelWand *wand,const Quantum index)
2002 % A description of each parameter follows:
2004 % o wand: the pixel wand.
2006 % o index: the colormap index.
2009 WandExport void PixelSetIndex(PixelWand *wand,const Quantum index)
2011 assert(wand != (const PixelWand *) NULL);
2012 assert(wand->signature == WandSignature);
2013 if (wand->debug != MagickFalse)
2014 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2015 wand->pixel.index=(MagickRealType) index;
2019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2023 % P i x e l S e t M a g e n t a %
2027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2029 % PixelSetMagenta() sets the normalized magenta color of the pixel wand.
2031 % The format of the PixelSetMagenta method is:
2033 % void PixelSetMagenta(PixelWand *wand,const double magenta)
2035 % A description of each parameter follows:
2037 % o wand: the pixel wand.
2039 % o magenta: the magenta color.
2042 WandExport void PixelSetMagenta(PixelWand *wand,const double magenta)
2044 assert(wand != (const PixelWand *) NULL);
2045 assert(wand->signature == WandSignature);
2046 if (wand->debug != MagickFalse)
2047 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2048 wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
2049 QuantumRange*magenta);
2053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2057 % P i x e l S e t M a g e n t a Q u a n t u m %
2061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2063 % PixelSetMagentaQuantum() sets the magenta color of the pixel wand.
2065 % The format of the PixelSetMagentaQuantum method is:
2067 % void PixelSetMagentaQuantum(PixelWand *wand,
2068 % const Quantum magenta)
2070 % A description of each parameter follows:
2072 % o wand: the pixel wand.
2074 % o magenta: the green magenta.
2077 WandExport void PixelSetMagentaQuantum(PixelWand *wand,const Quantum magenta)
2079 assert(wand != (const PixelWand *) NULL);
2080 assert(wand->signature == WandSignature);
2081 if (wand->debug != MagickFalse)
2082 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2083 wand->pixel.green=(MagickRealType) magenta;
2087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2091 % P i x e l S e t M a g i c k C o l o r %
2095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2097 % PixelSetPixelInfo() sets the color of the pixel wand.
2099 % The format of the PixelSetPixelInfo method is:
2101 % PixelSetPixelInfo(PixelWand *wand,const PixelInfo *color)
2103 % A description of each parameter follows:
2105 % o wand: the pixel wand.
2107 % o color: the pixel wand color.
2110 WandExport void PixelSetPixelInfo(PixelWand *wand,
2111 const PixelInfo *color)
2113 assert(wand != (const PixelWand *) NULL);
2114 assert(wand->signature == WandSignature);
2115 if (wand->debug != MagickFalse)
2116 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2117 assert(color != (const PixelInfo *) NULL);
2118 wand->pixel=(*color);
2122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2126 % P i x e l S e t Q u a n t u m P a c k e t %
2130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2132 % PixelSetQuantumPacket() sets the packet of the pixel wand.
2134 % The format of the PixelSetQuantumPacket method is:
2136 % PixelSetQuantumPacket(PixelWand *wand,const PixelInfo *packet)
2138 % A description of each parameter follows:
2140 % o wand: the pixel wand.
2142 % o packet: the pixel wand packet.
2145 WandExport void PixelSetQuantumPacket(PixelWand *wand,const PixelInfo *packet)
2147 assert(wand != (const PixelWand *) NULL);
2148 assert(wand->signature == WandSignature);
2149 if (wand->debug != MagickFalse)
2150 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2151 assert(packet != (PixelInfo *) NULL);
2152 wand->pixel.red=(MagickRealType) packet->red;
2153 wand->pixel.green=(MagickRealType) packet->green;
2154 wand->pixel.blue=(MagickRealType) packet->blue;
2155 wand->pixel.black=(MagickRealType) packet->black;
2156 wand->pixel.alpha=(MagickRealType) packet->alpha;
2157 wand->pixel.matte=packet->alpha != OpaqueAlpha ? MagickTrue : MagickFalse;
2161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2165 % P i x e l S e t Q u a n t u m P i x e l %
2169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2171 % PixelSetQuantumPixel() sets the pixel of the pixel wand.
2173 % The format of the PixelSetQuantumPixel method is:
2175 % PixelSetQuantumPixel(const Image *image,const QixelPixel *pixel,
2178 % A description of each parameter follows:
2180 % o wand: the pixel wand.
2182 % o pixel: the pixel wand pixel.
2185 WandExport void PixelSetQuantumPixel(const Image *image,const Quantum *pixel,
2188 assert(wand != (const PixelWand *) NULL);
2189 assert(wand->signature == WandSignature);
2190 if (wand->debug != MagickFalse)
2191 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2192 assert(pixel != (Quantum *) NULL);
2193 wand->pixel.red=(MagickRealType) GetPixelRed(image,pixel);
2194 wand->pixel.green=(MagickRealType) GetPixelGreen(image,pixel);
2195 wand->pixel.blue=(MagickRealType) GetPixelBlue(image,pixel);
2196 wand->pixel.black=(MagickRealType) GetPixelBlack(image,pixel);
2197 wand->pixel.alpha=(MagickRealType) GetPixelAlpha(image,pixel);
2198 wand->pixel.matte=GetPixelAlpha(image,pixel) != OpaqueAlpha ? MagickTrue :
2203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2207 % P i x e l S e t R e d %
2211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2213 % PixelSetRed() sets the normalized red color of the pixel wand.
2215 % The format of the PixelSetRed method is:
2217 % void PixelSetRed(PixelWand *wand,const double red)
2219 % A description of each parameter follows:
2221 % o wand: the pixel wand.
2223 % o red: the red color.
2226 WandExport void PixelSetRed(PixelWand *wand,const double red)
2228 assert(wand != (const PixelWand *) NULL);
2229 assert(wand->signature == WandSignature);
2230 if (wand->debug != MagickFalse)
2231 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2232 wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
2237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2241 % P i x e l S e t R e d Q u a n t u m %
2245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2247 % PixelSetRedQuantum() sets the red color of the pixel wand.
2249 % The format of the PixelSetRedQuantum method is:
2251 % void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
2253 % A description of each parameter follows:
2255 % o wand: the pixel wand.
2257 % o red: the red color.
2260 WandExport void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
2262 assert(wand != (const PixelWand *) NULL);
2263 assert(wand->signature == WandSignature);
2264 if (wand->debug != MagickFalse)
2265 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2266 wand->pixel.red=(MagickRealType) red;
2270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2274 % P i x e l S e t Y e l l o w %
2278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2280 % PixelSetYellow() sets the normalized yellow color of the pixel wand.
2282 % The format of the PixelSetYellow method is:
2284 % void PixelSetYellow(PixelWand *wand,const double yellow)
2286 % A description of each parameter follows:
2288 % o wand: the pixel wand.
2290 % o yellow: the yellow color.
2293 WandExport void PixelSetYellow(PixelWand *wand,const double yellow)
2295 assert(wand != (const PixelWand *) NULL);
2296 assert(wand->signature == WandSignature);
2297 if (wand->debug != MagickFalse)
2298 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2299 wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
2300 QuantumRange*yellow);
2304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2308 % P i x e l S e t Y e l l o w Q u a n t u m %
2312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2314 % PixelSetYellowQuantum() sets the yellow color of the pixel wand.
2316 % The format of the PixelSetYellowQuantum method is:
2318 % void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
2320 % A description of each parameter follows:
2322 % o wand: the pixel wand.
2324 % o yellow: the yellow color.
2327 WandExport void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
2329 assert(wand != (const PixelWand *) NULL);
2330 assert(wand->signature == WandSignature);
2331 if (wand->debug != MagickFalse)
2332 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2333 wand->pixel.blue=(MagickRealType) yellow;