MagickWand  6.7.5
pixel-wand.c
Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %                      PPPP   IIIII  X   X  EEEEE  L                          %
00007 %                      P   P    I     X X   E      L                          %
00008 %                      PPPP     I      X    EEE    L                          %
00009 %                      P        I     X X   E      L                          %
00010 %                      P      IIIII  X   X  EEEEE  LLLLL                      %
00011 %                                                                             %
00012 %                         W   W   AAA   N   N  DDDD                           %
00013 %                         W   W  A   A  NN  N  D   D                          %
00014 %                         W W W  AAAAA  N N N  D   D                          %
00015 %                         WW WW  A   A  N  NN  D   D                          %
00016 %                         W   W  A   A  N   N  DDDD                           %
00017 %                                                                             %
00018 %                                                                             %
00019 %                    MagickWand Image Pixel Wand Methods                      %
00020 %                                                                             %
00021 %                              Software Design                                %
00022 %                                John Cristy                                  %
00023 %                                March 2003                                   %
00024 %                                                                             %
00025 %                                                                             %
00026 %  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
00027 %  dedicated to making software imaging solutions freely available.           %
00028 %                                                                             %
00029 %  You may not use this file except in compliance with the License.  You may  %
00030 %  obtain a copy of the License at                                            %
00031 %                                                                             %
00032 %    http://www.imagemagick.org/script/license.php                            %
00033 %                                                                             %
00034 %  Unless required by applicable law or agreed to in writing, software        %
00035 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00036 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00037 %  See the License for the specific language governing permissions and        %
00038 %  limitations under the License.                                             %
00039 %                                                                             %
00040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00041 %
00042 %
00043 %
00044 */
00045 
00046 /*
00047   Include declarations.
00048 */
00049 #include "MagickWand/studio.h"
00050 #include "MagickWand/MagickWand.h"
00051 #include "MagickWand/magick-wand-private.h"
00052 #include "MagickWand/pixel-wand-private.h"
00053 #include "MagickWand/wand.h"
00054 
00055 /*
00056   Define declarations.
00057 */
00058 #define PixelWandId  "PixelWand"
00059 
00060 /*
00061   Typedef declarations.
00062 */
00063 struct _PixelWand
00064 {
00065   size_t
00066     id;
00067 
00068   char
00069     name[MaxTextExtent];
00070 
00071   ExceptionInfo
00072     *exception;
00073 
00074   PixelInfo
00075     pixel;
00076 
00077   size_t
00078     count;
00079 
00080   MagickBooleanType
00081     debug;
00082 
00083   size_t
00084     signature;
00085 };
00086 
00087 /*
00088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00089 %                                                                             %
00090 %                                                                             %
00091 %                                                                             %
00092 %   C l e a r P i x e l W a n d                                               %
00093 %                                                                             %
00094 %                                                                             %
00095 %                                                                             %
00096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00097 %
00098 %  ClearPixelWand() clears resources associated with the wand.
00099 %
00100 %  The format of the ClearPixelWand method is:
00101 %
00102 %      void ClearPixelWand(PixelWand *wand)
00103 %
00104 %  A description of each parameter follows:
00105 %
00106 %    o wand: the pixel wand.
00107 %
00108 */
00109 WandExport void ClearPixelWand(PixelWand *wand)
00110 {
00111   assert(wand != (PixelWand *) NULL);
00112   assert(wand->signature == WandSignature);
00113   if (wand->debug != MagickFalse)
00114     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00115   ClearMagickException(wand->exception);
00116   wand->pixel.colorspace=RGBColorspace;
00117   wand->debug=IsEventLogging();
00118 }
00119 
00120 /*
00121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00122 %                                                                             %
00123 %                                                                             %
00124 %                                                                             %
00125 %   C l o n e P i x e l W a n d                                               %
00126 %                                                                             %
00127 %                                                                             %
00128 %                                                                             %
00129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00130 %
00131 %  ClonePixelWand() makes an exact copy of the specified wand.
00132 %
00133 %  The format of the ClonePixelWand method is:
00134 %
00135 %      PixelWand *ClonePixelWand(const PixelWand *wand)
00136 %
00137 %  A description of each parameter follows:
00138 %
00139 %    o wand: the magick wand.
00140 %
00141 */
00142 WandExport PixelWand *ClonePixelWand(const PixelWand *wand)
00143 {
00144   PixelWand
00145     *clone_wand;
00146 
00147   assert(wand != (PixelWand *) NULL);
00148   assert(wand->signature == WandSignature);
00149   if (wand->debug != MagickFalse)
00150     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00151   clone_wand=(PixelWand *) AcquireMagickMemory(sizeof(*clone_wand));
00152   if (clone_wand == (PixelWand *) NULL)
00153     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00154       wand->name);
00155   (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
00156   clone_wand->id=AcquireWandId();
00157   (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"%s-%.20g",
00158     PixelWandId,(double) clone_wand->id);
00159   clone_wand->exception=AcquireExceptionInfo();
00160   InheritException(clone_wand->exception,wand->exception);
00161   clone_wand->pixel=wand->pixel;
00162   clone_wand->count=wand->count;
00163   clone_wand->debug=IsEventLogging();
00164   if (clone_wand->debug != MagickFalse)
00165     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
00166   clone_wand->signature=WandSignature;
00167   return(clone_wand);
00168 }
00169 
00170 /*
00171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00172 %                                                                             %
00173 %                                                                             %
00174 %                                                                             %
00175 %   C l o n e P i x e l W a n d s                                             %
00176 %                                                                             %
00177 %                                                                             %
00178 %                                                                             %
00179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00180 %
00181 %  ClonePixelWands() makes an exact copy of the specified wands.
00182 %
00183 %  The format of the ClonePixelWands method is:
00184 %
00185 %      PixelWand **ClonePixelWands(const PixelWand **wands,
00186 %        const size_t number_wands)
00187 %
00188 %  A description of each parameter follows:
00189 %
00190 %    o wands: the magick wands.
00191 %
00192 %    o number_wands: the number of wands.
00193 %
00194 */
00195 WandExport PixelWand **ClonePixelWands(const PixelWand **wands,
00196   const size_t number_wands)
00197 {
00198   register ssize_t
00199     i;
00200 
00201   PixelWand
00202     **clone_wands;
00203 
00204   clone_wands=(PixelWand **) AcquireQuantumMemory((size_t) number_wands,
00205     sizeof(*clone_wands));
00206   if (clone_wands == (PixelWand **) NULL)
00207     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00208       GetExceptionMessage(errno));
00209   for (i=0; i < (ssize_t) number_wands; i++)
00210     clone_wands[i]=ClonePixelWand(wands[i]);
00211   return(clone_wands);
00212 }
00213 
00214 /*
00215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00216 %                                                                             %
00217 %                                                                             %
00218 %                                                                             %
00219 %   D e s t r o y P i x e l W a n d                                           %
00220 %                                                                             %
00221 %                                                                             %
00222 %                                                                             %
00223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00224 %
00225 %  DestroyPixelWand() deallocates resources associated with a PixelWand.
00226 %
00227 %  The format of the DestroyPixelWand method is:
00228 %
00229 %      PixelWand *DestroyPixelWand(PixelWand *wand)
00230 %
00231 %  A description of each parameter follows:
00232 %
00233 %    o wand: the pixel wand.
00234 %
00235 */
00236 WandExport PixelWand *DestroyPixelWand(PixelWand *wand)
00237 {
00238   assert(wand != (PixelWand *) NULL);
00239   assert(wand->signature == WandSignature);
00240   if (wand->debug != MagickFalse)
00241     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00242   wand->exception=DestroyExceptionInfo(wand->exception);
00243   wand->signature=(~WandSignature);
00244   RelinquishWandId(wand->id);
00245   wand=(PixelWand *) RelinquishMagickMemory(wand);
00246   return(wand);
00247 }
00248 
00249 /*
00250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00251 %                                                                             %
00252 %                                                                             %
00253 %                                                                             %
00254 %   D e s t r o y P i x e l W a n d s                                         %
00255 %                                                                             %
00256 %                                                                             %
00257 %                                                                             %
00258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00259 %
00260 %  DestroyPixelWands() deallocates resources associated with an array of
00261 %  pixel wands.
00262 %
00263 %  The format of the DestroyPixelWands method is:
00264 %
00265 %      PixelWand **DestroyPixelWands(PixelWand **wand,
00266 %        const size_t number_wands)
00267 %
00268 %  A description of each parameter follows:
00269 %
00270 %    o wand: the pixel wand.
00271 %
00272 %    o number_wands: the number of wands.
00273 %
00274 */
00275 WandExport PixelWand **DestroyPixelWands(PixelWand **wand,
00276   const size_t number_wands)
00277 {
00278   register ssize_t
00279     i;
00280 
00281   assert(wand != (PixelWand **) NULL);
00282   assert(*wand != (PixelWand *) NULL);
00283   assert((*wand)->signature == WandSignature);
00284   if ((*wand)->debug != MagickFalse)
00285     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",(*wand)->name);
00286   for (i=(ssize_t) number_wands-1; i >= 0; i--)
00287     wand[i]=DestroyPixelWand(wand[i]);
00288   wand=(PixelWand **) RelinquishMagickMemory(wand);
00289   return(wand);
00290 }
00291 
00292 /*
00293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00294 %                                                                             %
00295 %                                                                             %
00296 %                                                                             %
00297 %   I s P i x e l W a n d S i m i l a r                                       %
00298 %                                                                             %
00299 %                                                                             %
00300 %                                                                             %
00301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00302 %
00303 %  IsPixelWandSimilar() returns MagickTrue if the distance between two
00304 %  colors is less than the specified distance.
00305 %
00306 %  The format of the IsPixelWandSimilar method is:
00307 %
00308 %      MagickBooleanType IsPixelWandSimilar(PixelWand *p,PixelWand *q,
00309 %        const double fuzz)
00310 %
00311 %  A description of each parameter follows:
00312 %
00313 %    o p: the pixel wand.
00314 %
00315 %    o q: the pixel wand.
00316 %
00317 %    o fuzz: any two colors that are less than or equal to this distance
00318 %      squared are consider similar.
00319 %
00320 */
00321 WandExport MagickBooleanType IsPixelWandSimilar(PixelWand *p,PixelWand *q,
00322   const double fuzz)
00323 {
00324   assert(p != (PixelWand *) NULL);
00325   assert(p->signature == WandSignature);
00326   if (p->debug != MagickFalse)
00327     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",p->name);
00328   assert(q != (PixelWand *) NULL);
00329   assert(q->signature == WandSignature);
00330   if (q->debug != MagickFalse)
00331     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",q->name);
00332   p->pixel.fuzz=fuzz;
00333   q->pixel.fuzz=fuzz;
00334   return(IsFuzzyEquivalencePixelInfo(&p->pixel,&q->pixel));
00335 }
00336 
00337 /*
00338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00339 %                                                                             %
00340 %                                                                             %
00341 %                                                                             %
00342 %   I s P i x e l W a n d                                                     %
00343 %                                                                             %
00344 %                                                                             %
00345 %                                                                             %
00346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00347 %
00348 %  IsPixelWand() returns MagickTrue if the wand is verified as a pixel wand.
00349 %
00350 %  The format of the IsPixelWand method is:
00351 %
00352 %      MagickBooleanType IsPixelWand(const PixelWand *wand)
00353 %
00354 %  A description of each parameter follows:
00355 %
00356 %    o wand: the magick wand.
00357 %
00358 */
00359 WandExport MagickBooleanType IsPixelWand(const PixelWand *wand)
00360 {
00361   if (wand == (const PixelWand *) NULL)
00362     return(MagickFalse);
00363   if (wand->signature != WandSignature)
00364     return(MagickFalse);
00365   if (LocaleNCompare(wand->name,PixelWandId,strlen(PixelWandId)) != 0)
00366     return(MagickFalse);
00367   return(MagickTrue);
00368 }
00369 
00370 /*
00371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00372 %                                                                             %
00373 %                                                                             %
00374 %                                                                             %
00375 %   N e w P i x e l W a n d                                                   %
00376 %                                                                             %
00377 %                                                                             %
00378 %                                                                             %
00379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00380 %
00381 %  NewPixelWand() returns a new pixel wand.
00382 %
00383 %  The format of the NewPixelWand method is:
00384 %
00385 %      PixelWand *NewPixelWand(void)
00386 %
00387 */
00388 WandExport PixelWand *NewPixelWand(void)
00389 {
00390   const char
00391     *quantum;
00392 
00393   PixelWand
00394     *wand;
00395 
00396   size_t
00397     depth;
00398 
00399   depth=MAGICKCORE_QUANTUM_DEPTH;
00400   quantum=GetMagickQuantumDepth(&depth);
00401   if (depth != MAGICKCORE_QUANTUM_DEPTH)
00402     ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);
00403   wand=(PixelWand *) AcquireMagickMemory(sizeof(*wand));
00404   if (wand == (PixelWand *) NULL)
00405     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00406       GetExceptionMessage(errno));
00407   (void) ResetMagickMemory(wand,0,sizeof(*wand));
00408   wand->id=AcquireWandId();
00409   (void) FormatLocaleString(wand->name,MaxTextExtent,"%s-%.20g",PixelWandId,
00410     (double) wand->id);
00411   wand->exception=AcquireExceptionInfo();
00412   GetPixelInfo((Image *) NULL,&wand->pixel);
00413   wand->debug=IsEventLogging();
00414   if (wand->debug != MagickFalse)
00415     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00416   wand->signature=WandSignature;
00417   return(wand);
00418 }
00419 
00420 /*
00421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00422 %                                                                             %
00423 %                                                                             %
00424 %                                                                             %
00425 %   N e w P i x e l W a n d s                                                 %
00426 %                                                                             %
00427 %                                                                             %
00428 %                                                                             %
00429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00430 %
00431 %  NewPixelWands() returns an array of pixel wands.
00432 %
00433 %  The format of the NewPixelWands method is:
00434 %
00435 %      PixelWand **NewPixelWands(const size_t number_wands)
00436 %
00437 %  A description of each parameter follows:
00438 %
00439 %    o number_wands: the number of wands.
00440 %
00441 */
00442 WandExport PixelWand **NewPixelWands(const size_t number_wands)
00443 {
00444   register ssize_t
00445     i;
00446 
00447   PixelWand
00448     **wands;
00449 
00450   wands=(PixelWand **) AcquireQuantumMemory((size_t) number_wands,
00451     sizeof(*wands));
00452   if (wands == (PixelWand **) NULL)
00453     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00454       GetExceptionMessage(errno));
00455   for (i=0; i < (ssize_t) number_wands; i++)
00456     wands[i]=NewPixelWand();
00457   return(wands);
00458 }
00459 
00460 /*
00461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00462 %                                                                             %
00463 %                                                                             %
00464 %                                                                             %
00465 %   P i x e l C l e a r E x c e p t i o n                                     %
00466 %                                                                             %
00467 %                                                                             %
00468 %                                                                             %
00469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00470 %
00471 %  PixelClearException() clear any exceptions associated with the iterator.
00472 %
00473 %  The format of the PixelClearException method is:
00474 %
00475 %      MagickBooleanType PixelClearException(PixelWand *wand)
00476 %
00477 %  A description of each parameter follows:
00478 %
00479 %    o wand: the pixel wand.
00480 %
00481 */
00482 WandExport MagickBooleanType PixelClearException(PixelWand *wand)
00483 {
00484   assert(wand != (PixelWand *) NULL);
00485   assert(wand->signature == WandSignature);
00486   if (wand->debug != MagickFalse)
00487     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00488   ClearMagickException(wand->exception);
00489   return(MagickTrue);
00490 }
00491 
00492 /*
00493 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00494 %                                                                             %
00495 %                                                                             %
00496 %                                                                             %
00497 %   P i x e l G e t A l p h a                                                 %
00498 %                                                                             %
00499 %                                                                             %
00500 %                                                                             %
00501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00502 %
00503 %  PixelGetAlpha() returns the normalized alpha color of the pixel wand.
00504 %
00505 %  The format of the PixelGetAlpha method is:
00506 %
00507 %      double PixelGetAlpha(const PixelWand *wand)
00508 %
00509 %  A description of each parameter follows:
00510 %
00511 %    o wand: the pixel wand.
00512 %
00513 */
00514 WandExport double PixelGetAlpha(const PixelWand *wand)
00515 {
00516   assert(wand != (const PixelWand *) NULL);
00517   assert(wand->signature == WandSignature);
00518   if (wand->debug != MagickFalse)
00519     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00520   return((double) QuantumScale*wand->pixel.alpha);
00521 }
00522 
00523 /*
00524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00525 %                                                                             %
00526 %                                                                             %
00527 %                                                                             %
00528 %   P i x e l G e t A l p h a Q u a n t u m                                   %
00529 %                                                                             %
00530 %                                                                             %
00531 %                                                                             %
00532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00533 %
00534 %  PixelGetAlphaQuantum() returns the alpha value of the pixel wand.
00535 %
00536 %  The format of the PixelGetAlphaQuantum method is:
00537 %
00538 %      Quantum PixelGetAlphaQuantum(const PixelWand *wand)
00539 %
00540 %  A description of each parameter follows:
00541 %
00542 %    o wand: the pixel wand.
00543 %
00544 */
00545 WandExport Quantum PixelGetAlphaQuantum(const PixelWand *wand)
00546 {
00547   assert(wand != (const PixelWand *) NULL);
00548   assert(wand->signature == WandSignature);
00549   if (wand->debug != MagickFalse)
00550     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00551   return(ClampToQuantum(wand->pixel.alpha));
00552 }
00553 
00554 /*
00555 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00556 %                                                                             %
00557 %                                                                             %
00558 %                                                                             %
00559 %   P i x e l G e t B l a c k                                                 %
00560 %                                                                             %
00561 %                                                                             %
00562 %                                                                             %
00563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00564 %
00565 %  PixelGetBlack() returns the normalized black color of the pixel wand.
00566 %
00567 %  The format of the PixelGetBlack method is:
00568 %
00569 %      double PixelGetBlack(const PixelWand *wand)
00570 %
00571 %  A description of each parameter follows:
00572 %
00573 %    o wand: the pixel wand.
00574 %
00575 */
00576 WandExport double PixelGetBlack(const PixelWand *wand)
00577 {
00578   assert(wand != (const PixelWand *) NULL);
00579   assert(wand->signature == WandSignature);
00580   if (wand->debug != MagickFalse)
00581     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00582   return((double) QuantumScale*wand->pixel.black);
00583 }
00584 
00585 /*
00586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00587 %                                                                             %
00588 %                                                                             %
00589 %                                                                             %
00590 %   P i x e l G e t B l a c k Q u a n t u m                                   %
00591 %                                                                             %
00592 %                                                                             %
00593 %                                                                             %
00594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00595 %
00596 %  PixelGetBlackQuantum() returns the black color of the pixel wand.
00597 %
00598 %  The format of the PixelGetBlackQuantum method is:
00599 %
00600 %      Quantum PixelGetBlackQuantum(const PixelWand *wand)
00601 %
00602 %  A description of each parameter follows:
00603 %
00604 %    o wand: the pixel wand.
00605 %
00606 */
00607 WandExport Quantum PixelGetBlackQuantum(const PixelWand *wand)
00608 {
00609   assert(wand != (const PixelWand *) NULL);
00610   assert(wand->signature == WandSignature);
00611   if (wand->debug != MagickFalse)
00612     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00613   return(ClampToQuantum(wand->pixel.black));
00614 }
00615 
00616 /*
00617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00618 %                                                                             %
00619 %                                                                             %
00620 %                                                                             %
00621 %   P i x e l G e t B l u e                                                   %
00622 %                                                                             %
00623 %                                                                             %
00624 %                                                                             %
00625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00626 %
00627 %  PixelGetBlue() returns the normalized blue color of the pixel wand.
00628 %
00629 %  The format of the PixelGetBlue method is:
00630 %
00631 %      double PixelGetBlue(const PixelWand *wand)
00632 %
00633 %  A description of each parameter follows:
00634 %
00635 %    o wand: the pixel wand.
00636 %
00637 */
00638 WandExport double PixelGetBlue(const PixelWand *wand)
00639 {
00640   assert(wand != (const PixelWand *) NULL);
00641   assert(wand->signature == WandSignature);
00642   if (wand->debug != MagickFalse)
00643     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00644   return((double) QuantumScale*wand->pixel.blue);
00645 }
00646 
00647 /*
00648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00649 %                                                                             %
00650 %                                                                             %
00651 %                                                                             %
00652 %   P i x e l G e t B l u e Q u a n t u m                                     %
00653 %                                                                             %
00654 %                                                                             %
00655 %                                                                             %
00656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00657 %
00658 %  PixelGetBlueQuantum() returns the blue color of the pixel wand.
00659 %
00660 %  The format of the PixelGetBlueQuantum method is:
00661 %
00662 %      Quantum PixelGetBlueQuantum(const PixelWand *wand)
00663 %
00664 %  A description of each parameter follows:
00665 %
00666 %    o wand: the pixel wand.
00667 %
00668 */
00669 WandExport Quantum PixelGetBlueQuantum(const PixelWand *wand)
00670 {
00671   assert(wand != (const PixelWand *) NULL);
00672   assert(wand->signature == WandSignature);
00673   if (wand->debug != MagickFalse)
00674     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00675   return(ClampToQuantum(wand->pixel.blue));
00676 }
00677 
00678 /*
00679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00680 %                                                                             %
00681 %                                                                             %
00682 %                                                                             %
00683 %   P i x e l G e t C o l o r A s S t r i n g                                 %
00684 %                                                                             %
00685 %                                                                             %
00686 %                                                                             %
00687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00688 %
00689 %  PixelGetColorAsString() returnsd the color of the pixel wand as a string.
00690 %
00691 %  The format of the PixelGetColorAsString method is:
00692 %
00693 %      char *PixelGetColorAsString(PixelWand *wand)
00694 %
00695 %  A description of each parameter follows:
00696 %
00697 %    o wand: the pixel wand.
00698 %
00699 */
00700 WandExport char *PixelGetColorAsString(const PixelWand *wand)
00701 {
00702   char
00703     *color;
00704 
00705   PixelInfo
00706     pixel;
00707 
00708   assert(wand != (const PixelWand *) NULL);
00709   assert(wand->signature == WandSignature);
00710   if (wand->debug != MagickFalse)
00711     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00712   pixel=wand->pixel;
00713   color=AcquireString((const char *) NULL);
00714   GetColorTuple(&pixel,MagickFalse,color);
00715   return(color);
00716 }
00717 
00718 /*
00719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00720 %                                                                             %
00721 %                                                                             %
00722 %                                                                             %
00723 %   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             %
00724 %                                                                             %
00725 %                                                                             %
00726 %                                                                             %
00727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00728 %
00729 %  PixelGetColorAsNormalizedString() returns the normalized color of the pixel
00730 %  wand as a string.
00731 %
00732 %  The format of the PixelGetColorAsNormalizedString method is:
00733 %
00734 %      char *PixelGetColorAsNormalizedString(PixelWand *wand)
00735 %
00736 %  A description of each parameter follows:
00737 %
00738 %    o wand: the pixel wand.
00739 %
00740 */
00741 WandExport char *PixelGetColorAsNormalizedString(const PixelWand *wand)
00742 {
00743   char
00744     color[MaxTextExtent];
00745 
00746   assert(wand != (const PixelWand *) NULL);
00747   assert(wand->signature == WandSignature);
00748   if (wand->debug != MagickFalse)
00749     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00750   (void) FormatLocaleString(color,MaxTextExtent,"%g,%g,%g",
00751     (double) (QuantumScale*wand->pixel.red),
00752     (double) (QuantumScale*wand->pixel.green),
00753     (double) (QuantumScale*wand->pixel.blue));
00754   if (wand->pixel.colorspace == CMYKColorspace)
00755     (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
00756       (double) (QuantumScale*wand->pixel.black));
00757   if (wand->pixel.matte != MagickFalse)
00758     (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
00759       (double) (QuantumScale*wand->pixel.alpha));
00760   return(ConstantString(color));
00761 }
00762 
00763 /*
00764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00765 %                                                                             %
00766 %                                                                             %
00767 %                                                                             %
00768 %   P i x e l G e t C o l o r C o u n t                                       %
00769 %                                                                             %
00770 %                                                                             %
00771 %                                                                             %
00772 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00773 %
00774 %  PixelGetColorCount() returns the color count associated with this color.
00775 %
00776 %  The format of the PixelGetColorCount method is:
00777 %
00778 %      size_t PixelGetColorCount(const PixelWand *wand)
00779 %
00780 %  A description of each parameter follows:
00781 %
00782 %    o wand: the pixel wand.
00783 %
00784 */
00785 WandExport size_t PixelGetColorCount(const PixelWand *wand)
00786 {
00787   assert(wand != (const PixelWand *) NULL);
00788   assert(wand->signature == WandSignature);
00789   if (wand->debug != MagickFalse)
00790     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00791   return(wand->count);
00792 }
00793 
00794 /*
00795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00796 %                                                                             %
00797 %                                                                             %
00798 %                                                                             %
00799 %   P i x e l G e t C y a n                                                   %
00800 %                                                                             %
00801 %                                                                             %
00802 %                                                                             %
00803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00804 %
00805 %  PixelGetCyan() returns the normalized cyan color of the pixel wand.
00806 %
00807 %  The format of the PixelGetCyan method is:
00808 %
00809 %      double PixelGetCyan(const PixelWand *wand)
00810 %
00811 %  A description of each parameter follows:
00812 %
00813 %    o wand: the pixel wand.
00814 %
00815 */
00816 WandExport double PixelGetCyan(const PixelWand *wand)
00817 {
00818   assert(wand != (const PixelWand *) NULL);
00819   assert(wand->signature == WandSignature);
00820   if (wand->debug != MagickFalse)
00821     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00822   return((double) QuantumScale*wand->pixel.red);
00823 }
00824 
00825 /*
00826 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00827 %                                                                             %
00828 %                                                                             %
00829 %                                                                             %
00830 %   P i x e l G e t C y a n Q u a n t u m                                     %
00831 %                                                                             %
00832 %                                                                             %
00833 %                                                                             %
00834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00835 %
00836 %  PixelGetCyanQuantum() returns the cyan color of the pixel wand.
00837 %
00838 %  The format of the PixelGetCyanQuantum method is:
00839 %
00840 %      Quantum PixelGetCyanQuantum(const PixelWand *wand)
00841 %
00842 %  A description of each parameter follows:
00843 %
00844 %    o wand: the pixel wand.
00845 %
00846 */
00847 WandExport Quantum PixelGetCyanQuantum(const PixelWand *wand)
00848 {
00849   assert(wand != (const PixelWand *) NULL);
00850   assert(wand->signature == WandSignature);
00851   if (wand->debug != MagickFalse)
00852     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00853   return(ClampToQuantum(wand->pixel.red));
00854 }
00855 
00856 /*
00857 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00858 %                                                                             %
00859 %                                                                             %
00860 %                                                                             %
00861 %   P i x e l G e t E x c e p t i o n                                         %
00862 %                                                                             %
00863 %                                                                             %
00864 %                                                                             %
00865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00866 %
00867 %  PixelGetException() returns the severity, reason, and description of any
00868 %  error that occurs when using other methods in this API.
00869 %
00870 %  The format of the PixelGetException method is:
00871 %
00872 %      char *PixelGetException(const PixelWand *wand,ExceptionType *severity)
00873 %
00874 %  A description of each parameter follows:
00875 %
00876 %    o wand: the pixel wand.
00877 %
00878 %    o severity: the severity of the error is returned here.
00879 %
00880 */
00881 WandExport char *PixelGetException(const PixelWand *wand,
00882   ExceptionType *severity)
00883 {
00884   char
00885     *description;
00886 
00887   assert(wand != (const PixelWand *) NULL);
00888   assert(wand->signature == WandSignature);
00889   if (wand->debug != MagickFalse)
00890     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00891   assert(severity != (ExceptionType *) NULL);
00892   *severity=wand->exception->severity;
00893   description=(char *) AcquireQuantumMemory(2UL*MaxTextExtent,
00894     sizeof(*description));
00895   if (description == (char *) NULL)
00896     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00897       wand->name);
00898   *description='\0';
00899   if (wand->exception->reason != (char *) NULL)
00900     (void) CopyMagickString(description,GetLocaleExceptionMessage(
00901       wand->exception->severity,wand->exception->reason),MaxTextExtent);
00902   if (wand->exception->description != (char *) NULL)
00903     {
00904       (void) ConcatenateMagickString(description," (",MaxTextExtent);
00905       (void) ConcatenateMagickString(description,GetLocaleExceptionMessage(
00906         wand->exception->severity,wand->exception->description),MaxTextExtent);
00907       (void) ConcatenateMagickString(description,")",MaxTextExtent);
00908     }
00909   return(description);
00910 }
00911 
00912 /*
00913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00914 %                                                                             %
00915 %                                                                             %
00916 %                                                                             %
00917 %   P i x e l G e t E x c e p t i o n T y p e                                 %
00918 %                                                                             %
00919 %                                                                             %
00920 %                                                                             %
00921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00922 %
00923 %  PixelGetExceptionType() the exception type associated with the wand.  If
00924 %  no exception has occurred, UndefinedExceptionType is returned.
00925 %
00926 %  The format of the PixelGetExceptionType method is:
00927 %
00928 %      ExceptionType PixelGetExceptionType(const PixelWand *wand)
00929 %
00930 %  A description of each parameter follows:
00931 %
00932 %    o wand: the magick wand.
00933 %
00934 */
00935 WandExport ExceptionType PixelGetExceptionType(const PixelWand *wand)
00936 {
00937   assert(wand != (const PixelWand *) NULL);
00938   assert(wand->signature == WandSignature);
00939   if (wand->debug != MagickFalse)
00940     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00941   return(wand->exception->severity);
00942 }
00943 
00944 /*
00945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00946 %                                                                             %
00947 %                                                                             %
00948 %                                                                             %
00949 %   P i x e l G e t F u z z                                                   %
00950 %                                                                             %
00951 %                                                                             %
00952 %                                                                             %
00953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00954 %
00955 %  PixelGetFuzz() returns the normalized fuzz value of the pixel wand.
00956 %
00957 %  The format of the PixelGetFuzz method is:
00958 %
00959 %      double PixelGetFuzz(const PixelWand *wand)
00960 %
00961 %  A description of each parameter follows:
00962 %
00963 %    o wand: the pixel wand.
00964 %
00965 */
00966 WandExport double PixelGetFuzz(const PixelWand *wand)
00967 {
00968   assert(wand != (const PixelWand *) NULL);
00969   assert(wand->signature == WandSignature);
00970   if (wand->debug != MagickFalse)
00971     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00972   return((double) wand->pixel.fuzz);
00973 }
00974 
00975 /*
00976 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00977 %                                                                             %
00978 %                                                                             %
00979 %                                                                             %
00980 %   P i x e l G e t G r e e n                                                 %
00981 %                                                                             %
00982 %                                                                             %
00983 %                                                                             %
00984 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00985 %
00986 %  PixelGetGreen() returns the normalized green color of the pixel wand.
00987 %
00988 %  The format of the PixelGetGreen method is:
00989 %
00990 %      double PixelGetGreen(const PixelWand *wand)
00991 %
00992 %  A description of each parameter follows:
00993 %
00994 %    o wand: the pixel wand.
00995 %
00996 */
00997 WandExport double PixelGetGreen(const PixelWand *wand)
00998 {
00999   assert(wand != (const PixelWand *) NULL);
01000   assert(wand->signature == WandSignature);
01001   if (wand->debug != MagickFalse)
01002     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01003   return((double) QuantumScale*wand->pixel.green);
01004 }
01005 
01006 /*
01007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01008 %                                                                             %
01009 %                                                                             %
01010 %                                                                             %
01011 %   P i x e l G e t G r e e n Q u a n t u m                                   %
01012 %                                                                             %
01013 %                                                                             %
01014 %                                                                             %
01015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01016 %
01017 %  PixelGetGreenQuantum() returns the green color of the pixel wand.
01018 %
01019 %  The format of the PixelGetGreenQuantum method is:
01020 %
01021 %      Quantum PixelGetGreenQuantum(const PixelWand *wand)
01022 %
01023 %  A description of each parameter follows:
01024 %
01025 %    o wand: the pixel wand.
01026 %
01027 */
01028 WandExport Quantum PixelGetGreenQuantum(const PixelWand *wand)
01029 {
01030   assert(wand != (const PixelWand *) NULL);
01031   assert(wand->signature == WandSignature);
01032   if (wand->debug != MagickFalse)
01033     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01034   return(ClampToQuantum(wand->pixel.green));
01035 }
01036 
01037 /*
01038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01039 %                                                                             %
01040 %                                                                             %
01041 %                                                                             %
01042 %   P i x e l G e t H S L                                                     %
01043 %                                                                             %
01044 %                                                                             %
01045 %                                                                             %
01046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01047 %
01048 %  PixelGetHSL() returns the normalized HSL color of the pixel wand.
01049 %
01050 %  The format of the PixelGetHSL method is:
01051 %
01052 %      void PixelGetHSL(const PixelWand *wand,double *hue,double *saturation,
01053 %        double *lightness)
01054 %
01055 %  A description of each parameter follows:
01056 %
01057 %    o wand: the pixel wand.
01058 %
01059 %    o hue,saturation,lightness: Return the pixel hue, saturation, and
01060 %      brightness.
01061 %
01062 */
01063 WandExport void PixelGetHSL(const PixelWand *wand,double *hue,
01064   double *saturation,double *lightness)
01065 {
01066   assert(wand != (const PixelWand *) NULL);
01067   assert(wand->signature == WandSignature);
01068   if (wand->debug != MagickFalse)
01069     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01070   ConvertRGBToHSL((double) ClampToQuantum(wand->pixel.red),(double)
01071     ClampToQuantum(wand->pixel.green),(double) ClampToQuantum(wand->pixel.blue),
01072     hue,saturation,lightness);
01073 }
01074 
01075 /*
01076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01077 %                                                                             %
01078 %                                                                             %
01079 %                                                                             %
01080 %   P i x e l G e t I n d e x                                                 %
01081 %                                                                             %
01082 %                                                                             %
01083 %                                                                             %
01084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01085 %
01086 %  PixelGetIndex() returns the colormap index from the pixel wand.
01087 %
01088 %  The format of the PixelGetIndex method is:
01089 %
01090 %      Quantum PixelGetIndex(const PixelWand *wand)
01091 %
01092 %  A description of each parameter follows:
01093 %
01094 %    o wand: the pixel wand.
01095 %
01096 */
01097 WandExport Quantum PixelGetIndex(const PixelWand *wand)
01098 {
01099   assert(wand != (const PixelWand *) NULL);
01100   assert(wand->signature == WandSignature);
01101   if (wand->debug != MagickFalse)
01102     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01103   return((Quantum) wand->pixel.black);
01104 }
01105 
01106 /*
01107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01108 %                                                                             %
01109 %                                                                             %
01110 %                                                                             %
01111 %   P i x e l G e t M a g e n t a                                             %
01112 %                                                                             %
01113 %                                                                             %
01114 %                                                                             %
01115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01116 %
01117 %  PixelGetMagenta() returns the normalized magenta color of the pixel wand.
01118 %
01119 %  The format of the PixelGetMagenta method is:
01120 %
01121 %      double PixelGetMagenta(const PixelWand *wand)
01122 %
01123 %  A description of each parameter follows:
01124 %
01125 %    o wand: the pixel wand.
01126 %
01127 */
01128 WandExport double PixelGetMagenta(const PixelWand *wand)
01129 {
01130   assert(wand != (const PixelWand *) NULL);
01131   assert(wand->signature == WandSignature);
01132   if (wand->debug != MagickFalse)
01133     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01134   return((double) QuantumScale*wand->pixel.green);
01135 }
01136 
01137 /*
01138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01139 %                                                                             %
01140 %                                                                             %
01141 %                                                                             %
01142 %   P i x e l G e t M a g e n t a Q u a n t u m                               %
01143 %                                                                             %
01144 %                                                                             %
01145 %                                                                             %
01146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01147 %
01148 %  PixelGetMagentaQuantum() returns the magenta color of the pixel wand.
01149 %
01150 %  The format of the PixelGetMagentaQuantum method is:
01151 %
01152 %      Quantum PixelGetMagentaQuantum(const PixelWand *wand)
01153 %
01154 %  A description of each parameter follows:
01155 %
01156 %    o wand: the pixel wand.
01157 %
01158 */
01159 WandExport Quantum PixelGetMagentaQuantum(const PixelWand *wand)
01160 {
01161   assert(wand != (const PixelWand *) NULL);
01162   assert(wand->signature == WandSignature);
01163   if (wand->debug != MagickFalse)
01164     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01165   return(ClampToQuantum(wand->pixel.green));
01166 }
01167 
01168 /*
01169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01170 %                                                                             %
01171 %                                                                             %
01172 %                                                                             %
01173 %   P i x e l G e t M a g i c k C o l o r                                     %
01174 %                                                                             %
01175 %                                                                             %
01176 %                                                                             %
01177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01178 %
01179 %  PixelGetMagickColor() gets the magick color of the pixel wand.
01180 %
01181 %  The format of the PixelGetMagickColor method is:
01182 %
01183 %      void PixelGetMagickColor(PixelWand *wand,PixelInfo *color)
01184 %
01185 %  A description of each parameter follows:
01186 %
01187 %    o wand: the pixel wand.
01188 %
01189 %    o color:  The pixel wand color is returned here.
01190 %
01191 */
01192 WandExport void PixelGetMagickColor(const PixelWand *wand,
01193   PixelInfo *color)
01194 {
01195   assert(wand != (const PixelWand *) NULL);
01196   assert(wand->signature == WandSignature);
01197   if (wand->debug != MagickFalse)
01198     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01199   assert(color != (PixelInfo *) NULL);
01200   *color=wand->pixel;
01201 }
01202 
01203 /*
01204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01205 %                                                                             %
01206 %                                                                             %
01207 %                                                                             %
01208 %   P i x e l G e t P i x e l                                                 %
01209 %                                                                             %
01210 %                                                                             %
01211 %                                                                             %
01212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01213 %
01214 %  PixelGetPixel() returns the pixel wand pixel.
01215 %
01216 %  The format of the PixelGetPixel method is:
01217 %
01218 %      PixelInfo PixelGetPixel(const PixelWand *wand)
01219 %
01220 %  A description of each parameter follows:
01221 %
01222 %    o wand: the pixel wand.
01223 %
01224 */
01225 WandExport PixelInfo PixelGetPixel(const PixelWand *wand)
01226 {
01227   assert(wand != (const PixelWand *) NULL);
01228   assert(wand->signature == WandSignature);
01229   if (wand->debug != MagickFalse)
01230     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01231   return(wand->pixel);
01232 }
01233 
01234 /*
01235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01236 %                                                                             %
01237 %                                                                             %
01238 %                                                                             %
01239 %   P i x e l G e t Q u a n t u m P a c k e t                                 %
01240 %                                                                             %
01241 %                                                                             %
01242 %                                                                             %
01243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01244 %
01245 %  PixelGetQuantumPacket() gets the packet of the pixel wand as a PixelInfo.
01246 %
01247 %  The format of the PixelGetQuantumPacket method is:
01248 %
01249 %      void PixelGetQuantumPacket(PixelWand *wand,PixelInfo *packet)
01250 %
01251 %  A description of each parameter follows:
01252 %
01253 %    o wand: the pixel wand.
01254 %
01255 %    o packet:  The pixel wand packet is returned here.
01256 %
01257 */
01258 WandExport void PixelGetQuantumPacket(const PixelWand *wand,PixelInfo *packet)
01259 {
01260   assert(wand != (const PixelWand *) NULL);
01261   assert(wand->signature == WandSignature);
01262   if (wand->debug != MagickFalse)
01263     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01264   assert(packet != (PixelInfo *) NULL);
01265   packet->alpha=(double) ClampToQuantum(wand->pixel.alpha);
01266   if (wand->pixel.colorspace == CMYKColorspace)
01267     {
01268       packet->red=(double) ClampToQuantum((MagickRealType) QuantumRange-
01269         (wand->pixel.red*(QuantumRange-wand->pixel.black)+
01270         wand->pixel.black));
01271       packet->green=(double) ClampToQuantum((MagickRealType) QuantumRange-
01272         (wand->pixel.green*(QuantumRange-wand->pixel.black)+
01273         wand->pixel.black));
01274       packet->blue=(double) ClampToQuantum((MagickRealType) QuantumRange-
01275         (wand->pixel.blue*(QuantumRange-wand->pixel.black)+
01276         wand->pixel.black));
01277       packet->black=(double) ClampToQuantum(wand->pixel.black);
01278       return;
01279     }
01280   packet->red=(double) ClampToQuantum(wand->pixel.red);
01281   packet->green=(double) ClampToQuantum(wand->pixel.green);
01282   packet->blue=(double) ClampToQuantum(wand->pixel.blue);
01283 }
01284 
01285 /*
01286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01287 %                                                                             %
01288 %                                                                             %
01289 %                                                                             %
01290 %   P i x e l G e t Q u a n t u m P i x e l                                   %
01291 %                                                                             %
01292 %                                                                             %
01293 %                                                                             %
01294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01295 %
01296 %  PixelGetQuantumPixel() gets the pixel of the pixel wand as a PixelInfo.
01297 %
01298 %  The format of the PixelGetQuantumPixel method is:
01299 %
01300 %      void PixelGetQuantumPixel(const Image *image,const PixelWand *wand,
01301 %        Quantum *pixel)
01302 %
01303 %  A description of each parameter follows:
01304 %
01305 %    o wand: the pixel wand.
01306 %
01307 %    o pixel:  The pixel wand pixel is returned here.
01308 %
01309 */
01310 WandExport void PixelGetQuantumPixel(const Image *image,const PixelWand *wand,
01311   Quantum *pixel)
01312 {
01313   assert(wand != (const PixelWand *) NULL);
01314   assert(wand->signature == WandSignature);
01315   if (wand->debug != MagickFalse)
01316     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01317   assert(pixel != (Quantum *) NULL);
01318   SetPixelAlpha(image,ClampToQuantum(wand->pixel.alpha),pixel);
01319   if (wand->pixel.colorspace == CMYKColorspace)
01320     {
01321       SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange-
01322         (wand->pixel.red*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
01323         pixel);
01324       SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange-
01325         (wand->pixel.green*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
01326         pixel);
01327       SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange-
01328         (wand->pixel.blue*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
01329         pixel);
01330       SetPixelBlack(image,ClampToQuantum(wand->pixel.black),pixel);
01331       return;
01332     }
01333   SetPixelRed(image,ClampToQuantum(wand->pixel.red),pixel);
01334   SetPixelGreen(image,ClampToQuantum(wand->pixel.green),pixel);
01335   SetPixelBlue(image,ClampToQuantum(wand->pixel.blue),pixel);
01336 }
01337 
01338 /*
01339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01340 %                                                                             %
01341 %                                                                             %
01342 %                                                                             %
01343 %   P i x e l G e t R e d                                                     %
01344 %                                                                             %
01345 %                                                                             %
01346 %                                                                             %
01347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01348 %
01349 %  PixelGetRed() returns the normalized red color of the pixel wand.
01350 %
01351 %  The format of the PixelGetRed method is:
01352 %
01353 %      double PixelGetRed(const PixelWand *wand)
01354 %
01355 %  A description of each parameter follows:
01356 %
01357 %    o wand: the pixel wand.
01358 %
01359 */
01360 WandExport double PixelGetRed(const PixelWand *wand)
01361 {
01362   assert(wand != (const PixelWand *) NULL);
01363   assert(wand->signature == WandSignature);
01364   if (wand->debug != MagickFalse)
01365     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01366   return((double) QuantumScale*wand->pixel.red);
01367 }
01368 
01369 /*
01370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01371 %                                                                             %
01372 %                                                                             %
01373 %                                                                             %
01374 %   P i x e l G e t R e d Q u a n t u m                                       %
01375 %                                                                             %
01376 %                                                                             %
01377 %                                                                             %
01378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01379 %
01380 %  PixelGetRedQuantum() returns the red color of the pixel wand.
01381 %
01382 %  The format of the PixelGetRedQuantum method is:
01383 %
01384 %      Quantum PixelGetRedQuantum(const PixelWand *wand)
01385 %
01386 %  A description of each parameter follows:
01387 %
01388 %    o wand: the pixel wand.
01389 %
01390 */
01391 WandExport Quantum PixelGetRedQuantum(const PixelWand *wand)
01392 {
01393   assert(wand != (const PixelWand *) NULL);
01394   assert(wand->signature == WandSignature);
01395   if (wand->debug != MagickFalse)
01396     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01397   return(ClampToQuantum(wand->pixel.red));
01398 }
01399 
01400 /*
01401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01402 %                                                                             %
01403 %                                                                             %
01404 %                                                                             %
01405 %   P i x e l G e t Y e l l o w                                               %
01406 %                                                                             %
01407 %                                                                             %
01408 %                                                                             %
01409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01410 %
01411 %  PixelGetYellow() returns the normalized yellow color of the pixel wand.
01412 %
01413 %  The format of the PixelGetYellow method is:
01414 %
01415 %      double PixelGetYellow(const PixelWand *wand)
01416 %
01417 %  A description of each parameter follows:
01418 %
01419 %    o wand: the pixel wand.
01420 %
01421 */
01422 WandExport double PixelGetYellow(const PixelWand *wand)
01423 {
01424   assert(wand != (const PixelWand *) NULL);
01425   assert(wand->signature == WandSignature);
01426   if (wand->debug != MagickFalse)
01427     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01428   return((double) QuantumScale*wand->pixel.blue);
01429 }
01430 
01431 /*
01432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01433 %                                                                             %
01434 %                                                                             %
01435 %                                                                             %
01436 %   P i x e l G e t Y e l l o w Q u a n t u m                                 %
01437 %                                                                             %
01438 %                                                                             %
01439 %                                                                             %
01440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01441 %
01442 %  PixelGetYellowQuantum() returns the yellow color of the pixel wand.
01443 %
01444 %  The format of the PixelGetYellowQuantum method is:
01445 %
01446 %      Quantum PixelGetYellowQuantum(const PixelWand *wand)
01447 %
01448 %  A description of each parameter follows:
01449 %
01450 %    o wand: the pixel wand.
01451 %
01452 */
01453 WandExport Quantum PixelGetYellowQuantum(const PixelWand *wand)
01454 {
01455   assert(wand != (const PixelWand *) NULL);
01456   assert(wand->signature == WandSignature);
01457   if (wand->debug != MagickFalse)
01458     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01459   return(ClampToQuantum(wand->pixel.blue));
01460 }
01461 
01462 /*
01463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01464 %                                                                             %
01465 %                                                                             %
01466 %                                                                             %
01467 %   P i x e l S e t A l p h a                                                 %
01468 %                                                                             %
01469 %                                                                             %
01470 %                                                                             %
01471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01472 %
01473 %  PixelSetAlpha() sets the normalized alpha color of the pixel wand.
01474 %
01475 %  The format of the PixelSetAlpha method is:
01476 %
01477 %      void PixelSetAlpha(PixelWand *wand,const double alpha)
01478 %
01479 %  A description of each parameter follows:
01480 %
01481 %    o wand: the pixel wand.
01482 %
01483 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
01484 %      transparent.
01485 %
01486 */
01487 WandExport void PixelSetAlpha(PixelWand *wand,const double alpha)
01488 {
01489   assert(wand != (const PixelWand *) NULL);
01490   assert(wand->signature == WandSignature);
01491   if (wand->debug != MagickFalse)
01492     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01493   wand->pixel.alpha=(double) ClampToQuantum(QuantumRange*alpha);
01494 }
01495 
01496 /*
01497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01498 %                                                                             %
01499 %                                                                             %
01500 %                                                                             %
01501 %   P i x e l S e t A l p h a Q u a n t u m                                   %
01502 %                                                                             %
01503 %                                                                             %
01504 %                                                                             %
01505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01506 %
01507 %  PixelSetAlphaQuantum() sets the alpha color of the pixel wand.
01508 %
01509 %  The format of the PixelSetAlphaQuantum method is:
01510 %
01511 %      void PixelSetAlphaQuantum(PixelWand *wand,
01512 %        const Quantum alpha)
01513 %
01514 %  A description of each parameter follows:
01515 %
01516 %    o wand: the pixel wand.
01517 %
01518 %    o alpha: the alpha color.
01519 %
01520 */
01521 WandExport void PixelSetAlphaQuantum(PixelWand *wand,const Quantum alpha)
01522 {
01523   assert(wand != (const PixelWand *) NULL);
01524   assert(wand->signature == WandSignature);
01525   if (wand->debug != MagickFalse)
01526     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01527   wand->pixel.alpha=(MagickRealType) alpha;
01528 }
01529 
01530 /*
01531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01532 %                                                                             %
01533 %                                                                             %
01534 %                                                                             %
01535 %   P i x e l S e t B l a c k                                                 %
01536 %                                                                             %
01537 %                                                                             %
01538 %                                                                             %
01539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01540 %
01541 %  PixelSetBlack() sets the normalized black color of the pixel wand.
01542 %
01543 %  The format of the PixelSetBlack method is:
01544 %
01545 %      void PixelSetBlack(PixelWand *wand,const double black)
01546 %
01547 %  A description of each parameter follows:
01548 %
01549 %    o wand: the pixel wand.
01550 %
01551 %    o black: the black color.
01552 %
01553 */
01554 WandExport void PixelSetBlack(PixelWand *wand,const double black)
01555 {
01556   assert(wand != (const PixelWand *) NULL);
01557   assert(wand->signature == WandSignature);
01558   if (wand->debug != MagickFalse)
01559     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01560   wand->pixel.black=(MagickRealType) ClampToQuantum((MagickRealType)
01561     QuantumRange*black);
01562 }
01563 
01564 /*
01565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01566 %                                                                             %
01567 %                                                                             %
01568 %                                                                             %
01569 %   P i x e l S e t B l a c k Q u a n t u m                                   %
01570 %                                                                             %
01571 %                                                                             %
01572 %                                                                             %
01573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01574 %
01575 %  PixelSetBlackQuantum() sets the black color of the pixel wand.
01576 %
01577 %  The format of the PixelSetBlackQuantum method is:
01578 %
01579 %      void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
01580 %
01581 %  A description of each parameter follows:
01582 %
01583 %    o wand: the pixel wand.
01584 %
01585 %    o black: the black color.
01586 %
01587 */
01588 WandExport void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
01589 {
01590   assert(wand != (const PixelWand *) NULL);
01591   assert(wand->signature == WandSignature);
01592   if (wand->debug != MagickFalse)
01593     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01594   wand->pixel.black=(MagickRealType) black;
01595 }
01596 
01597 /*
01598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01599 %                                                                             %
01600 %                                                                             %
01601 %                                                                             %
01602 %   P i x e l S e t B l u e                                                   %
01603 %                                                                             %
01604 %                                                                             %
01605 %                                                                             %
01606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01607 %
01608 %  PixelSetBlue() sets the normalized blue color of the pixel wand.
01609 %
01610 %  The format of the PixelSetBlue method is:
01611 %
01612 %      void PixelSetBlue(PixelWand *wand,const double blue)
01613 %
01614 %  A description of each parameter follows:
01615 %
01616 %    o wand: the pixel wand.
01617 %
01618 %    o blue: the blue color.
01619 %
01620 */
01621 WandExport void PixelSetBlue(PixelWand *wand,const double blue)
01622 {
01623   assert(wand != (const PixelWand *) NULL);
01624   assert(wand->signature == WandSignature);
01625   if (wand->debug != MagickFalse)
01626     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01627   wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
01628     QuantumRange*blue);
01629 }
01630 
01631 /*
01632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01633 %                                                                             %
01634 %                                                                             %
01635 %                                                                             %
01636 %   P i x e l S e t B l u e Q u a n t u m                                     %
01637 %                                                                             %
01638 %                                                                             %
01639 %                                                                             %
01640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01641 %
01642 %  PixelSetBlueQuantum() sets the blue color of the pixel wand.
01643 %
01644 %  The format of the PixelSetBlueQuantum method is:
01645 %
01646 %      void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
01647 %
01648 %  A description of each parameter follows:
01649 %
01650 %    o wand: the pixel wand.
01651 %
01652 %    o blue: the blue color.
01653 %
01654 */
01655 WandExport void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
01656 {
01657   assert(wand != (const PixelWand *) NULL);
01658   assert(wand->signature == WandSignature);
01659   if (wand->debug != MagickFalse)
01660     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01661   wand->pixel.blue=(MagickRealType) blue;
01662 }
01663 
01664 /*
01665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01666 %                                                                             %
01667 %                                                                             %
01668 %                                                                             %
01669 %   P i x e l S e t C o l o r                                                 %
01670 %                                                                             %
01671 %                                                                             %
01672 %                                                                             %
01673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01674 %
01675 %  PixelSetColor() sets the color of the pixel wand with a string (e.g.
01676 %  "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.).
01677 %
01678 %  The format of the PixelSetColor method is:
01679 %
01680 %      MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
01681 %
01682 %  A description of each parameter follows:
01683 %
01684 %    o wand: the pixel wand.
01685 %
01686 %    o color: the pixel wand color.
01687 %
01688 */
01689 WandExport MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
01690 {
01691   MagickBooleanType
01692     status;
01693 
01694   PixelInfo
01695     pixel;
01696 
01697   assert(wand != (const PixelWand *) NULL);
01698   assert(wand->signature == WandSignature);
01699   if (wand->debug != MagickFalse)
01700     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01701   status=QueryColorCompliance(color,AllCompliance,&pixel,wand->exception);
01702   if (status != MagickFalse)
01703     wand->pixel=pixel;
01704   return(status);
01705 }
01706 
01707 /*
01708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01709 %                                                                             %
01710 %                                                                             %
01711 %                                                                             %
01712 %   P i x e l S e t C o l o r C o u n t                                       %
01713 %                                                                             %
01714 %                                                                             %
01715 %                                                                             %
01716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01717 %
01718 %  PixelSetColorCount() sets the color count of the pixel wand.
01719 %
01720 %  The format of the PixelSetColorCount method is:
01721 %
01722 %      void PixelSetColorCount(PixelWand *wand,const size_t count)
01723 %
01724 %  A description of each parameter follows:
01725 %
01726 %    o wand: the pixel wand.
01727 %
01728 %    o count: the number of this particular color.
01729 %
01730 */
01731 WandExport void PixelSetColorCount(PixelWand *wand,const size_t count)
01732 {
01733   assert(wand != (const PixelWand *) NULL);
01734   assert(wand->signature == WandSignature);
01735   if (wand->debug != MagickFalse)
01736     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01737   wand->count=count;
01738 }
01739 
01740 /*
01741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01742 %                                                                             %
01743 %                                                                             %
01744 %                                                                             %
01745 %   P i x e l S e t C o l o r F r o m W a n d                                 %
01746 %                                                                             %
01747 %                                                                             %
01748 %                                                                             %
01749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01750 %
01751 %  PixelSetColorFromWand() sets the color of the pixel wand.
01752 %
01753 %  The format of the PixelSetColorFromWand method is:
01754 %
01755 %      PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
01756 %
01757 %  A description of each parameter follows:
01758 %
01759 %    o wand: the pixel wand.
01760 %
01761 %    o color: set the pixel wand color here.
01762 %
01763 */
01764 WandExport void PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
01765 {
01766   assert(wand != (const PixelWand *) NULL);
01767   assert(wand->signature == WandSignature);
01768   if (wand->debug != MagickFalse)
01769     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01770   assert(color != (const PixelWand *) NULL);
01771   wand->pixel=color->pixel;
01772 }
01773 
01774 /*
01775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01776 %                                                                             %
01777 %                                                                             %
01778 %                                                                             %
01779 %   P i x e l S e t C y a n                                                   %
01780 %                                                                             %
01781 %                                                                             %
01782 %                                                                             %
01783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01784 %
01785 %  PixelSetCyan() sets the normalized cyan color of the pixel wand.
01786 %
01787 %  The format of the PixelSetCyan method is:
01788 %
01789 %      void PixelSetCyan(PixelWand *wand,const double cyan)
01790 %
01791 %  A description of each parameter follows:
01792 %
01793 %    o wand: the pixel wand.
01794 %
01795 %    o cyan: the cyan color.
01796 %
01797 */
01798 WandExport void PixelSetCyan(PixelWand *wand,const double cyan)
01799 {
01800   assert(wand != (const PixelWand *) NULL);
01801   assert(wand->signature == WandSignature);
01802   if (wand->debug != MagickFalse)
01803     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01804   wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
01805     QuantumRange*cyan);
01806 }
01807 
01808 /*
01809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01810 %                                                                             %
01811 %                                                                             %
01812 %                                                                             %
01813 %   P i x e l S e t C y a n Q u a n t u m                                     %
01814 %                                                                             %
01815 %                                                                             %
01816 %                                                                             %
01817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01818 %
01819 %  PixelSetCyanQuantum() sets the cyan color of the pixel wand.
01820 %
01821 %  The format of the PixelSetCyanQuantum method is:
01822 %
01823 %      void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
01824 %
01825 %  A description of each parameter follows:
01826 %
01827 %    o wand: the pixel wand.
01828 %
01829 %    o cyan: the cyan color.
01830 %
01831 */
01832 WandExport void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
01833 {
01834   assert(wand != (const PixelWand *) NULL);
01835   assert(wand->signature == WandSignature);
01836   if (wand->debug != MagickFalse)
01837     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01838   wand->pixel.red=(MagickRealType) cyan;
01839 }
01840 
01841 /*
01842 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01843 %                                                                             %
01844 %                                                                             %
01845 %                                                                             %
01846 %   P i x e l S e t F u z z                                                   %
01847 %                                                                             %
01848 %                                                                             %
01849 %                                                                             %
01850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01851 %
01852 %  PixelSetFuzz() sets the fuzz value of the pixel wand.
01853 %
01854 %  The format of the PixelSetFuzz method is:
01855 %
01856 %      void PixelSetFuzz(PixelWand *wand,const double fuzz)
01857 %
01858 %  A description of each parameter follows:
01859 %
01860 %    o wand: the pixel wand.
01861 %
01862 %    o fuzz: the fuzz value.
01863 %
01864 */
01865 WandExport void PixelSetFuzz(PixelWand *wand,const double fuzz)
01866 {
01867   assert(wand != (const PixelWand *) NULL);
01868   assert(wand->signature == WandSignature);
01869   if (wand->debug != MagickFalse)
01870     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01871   wand->pixel.fuzz=(MagickRealType) fuzz;
01872 }
01873 
01874 /*
01875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01876 %                                                                             %
01877 %                                                                             %
01878 %                                                                             %
01879 %   P i x e l S e t G r e e n                                                 %
01880 %                                                                             %
01881 %                                                                             %
01882 %                                                                             %
01883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01884 %
01885 %  PixelSetGreen() sets the normalized green color of the pixel wand.
01886 %
01887 %  The format of the PixelSetGreen method is:
01888 %
01889 %      void PixelSetGreen(PixelWand *wand,const double green)
01890 %
01891 %  A description of each parameter follows:
01892 %
01893 %    o wand: the pixel wand.
01894 %
01895 %    o green: the green color.
01896 %
01897 */
01898 WandExport void PixelSetGreen(PixelWand *wand,const double green)
01899 {
01900   assert(wand != (const PixelWand *) NULL);
01901   assert(wand->signature == WandSignature);
01902   if (wand->debug != MagickFalse)
01903     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01904   wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
01905     QuantumRange*green);
01906 }
01907 
01908 /*
01909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01910 %                                                                             %
01911 %                                                                             %
01912 %                                                                             %
01913 %   P i x e l S e t G r e e n Q u a n t u m                                   %
01914 %                                                                             %
01915 %                                                                             %
01916 %                                                                             %
01917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01918 %
01919 %  PixelSetGreenQuantum() sets the green color of the pixel wand.
01920 %
01921 %  The format of the PixelSetGreenQuantum method is:
01922 %
01923 %      void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
01924 %
01925 %  A description of each parameter follows:
01926 %
01927 %    o wand: the pixel wand.
01928 %
01929 %    o green: the green color.
01930 %
01931 */
01932 WandExport void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
01933 {
01934   assert(wand != (const PixelWand *) NULL);
01935   assert(wand->signature == WandSignature);
01936   if (wand->debug != MagickFalse)
01937     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01938   wand->pixel.green=(MagickRealType) green;
01939 }
01940 
01941 /*
01942 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01943 %                                                                             %
01944 %                                                                             %
01945 %                                                                             %
01946 %   P i x e l S e t H S L                                                     %
01947 %                                                                             %
01948 %                                                                             %
01949 %                                                                             %
01950 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01951 %
01952 %  PixelSetHSL() sets the normalized HSL color of the pixel wand.
01953 %
01954 %  The format of the PixelSetHSL method is:
01955 %
01956 %      void PixelSetHSL(PixelWand *wand,const double hue,
01957 %        const double saturation,const double lightness)
01958 %
01959 %  A description of each parameter follows:
01960 %
01961 %    o wand: the pixel wand.
01962 %
01963 %    o hue,saturation,lightness: Return the pixel hue, saturation, and
01964 %      brightness.
01965 %
01966 */
01967 WandExport void PixelSetHSL(PixelWand *wand,const double hue,
01968   const double saturation,const double lightness)
01969 {
01970   double
01971     blue,
01972     green,
01973     red;
01974 
01975   assert(wand != (const PixelWand *) NULL);
01976   assert(wand->signature == WandSignature);
01977   if (wand->debug != MagickFalse)
01978     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01979   ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
01980   wand->pixel.red=(MagickRealType) red;
01981   wand->pixel.green=(MagickRealType) green;
01982   wand->pixel.blue=(MagickRealType) blue;
01983 }
01984 
01985 /*
01986 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01987 %                                                                             %
01988 %                                                                             %
01989 %                                                                             %
01990 %   P i x e l S e t I n d e x                                                 %
01991 %                                                                             %
01992 %                                                                             %
01993 %                                                                             %
01994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01995 %
01996 %  PixelSetIndex() sets the colormap index of the pixel wand.
01997 %
01998 %  The format of the PixelSetIndex method is:
01999 %
02000 %      void PixelSetIndex(PixelWand *wand,const Quantum index)
02001 %
02002 %  A description of each parameter follows:
02003 %
02004 %    o wand: the pixel wand.
02005 %
02006 %    o index: the colormap index.
02007 %
02008 */
02009 WandExport void PixelSetIndex(PixelWand *wand,const Quantum index)
02010 {
02011   assert(wand != (const PixelWand *) NULL);
02012   assert(wand->signature == WandSignature);
02013   if (wand->debug != MagickFalse)
02014     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02015   wand->pixel.index=(MagickRealType) index;
02016 }
02017 
02018 /*
02019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02020 %                                                                             %
02021 %                                                                             %
02022 %                                                                             %
02023 %   P i x e l S e t M a g e n t a                                             %
02024 %                                                                             %
02025 %                                                                             %
02026 %                                                                             %
02027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02028 %
02029 %  PixelSetMagenta() sets the normalized magenta color of the pixel wand.
02030 %
02031 %  The format of the PixelSetMagenta method is:
02032 %
02033 %      void PixelSetMagenta(PixelWand *wand,const double magenta)
02034 %
02035 %  A description of each parameter follows:
02036 %
02037 %    o wand: the pixel wand.
02038 %
02039 %    o magenta: the magenta color.
02040 %
02041 */
02042 WandExport void PixelSetMagenta(PixelWand *wand,const double magenta)
02043 {
02044   assert(wand != (const PixelWand *) NULL);
02045   assert(wand->signature == WandSignature);
02046   if (wand->debug != MagickFalse)
02047     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02048   wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
02049     QuantumRange*magenta);
02050 }
02051 
02052 /*
02053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02054 %                                                                             %
02055 %                                                                             %
02056 %                                                                             %
02057 %   P i x e l S e t M a g e n t a Q u a n t u m                               %
02058 %                                                                             %
02059 %                                                                             %
02060 %                                                                             %
02061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02062 %
02063 %  PixelSetMagentaQuantum() sets the magenta color of the pixel wand.
02064 %
02065 %  The format of the PixelSetMagentaQuantum method is:
02066 %
02067 %      void PixelSetMagentaQuantum(PixelWand *wand,
02068 %        const Quantum magenta)
02069 %
02070 %  A description of each parameter follows:
02071 %
02072 %    o wand: the pixel wand.
02073 %
02074 %    o magenta: the green magenta.
02075 %
02076 */
02077 WandExport void PixelSetMagentaQuantum(PixelWand *wand,const Quantum magenta)
02078 {
02079   assert(wand != (const PixelWand *) NULL);
02080   assert(wand->signature == WandSignature);
02081   if (wand->debug != MagickFalse)
02082     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02083   wand->pixel.green=(MagickRealType) magenta;
02084 }
02085 
02086 /*
02087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02088 %                                                                             %
02089 %                                                                             %
02090 %                                                                             %
02091 %   P i x e l S e t P i x e l C o l o r                                       %
02092 %                                                                             %
02093 %                                                                             %
02094 %                                                                             %
02095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02096 %
02097 %  PixelSetPixelColor() sets the color of the pixel wand.
02098 %
02099 %  The format of the PixelSetPixelColor method is:
02100 %
02101 %      PixelSetPixelColor(PixelWand *wand,const PixelInfo *color)
02102 %
02103 %  A description of each parameter follows:
02104 %
02105 %    o wand: the pixel wand.
02106 %
02107 %    o color: the pixel wand color.
02108 %
02109 */
02110 WandExport void PixelSetPixelColor(PixelWand *wand,const PixelInfo *color)
02111 {
02112   assert(wand != (const PixelWand *) NULL);
02113   assert(wand->signature == WandSignature);
02114   if (wand->debug != MagickFalse)
02115     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02116   assert(color != (const PixelInfo *) NULL);
02117   wand->pixel=(*color);
02118 }
02119 
02120 /*
02121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02122 %                                                                             %
02123 %                                                                             %
02124 %                                                                             %
02125 %   P i x e l S e t Q u a n t u m P i x e l                                   %
02126 %                                                                             %
02127 %                                                                             %
02128 %                                                                             %
02129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02130 %
02131 %  PixelSetQuantumPixel() sets the pixel of the pixel wand.
02132 %
02133 %  The format of the PixelSetQuantumPixel method is:
02134 %
02135 %      PixelSetQuantumPixel(const Image *image,const QixelPixel *pixel,
02136 %        PixelWand *wand)
02137 %
02138 %  A description of each parameter follows:
02139 %
02140 %    o wand: the pixel wand.
02141 %
02142 %    o pixel: the pixel wand pixel.
02143 %
02144 */
02145 WandExport void PixelSetQuantumPixel(const Image *image,const Quantum *pixel,
02146   PixelWand *wand)
02147 {
02148   assert(wand != (const PixelWand *) NULL);
02149   assert(wand->signature == WandSignature);
02150   if (wand->debug != MagickFalse)
02151     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02152   assert(pixel != (Quantum *) NULL);
02153   wand->pixel.red=(MagickRealType) GetPixelRed(image,pixel);
02154   wand->pixel.green=(MagickRealType) GetPixelGreen(image,pixel);
02155   wand->pixel.blue=(MagickRealType) GetPixelBlue(image,pixel);
02156   wand->pixel.black=(MagickRealType) GetPixelBlack(image,pixel);
02157   wand->pixel.alpha=(MagickRealType) GetPixelAlpha(image,pixel);
02158   wand->pixel.matte=GetPixelAlpha(image,pixel) != OpaqueAlpha ? MagickTrue :
02159     MagickFalse;
02160 }
02161 
02162 /*
02163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02164 %                                                                             %
02165 %                                                                             %
02166 %                                                                             %
02167 %   P i x e l S e t R e d                                                     %
02168 %                                                                             %
02169 %                                                                             %
02170 %                                                                             %
02171 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02172 %
02173 %  PixelSetRed() sets the normalized red color of the pixel wand.
02174 %
02175 %  The format of the PixelSetRed method is:
02176 %
02177 %      void PixelSetRed(PixelWand *wand,const double red)
02178 %
02179 %  A description of each parameter follows:
02180 %
02181 %    o wand: the pixel wand.
02182 %
02183 %    o red: the red color.
02184 %
02185 */
02186 WandExport void PixelSetRed(PixelWand *wand,const double red)
02187 {
02188   assert(wand != (const PixelWand *) NULL);
02189   assert(wand->signature == WandSignature);
02190   if (wand->debug != MagickFalse)
02191     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02192   wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
02193     QuantumRange*red);
02194 }
02195 
02196 /*
02197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02198 %                                                                             %
02199 %                                                                             %
02200 %                                                                             %
02201 %   P i x e l S e t R e d Q u a n t u m                                       %
02202 %                                                                             %
02203 %                                                                             %
02204 %                                                                             %
02205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02206 %
02207 %  PixelSetRedQuantum() sets the red color of the pixel wand.
02208 %
02209 %  The format of the PixelSetRedQuantum method is:
02210 %
02211 %      void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
02212 %
02213 %  A description of each parameter follows:
02214 %
02215 %    o wand: the pixel wand.
02216 %
02217 %    o red: the red color.
02218 %
02219 */
02220 WandExport void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
02221 {
02222   assert(wand != (const PixelWand *) NULL);
02223   assert(wand->signature == WandSignature);
02224   if (wand->debug != MagickFalse)
02225     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02226   wand->pixel.red=(MagickRealType) red;
02227 }
02228 
02229 /*
02230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02231 %                                                                             %
02232 %                                                                             %
02233 %                                                                             %
02234 %   P i x e l S e t Y e l l o w                                               %
02235 %                                                                             %
02236 %                                                                             %
02237 %                                                                             %
02238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02239 %
02240 %  PixelSetYellow() sets the normalized yellow color of the pixel wand.
02241 %
02242 %  The format of the PixelSetYellow method is:
02243 %
02244 %      void PixelSetYellow(PixelWand *wand,const double yellow)
02245 %
02246 %  A description of each parameter follows:
02247 %
02248 %    o wand: the pixel wand.
02249 %
02250 %    o yellow: the yellow color.
02251 %
02252 */
02253 WandExport void PixelSetYellow(PixelWand *wand,const double yellow)
02254 {
02255   assert(wand != (const PixelWand *) NULL);
02256   assert(wand->signature == WandSignature);
02257   if (wand->debug != MagickFalse)
02258     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02259   wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
02260     QuantumRange*yellow);
02261 }
02262 
02263 /*
02264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02265 %                                                                             %
02266 %                                                                             %
02267 %                                                                             %
02268 %   P i x e l S e t Y e l l o w Q u a n t u m                                 %
02269 %                                                                             %
02270 %                                                                             %
02271 %                                                                             %
02272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02273 %
02274 %  PixelSetYellowQuantum() sets the yellow color of the pixel wand.
02275 %
02276 %  The format of the PixelSetYellowQuantum method is:
02277 %
02278 %      void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
02279 %
02280 %  A description of each parameter follows:
02281 %
02282 %    o wand: the pixel wand.
02283 %
02284 %    o yellow: the yellow color.
02285 %
02286 */
02287 WandExport void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
02288 {
02289   assert(wand != (const PixelWand *) NULL);
02290   assert(wand->signature == WandSignature);
02291   if (wand->debug != MagickFalse)
02292     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02293   wand->pixel.blue=(MagickRealType) yellow;
02294 }