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-2009 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 "wand/studio.h"
00050 #include "wand/MagickWand.h"
00051 #include "wand/magick-wand-private.h"
00052 #include "wand/pixel-wand-private.h"
00053 #include "wand/wand.h"
00054 
00055 /*
00056   Define declarations.
00057 */
00058 #define PixelWandId  "PixelWand"
00059 
00060 /*
00061   Typedef declarations.
00062 */
00063 struct _PixelWand
00064 {
00065   unsigned long
00066     id;
00067 
00068   char
00069     name[MaxTextExtent];
00070 
00071   ExceptionInfo
00072     *exception;
00073 
00074   MagickPixelPacket
00075     pixel;
00076 
00077   unsigned long
00078     count;
00079 
00080   MagickBooleanType
00081     debug;
00082 
00083   unsigned long
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) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",PixelWandId,
00158     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 unsigned long 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 unsigned long number_wands)
00197 {
00198   register long
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 < (long) 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 unsigned long 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 unsigned long number_wands)
00277 {
00278   register long
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=(long) 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(IsMagickColorSimilar(&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   unsigned long
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) FormatMagickString(wand->name,MaxTextExtent,"%s-%lu",PixelWandId,
00410     wand->id);
00411   wand->exception=AcquireExceptionInfo();
00412   GetMagickPixelPacket((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 unsigned long 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 unsigned long number_wands)
00443 {
00444   register long
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 < (long) 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*(QuantumRange-wand->pixel.opacity));
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((Quantum) QuantumRange-RoundToQuantum(wand->pixel.opacity));
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.index);
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(RoundToQuantum(wand->pixel.index));
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(RoundToQuantum(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   MagickPixelPacket
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) FormatMagickString(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) FormatMagickString(color+strlen(color),MaxTextExtent,",%g",
00756       (double) (QuantumScale*wand->pixel.index));
00757   if (wand->pixel.matte != MagickFalse)
00758     (void) FormatMagickString(color+strlen(color),MaxTextExtent,",%g",
00759       (double) (QuantumScale*wand->pixel.opacity));
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 %      unsigned long PixelGetColorCount(const PixelWand *wand)
00779 %
00780 %  A description of each parameter follows:
00781 %
00782 %    o wand: the pixel wand.
00783 %
00784 */
00785 WandExport unsigned long 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(RoundToQuantum(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(RoundToQuantum(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(RoundToQuantum(wand->pixel.red),RoundToQuantum(
01071     wand->pixel.green),RoundToQuantum(wand->pixel.blue),hue,saturation,
01072     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 %      IndexPacket PixelGetIndex(const PixelWand *wand)
01091 %
01092 %  A description of each parameter follows:
01093 %
01094 %    o wand: the pixel wand.
01095 %
01096 */
01097 WandExport IndexPacket 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((IndexPacket) wand->pixel.index);
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(RoundToQuantum(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,MagickPixelPacket *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   MagickPixelPacket *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 != (MagickPixelPacket *) NULL);
01200   *color=wand->pixel;
01201 }
01202 
01203 /*
01204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01205 %                                                                             %
01206 %                                                                             %
01207 %                                                                             %
01208 %   P i x e l G e t O p a c i t y                                             %
01209 %                                                                             %
01210 %                                                                             %
01211 %                                                                             %
01212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01213 %
01214 %  PixelGetOpacity() returns the normalized opacity color of the pixel wand.
01215 %
01216 %  The format of the PixelGetOpacity method is:
01217 %
01218 %      double PixelGetOpacity(const PixelWand *wand)
01219 %
01220 %  A description of each parameter follows:
01221 %
01222 %    o wand: the pixel wand.
01223 %
01224 */
01225 WandExport double PixelGetOpacity(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((double) QuantumScale*wand->pixel.opacity);
01232 }
01233 
01234 /*
01235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01236 %                                                                             %
01237 %                                                                             %
01238 %                                                                             %
01239 %   P i x e l G e t O p a c i t y Q u a n t u m                               %
01240 %                                                                             %
01241 %                                                                             %
01242 %                                                                             %
01243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01244 %
01245 %  PixelGetOpacityQuantum() returns the opacity color of the pixel wand.
01246 %
01247 %  The format of the PixelGetOpacityQuantum method is:
01248 %
01249 %      Quantum PixelGetOpacityQuantum(const PixelWand *wand)
01250 %
01251 %  A description of each parameter follows:
01252 %
01253 %    o wand: the pixel wand.
01254 %
01255 */
01256 WandExport Quantum PixelGetOpacityQuantum(const PixelWand *wand)
01257 {
01258   assert(wand != (const PixelWand *) NULL);
01259   assert(wand->signature == WandSignature);
01260   if (wand->debug != MagickFalse)
01261     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01262   return(RoundToQuantum(wand->pixel.opacity));
01263 }
01264 
01265 /*
01266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01267 %                                                                             %
01268 %                                                                             %
01269 %                                                                             %
01270 %   P i x e l G e t Q u a n t u m C o l o r                                   %
01271 %                                                                             %
01272 %                                                                             %
01273 %                                                                             %
01274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01275 %
01276 %  PixelGetQuantumColor() gets the color of the pixel wand as a PixelPacket.
01277 %
01278 %  The format of the PixelGetQuantumColor method is:
01279 %
01280 %      void PixelGetQuantumColor(PixelWand *wand,PixelPacket *color)
01281 %
01282 %  A description of each parameter follows:
01283 %
01284 %    o wand: the pixel wand.
01285 %
01286 %    o color:  The pixel wand color is returned here.
01287 %
01288 */
01289 WandExport void PixelGetQuantumColor(const PixelWand *wand,PixelPacket *color)
01290 {
01291   assert(wand != (const PixelWand *) NULL);
01292   assert(wand->signature == WandSignature);
01293   if (wand->debug != MagickFalse)
01294     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01295   assert(color != (PixelPacket *) NULL);
01296   color->opacity=RoundToQuantum(wand->pixel.opacity);
01297   if (wand->pixel.colorspace == CMYKColorspace)
01298     {
01299       color->red=RoundToQuantum((MagickRealType) QuantumRange-
01300         (wand->pixel.red*(QuantumRange-wand->pixel.index)+wand->pixel.index));
01301       color->green=RoundToQuantum((MagickRealType) QuantumRange-
01302         (wand->pixel.green*(QuantumRange-wand->pixel.index)+wand->pixel.index));
01303       color->blue=RoundToQuantum((MagickRealType) QuantumRange-
01304         (wand->pixel.blue*(QuantumRange-wand->pixel.index)+wand->pixel.index));
01305       return;
01306     }
01307   color->red=RoundToQuantum(wand->pixel.red);
01308   color->green=RoundToQuantum(wand->pixel.green);
01309   color->blue=RoundToQuantum(wand->pixel.blue);
01310 }
01311 
01312 /*
01313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01314 %                                                                             %
01315 %                                                                             %
01316 %                                                                             %
01317 %   P i x e l G e t R e d                                                     %
01318 %                                                                             %
01319 %                                                                             %
01320 %                                                                             %
01321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01322 %
01323 %  PixelGetRed() returns the normalized red color of the pixel wand.
01324 %
01325 %  The format of the PixelGetRed method is:
01326 %
01327 %      double PixelGetRed(const PixelWand *wand)
01328 %
01329 %  A description of each parameter follows:
01330 %
01331 %    o wand: the pixel wand.
01332 %
01333 */
01334 WandExport double PixelGetRed(const PixelWand *wand)
01335 {
01336   assert(wand != (const PixelWand *) NULL);
01337   assert(wand->signature == WandSignature);
01338   if (wand->debug != MagickFalse)
01339     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01340   return((double) QuantumScale*wand->pixel.red);
01341 }
01342 
01343 /*
01344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01345 %                                                                             %
01346 %                                                                             %
01347 %                                                                             %
01348 %   P i x e l G e t R e d Q u a n t u m                                       %
01349 %                                                                             %
01350 %                                                                             %
01351 %                                                                             %
01352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01353 %
01354 %  PixelGetRedQuantum() returns the red color of the pixel wand.
01355 %
01356 %  The format of the PixelGetRedQuantum method is:
01357 %
01358 %      Quantum PixelGetRedQuantum(const PixelWand *wand)
01359 %
01360 %  A description of each parameter follows:
01361 %
01362 %    o wand: the pixel wand.
01363 %
01364 */
01365 WandExport Quantum PixelGetRedQuantum(const PixelWand *wand)
01366 {
01367   assert(wand != (const PixelWand *) NULL);
01368   assert(wand->signature == WandSignature);
01369   if (wand->debug != MagickFalse)
01370     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01371   return(RoundToQuantum(wand->pixel.red));
01372 }
01373 
01374 /*
01375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01376 %                                                                             %
01377 %                                                                             %
01378 %                                                                             %
01379 %   P i x e l G e t Y e l l o w                                               %
01380 %                                                                             %
01381 %                                                                             %
01382 %                                                                             %
01383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01384 %
01385 %  PixelGetYellow() returns the normalized yellow color of the pixel wand.
01386 %
01387 %  The format of the PixelGetYellow method is:
01388 %
01389 %      double PixelGetYellow(const PixelWand *wand)
01390 %
01391 %  A description of each parameter follows:
01392 %
01393 %    o wand: the pixel wand.
01394 %
01395 */
01396 WandExport double PixelGetYellow(const PixelWand *wand)
01397 {
01398   assert(wand != (const PixelWand *) NULL);
01399   assert(wand->signature == WandSignature);
01400   if (wand->debug != MagickFalse)
01401     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01402   return((double) QuantumScale*wand->pixel.blue);
01403 }
01404 
01405 /*
01406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01407 %                                                                             %
01408 %                                                                             %
01409 %                                                                             %
01410 %   P i x e l G e t Y e l l o w Q u a n t u m                                 %
01411 %                                                                             %
01412 %                                                                             %
01413 %                                                                             %
01414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01415 %
01416 %  PixelGetYellowQuantum() returns the yellow color of the pixel wand.
01417 %
01418 %  The format of the PixelGetYellowQuantum method is:
01419 %
01420 %      Quantum PixelGetYellowQuantum(const PixelWand *wand)
01421 %
01422 %  A description of each parameter follows:
01423 %
01424 %    o wand: the pixel wand.
01425 %
01426 */
01427 WandExport Quantum PixelGetYellowQuantum(const PixelWand *wand)
01428 {
01429   assert(wand != (const PixelWand *) NULL);
01430   assert(wand->signature == WandSignature);
01431   if (wand->debug != MagickFalse)
01432     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01433   return(RoundToQuantum(wand->pixel.blue));
01434 }
01435 
01436 /*
01437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01438 %                                                                             %
01439 %                                                                             %
01440 %                                                                             %
01441 %   P i x e l S e t A l p h a                                                 %
01442 %                                                                             %
01443 %                                                                             %
01444 %                                                                             %
01445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01446 %
01447 %  PixelSetAlpha() sets the normalized alpha color of the pixel wand.
01448 %
01449 %  The format of the PixelSetAlpha method is:
01450 %
01451 %      void PixelSetAlpha(PixelWand *wand,const double alpha)
01452 %
01453 %  A description of each parameter follows:
01454 %
01455 %    o wand: the pixel wand.
01456 %
01457 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
01458 %      transparent.
01459 %
01460 */
01461 WandExport void PixelSetAlpha(PixelWand *wand,const double alpha)
01462 {
01463   assert(wand != (const PixelWand *) NULL);
01464   assert(wand->signature == WandSignature);
01465   if (wand->debug != MagickFalse)
01466     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01467   wand->pixel.opacity=(MagickRealType) (QuantumRange-
01468     RoundToQuantum((MagickRealType) QuantumRange*alpha));
01469 }
01470 
01471 /*
01472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01473 %                                                                             %
01474 %                                                                             %
01475 %                                                                             %
01476 %   P i x e l S e t A l p h a Q u a n t u m                                   %
01477 %                                                                             %
01478 %                                                                             %
01479 %                                                                             %
01480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01481 %
01482 %  PixelSetAlphaQuantum() sets the alpha color of the pixel wand.
01483 %
01484 %  The format of the PixelSetAlphaQuantum method is:
01485 %
01486 %      void PixelSetAlphaQuantum(PixelWand *wand,
01487 %        const Quantum opacity)
01488 %
01489 %  A description of each parameter follows:
01490 %
01491 %    o wand: the pixel wand.
01492 %
01493 %    o opacity: the opacity color.
01494 %
01495 */
01496 WandExport void PixelSetAlphaQuantum(PixelWand *wand,const Quantum opacity)
01497 {
01498   assert(wand != (const PixelWand *) NULL);
01499   assert(wand->signature == WandSignature);
01500   if (wand->debug != MagickFalse)
01501     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01502   wand->pixel.opacity=(MagickRealType) (QuantumRange-opacity);
01503 }
01504 
01505 /*
01506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01507 %                                                                             %
01508 %                                                                             %
01509 %                                                                             %
01510 %   P i x e l S e t B l a c k                                                 %
01511 %                                                                             %
01512 %                                                                             %
01513 %                                                                             %
01514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01515 %
01516 %  PixelSetBlack() sets the normalized black color of the pixel wand.
01517 %
01518 %  The format of the PixelSetBlack method is:
01519 %
01520 %      void PixelSetBlack(PixelWand *wand,const double black)
01521 %
01522 %  A description of each parameter follows:
01523 %
01524 %    o wand: the pixel wand.
01525 %
01526 %    o black: the black color.
01527 %
01528 */
01529 WandExport void PixelSetBlack(PixelWand *wand,const double black)
01530 {
01531   assert(wand != (const PixelWand *) NULL);
01532   assert(wand->signature == WandSignature);
01533   if (wand->debug != MagickFalse)
01534     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01535   wand->pixel.index=(MagickRealType) RoundToQuantum((MagickRealType)
01536     QuantumRange*black);
01537 }
01538 
01539 /*
01540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01541 %                                                                             %
01542 %                                                                             %
01543 %                                                                             %
01544 %   P i x e l S e t B l a c k Q u a n t u m                                   %
01545 %                                                                             %
01546 %                                                                             %
01547 %                                                                             %
01548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01549 %
01550 %  PixelSetBlackQuantum() sets the black color of the pixel wand.
01551 %
01552 %  The format of the PixelSetBlackQuantum method is:
01553 %
01554 %      void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
01555 %
01556 %  A description of each parameter follows:
01557 %
01558 %    o wand: the pixel wand.
01559 %
01560 %    o black: the black color.
01561 %
01562 */
01563 WandExport void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
01564 {
01565   assert(wand != (const PixelWand *) NULL);
01566   assert(wand->signature == WandSignature);
01567   if (wand->debug != MagickFalse)
01568     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01569   wand->pixel.index=(MagickRealType) black;
01570 }
01571 
01572 /*
01573 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01574 %                                                                             %
01575 %                                                                             %
01576 %                                                                             %
01577 %   P i x e l S e t B l u e                                                   %
01578 %                                                                             %
01579 %                                                                             %
01580 %                                                                             %
01581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01582 %
01583 %  PixelSetBlue() sets the normalized blue color of the pixel wand.
01584 %
01585 %  The format of the PixelSetBlue method is:
01586 %
01587 %      void PixelSetBlue(PixelWand *wand,const double blue)
01588 %
01589 %  A description of each parameter follows:
01590 %
01591 %    o wand: the pixel wand.
01592 %
01593 %    o blue: the blue color.
01594 %
01595 */
01596 WandExport void PixelSetBlue(PixelWand *wand,const double blue)
01597 {
01598   assert(wand != (const PixelWand *) NULL);
01599   assert(wand->signature == WandSignature);
01600   if (wand->debug != MagickFalse)
01601     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01602   wand->pixel.blue=(MagickRealType) RoundToQuantum((MagickRealType)
01603     QuantumRange*blue);
01604 }
01605 
01606 /*
01607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01608 %                                                                             %
01609 %                                                                             %
01610 %                                                                             %
01611 %   P i x e l S e t B l u e Q u a n t u m                                     %
01612 %                                                                             %
01613 %                                                                             %
01614 %                                                                             %
01615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01616 %
01617 %  PixelSetBlueQuantum() sets the blue color of the pixel wand.
01618 %
01619 %  The format of the PixelSetBlueQuantum method is:
01620 %
01621 %      void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
01622 %
01623 %  A description of each parameter follows:
01624 %
01625 %    o wand: the pixel wand.
01626 %
01627 %    o blue: the blue color.
01628 %
01629 */
01630 WandExport void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
01631 {
01632   assert(wand != (const PixelWand *) NULL);
01633   assert(wand->signature == WandSignature);
01634   if (wand->debug != MagickFalse)
01635     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01636   wand->pixel.blue=(MagickRealType) blue;
01637 }
01638 
01639 /*
01640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01641 %                                                                             %
01642 %                                                                             %
01643 %                                                                             %
01644 %   P i x e l S e t C o l o r                                                 %
01645 %                                                                             %
01646 %                                                                             %
01647 %                                                                             %
01648 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01649 %
01650 %  PixelSetColor() sets the color of the pixel wand with a string (e.g.
01651 %  "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.).
01652 %
01653 %  The format of the PixelSetColor method is:
01654 %
01655 %      MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
01656 %
01657 %  A description of each parameter follows:
01658 %
01659 %    o wand: the pixel wand.
01660 %
01661 %    o color: the pixel wand color.
01662 %
01663 */
01664 WandExport MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
01665 {
01666   MagickBooleanType
01667     status;
01668 
01669   MagickPixelPacket
01670     pixel;
01671 
01672   assert(wand != (const PixelWand *) NULL);
01673   assert(wand->signature == WandSignature);
01674   if (wand->debug != MagickFalse)
01675     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01676   status=QueryMagickColor(color,&pixel,wand->exception);
01677   if (status != MagickFalse)
01678     wand->pixel=pixel;
01679   return(status);
01680 }
01681 
01682 /*
01683 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01684 %                                                                             %
01685 %                                                                             %
01686 %                                                                             %
01687 %   P i x e l S e t C o l o r C o u n t                                       %
01688 %                                                                             %
01689 %                                                                             %
01690 %                                                                             %
01691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01692 %
01693 %  PixelSetColorCount() sets the color count of the pixel wand.
01694 %
01695 %  The format of the PixelSetColorCount method is:
01696 %
01697 %      void PixelSetColorCount(PixelWand *wand,const unsigned long count)
01698 %
01699 %  A description of each parameter follows:
01700 %
01701 %    o wand: the pixel wand.
01702 %
01703 %    o count: the number of this particular color.
01704 %
01705 */
01706 WandExport void PixelSetColorCount(PixelWand *wand,const unsigned long count)
01707 {
01708   assert(wand != (const PixelWand *) NULL);
01709   assert(wand->signature == WandSignature);
01710   if (wand->debug != MagickFalse)
01711     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01712   wand->count=count;
01713 }
01714 
01715 /*
01716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01717 %                                                                             %
01718 %                                                                             %
01719 %                                                                             %
01720 %   P i x e l S e t C o l o r F r o m W a n d                                 %
01721 %                                                                             %
01722 %                                                                             %
01723 %                                                                             %
01724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01725 %
01726 %  PixelSetColorFromWand() sets the color of the pixel wand.
01727 %
01728 %  The format of the PixelSetColorFromWand method is:
01729 %
01730 %      PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
01731 %
01732 %  A description of each parameter follows:
01733 %
01734 %    o wand: the pixel wand.
01735 %
01736 %    o color: set the pixel wand color here.
01737 %
01738 */
01739 WandExport void PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
01740 {
01741   assert(wand != (const PixelWand *) NULL);
01742   assert(wand->signature == WandSignature);
01743   if (wand->debug != MagickFalse)
01744     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01745   assert(color != (const PixelWand *) NULL);
01746   wand->pixel=color->pixel;
01747 }
01748 
01749 /*
01750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01751 %                                                                             %
01752 %                                                                             %
01753 %                                                                             %
01754 %   P i x e l S e t C y a n                                                   %
01755 %                                                                             %
01756 %                                                                             %
01757 %                                                                             %
01758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01759 %
01760 %  PixelSetCyan() sets the normalized cyan color of the pixel wand.
01761 %
01762 %  The format of the PixelSetCyan method is:
01763 %
01764 %      void PixelSetCyan(PixelWand *wand,const double cyan)
01765 %
01766 %  A description of each parameter follows:
01767 %
01768 %    o wand: the pixel wand.
01769 %
01770 %    o cyan: the cyan color.
01771 %
01772 */
01773 WandExport void PixelSetCyan(PixelWand *wand,const double cyan)
01774 {
01775   assert(wand != (const PixelWand *) NULL);
01776   assert(wand->signature == WandSignature);
01777   if (wand->debug != MagickFalse)
01778     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01779   wand->pixel.red=(MagickRealType) RoundToQuantum((MagickRealType)
01780     QuantumRange*cyan);
01781 }
01782 
01783 /*
01784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01785 %                                                                             %
01786 %                                                                             %
01787 %                                                                             %
01788 %   P i x e l S e t C y a n Q u a n t u m                                     %
01789 %                                                                             %
01790 %                                                                             %
01791 %                                                                             %
01792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01793 %
01794 %  PixelSetCyanQuantum() sets the cyan color of the pixel wand.
01795 %
01796 %  The format of the PixelSetCyanQuantum method is:
01797 %
01798 %      void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
01799 %
01800 %  A description of each parameter follows:
01801 %
01802 %    o wand: the pixel wand.
01803 %
01804 %    o cyan: the cyan color.
01805 %
01806 */
01807 WandExport void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
01808 {
01809   assert(wand != (const PixelWand *) NULL);
01810   assert(wand->signature == WandSignature);
01811   if (wand->debug != MagickFalse)
01812     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01813   wand->pixel.red=(MagickRealType) cyan;
01814 }
01815 
01816 /*
01817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01818 %                                                                             %
01819 %                                                                             %
01820 %                                                                             %
01821 %   P i x e l S e t F u z z                                                   %
01822 %                                                                             %
01823 %                                                                             %
01824 %                                                                             %
01825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01826 %
01827 %  PixelSetFuzz() sets the fuzz value of the pixel wand.
01828 %
01829 %  The format of the PixelSetFuzz method is:
01830 %
01831 %      void PixelSetFuzz(PixelWand *wand,const double fuzz)
01832 %
01833 %  A description of each parameter follows:
01834 %
01835 %    o wand: the pixel wand.
01836 %
01837 %    o fuzz: the fuzz value.
01838 %
01839 */
01840 WandExport void PixelSetFuzz(PixelWand *wand,const double fuzz)
01841 {
01842   assert(wand != (const PixelWand *) NULL);
01843   assert(wand->signature == WandSignature);
01844   if (wand->debug != MagickFalse)
01845     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01846   wand->pixel.fuzz=(MagickRealType) fuzz;
01847 }
01848 
01849 /*
01850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01851 %                                                                             %
01852 %                                                                             %
01853 %                                                                             %
01854 %   P i x e l S e t G r e e n                                                 %
01855 %                                                                             %
01856 %                                                                             %
01857 %                                                                             %
01858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01859 %
01860 %  PixelSetGreen() sets the normalized green color of the pixel wand.
01861 %
01862 %  The format of the PixelSetGreen method is:
01863 %
01864 %      void PixelSetGreen(PixelWand *wand,const double green)
01865 %
01866 %  A description of each parameter follows:
01867 %
01868 %    o wand: the pixel wand.
01869 %
01870 %    o green: the green color.
01871 %
01872 */
01873 WandExport void PixelSetGreen(PixelWand *wand,const double green)
01874 {
01875   assert(wand != (const PixelWand *) NULL);
01876   assert(wand->signature == WandSignature);
01877   if (wand->debug != MagickFalse)
01878     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01879   wand->pixel.green=(MagickRealType) RoundToQuantum((MagickRealType)
01880     QuantumRange*green);
01881 }
01882 
01883 /*
01884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01885 %                                                                             %
01886 %                                                                             %
01887 %                                                                             %
01888 %   P i x e l S e t G r e e n Q u a n t u m                                   %
01889 %                                                                             %
01890 %                                                                             %
01891 %                                                                             %
01892 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01893 %
01894 %  PixelSetGreenQuantum() sets the green color of the pixel wand.
01895 %
01896 %  The format of the PixelSetGreenQuantum method is:
01897 %
01898 %      void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
01899 %
01900 %  A description of each parameter follows:
01901 %
01902 %    o wand: the pixel wand.
01903 %
01904 %    o green: the green color.
01905 %
01906 */
01907 WandExport void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
01908 {
01909   assert(wand != (const PixelWand *) NULL);
01910   assert(wand->signature == WandSignature);
01911   if (wand->debug != MagickFalse)
01912     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01913   wand->pixel.green=(MagickRealType) green;
01914 }
01915 
01916 /*
01917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01918 %                                                                             %
01919 %                                                                             %
01920 %                                                                             %
01921 %   P i x e l S e t H S L                                                     %
01922 %                                                                             %
01923 %                                                                             %
01924 %                                                                             %
01925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01926 %
01927 %  PixelSetHSL() sets the normalized HSL color of the pixel wand.
01928 %
01929 %  The format of the PixelSetHSL method is:
01930 %
01931 %      void PixelSetHSL(PixelWand *wand,const double hue,
01932 %        const double saturation,const double lightness)
01933 %
01934 %  A description of each parameter follows:
01935 %
01936 %    o wand: the pixel wand.
01937 %
01938 %    o hue,saturation,lightness: Return the pixel hue, saturation, and
01939 %      brightness.
01940 %
01941 */
01942 WandExport void PixelSetHSL(PixelWand *wand,const double hue,
01943   const double saturation,const double lightness)
01944 {
01945   Quantum
01946     blue,
01947     green,
01948     red;
01949 
01950   assert(wand != (const PixelWand *) NULL);
01951   assert(wand->signature == WandSignature);
01952   if (wand->debug != MagickFalse)
01953     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01954   ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
01955   wand->pixel.red=(MagickRealType) red;
01956   wand->pixel.green=(MagickRealType) green;
01957   wand->pixel.blue=(MagickRealType) blue;
01958 }
01959 
01960 /*
01961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01962 %                                                                             %
01963 %                                                                             %
01964 %                                                                             %
01965 %   P i x e l S e t I n d e x                                                 %
01966 %                                                                             %
01967 %                                                                             %
01968 %                                                                             %
01969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01970 %
01971 %  PixelSetIndex() sets the colormap index of the pixel wand.
01972 %
01973 %  The format of the PixelSetIndex method is:
01974 %
01975 %      void PixelSetIndex(PixelWand *wand,const IndexPacket index)
01976 %
01977 %  A description of each parameter follows:
01978 %
01979 %    o wand: the pixel wand.
01980 %
01981 %    o index: the colormap index.
01982 %
01983 */
01984 WandExport void PixelSetIndex(PixelWand *wand,const IndexPacket index)
01985 {
01986   assert(wand != (const PixelWand *) NULL);
01987   assert(wand->signature == WandSignature);
01988   if (wand->debug != MagickFalse)
01989     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01990   wand->pixel.index=(MagickRealType) index;
01991 }
01992 
01993 /*
01994 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01995 %                                                                             %
01996 %                                                                             %
01997 %                                                                             %
01998 %   P i x e l S e t M a g e n t a                                             %
01999 %                                                                             %
02000 %                                                                             %
02001 %                                                                             %
02002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02003 %
02004 %  PixelSetMagenta() sets the normalized magenta color of the pixel wand.
02005 %
02006 %  The format of the PixelSetMagenta method is:
02007 %
02008 %      void PixelSetMagenta(PixelWand *wand,const double magenta)
02009 %
02010 %  A description of each parameter follows:
02011 %
02012 %    o wand: the pixel wand.
02013 %
02014 %    o magenta: the magenta color.
02015 %
02016 */
02017 WandExport void PixelSetMagenta(PixelWand *wand,const double magenta)
02018 {
02019   assert(wand != (const PixelWand *) NULL);
02020   assert(wand->signature == WandSignature);
02021   if (wand->debug != MagickFalse)
02022     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02023   wand->pixel.green=(MagickRealType) RoundToQuantum((MagickRealType)
02024     QuantumRange*magenta);
02025 }
02026 
02027 /*
02028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02029 %                                                                             %
02030 %                                                                             %
02031 %                                                                             %
02032 %   P i x e l S e t M a g e n t a Q u a n t u m                               %
02033 %                                                                             %
02034 %                                                                             %
02035 %                                                                             %
02036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02037 %
02038 %  PixelSetMagentaQuantum() sets the magenta color of the pixel wand.
02039 %
02040 %  The format of the PixelSetMagentaQuantum method is:
02041 %
02042 %      void PixelSetMagentaQuantum(PixelWand *wand,
02043 %        const Quantum magenta)
02044 %
02045 %  A description of each parameter follows:
02046 %
02047 %    o wand: the pixel wand.
02048 %
02049 %    o magenta: the green magenta.
02050 %
02051 */
02052 WandExport void PixelSetMagentaQuantum(PixelWand *wand,const Quantum magenta)
02053 {
02054   assert(wand != (const PixelWand *) NULL);
02055   assert(wand->signature == WandSignature);
02056   if (wand->debug != MagickFalse)
02057     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02058   wand->pixel.green=(MagickRealType) magenta;
02059 }
02060 
02061 /*
02062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02063 %                                                                             %
02064 %                                                                             %
02065 %                                                                             %
02066 %   P i x e l S e t M a g i c k C o l o r                                     %
02067 %                                                                             %
02068 %                                                                             %
02069 %                                                                             %
02070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02071 %
02072 %  PixelSetMagickColor() sets the color of the pixel wand.
02073 %
02074 %  The format of the PixelSetMagickColor method is:
02075 %
02076 %      PixelSetMagickColor(PixelWand *wand,const MagickPixelPacket *color)
02077 %
02078 %  A description of each parameter follows:
02079 %
02080 %    o wand: the pixel wand.
02081 %
02082 %    o color: the pixel wand color.
02083 %
02084 */
02085 WandExport void PixelSetMagickColor(PixelWand *wand,
02086   const MagickPixelPacket *color)
02087 {
02088   assert(wand != (const PixelWand *) NULL);
02089   assert(wand->signature == WandSignature);
02090   if (wand->debug != MagickFalse)
02091     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02092   assert(color != (const MagickPixelPacket *) NULL);
02093   wand->pixel=(*color);
02094 }
02095 
02096 /*
02097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02098 %                                                                             %
02099 %                                                                             %
02100 %                                                                             %
02101 %   P i x e l S e t O p a c i t y                                             %
02102 %                                                                             %
02103 %                                                                             %
02104 %                                                                             %
02105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02106 %
02107 %  PixelSetOpacity() sets the normalized opacity color of the pixel wand.
02108 %
02109 %  The format of the PixelSetOpacity method is:
02110 %
02111 %      void PixelSetOpacity(PixelWand *wand,const double opacity)
02112 %
02113 %  A description of each parameter follows:
02114 %
02115 %    o wand: the pixel wand.
02116 %
02117 %    o opacity: the opacity color.
02118 %
02119 */
02120 WandExport void PixelSetOpacity(PixelWand *wand,const double opacity)
02121 {
02122   assert(wand != (const PixelWand *) NULL);
02123   assert(wand->signature == WandSignature);
02124   if (wand->debug != MagickFalse)
02125     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02126   wand->pixel.matte=MagickTrue;
02127   wand->pixel.opacity=(MagickRealType) RoundToQuantum((MagickRealType)
02128     QuantumRange*opacity);
02129 }
02130 
02131 /*
02132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02133 %                                                                             %
02134 %                                                                             %
02135 %                                                                             %
02136 %   P i x e l S e t O p a c i t y Q u a n t u m                               %
02137 %                                                                             %
02138 %                                                                             %
02139 %                                                                             %
02140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02141 %
02142 %  PixelSetOpacityQuantum() sets the opacity color of the pixel wand.
02143 %
02144 %  The format of the PixelSetOpacityQuantum method is:
02145 %
02146 %      void PixelSetOpacityQuantum(PixelWand *wand,
02147 %        const Quantum opacity)
02148 %
02149 %  A description of each parameter follows:
02150 %
02151 %    o wand: the pixel wand.
02152 %
02153 %    o opacity: the opacity color.
02154 %
02155 */
02156 WandExport void PixelSetOpacityQuantum(PixelWand *wand,const Quantum opacity)
02157 {
02158   assert(wand != (const PixelWand *) NULL);
02159   assert(wand->signature == WandSignature);
02160   if (wand->debug != MagickFalse)
02161     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02162   wand->pixel.opacity=(MagickRealType) opacity;
02163 }
02164 
02165 /*
02166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02167 %                                                                             %
02168 %                                                                             %
02169 %                                                                             %
02170 %   P i x e l S e t Q u a n t u m C o l o r                                   %
02171 %                                                                             %
02172 %                                                                             %
02173 %                                                                             %
02174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02175 %
02176 %  PixelSetQuantumColor() sets the color of the pixel wand.
02177 %
02178 %  The format of the PixelSetQuantumColor method is:
02179 %
02180 %      PixelSetQuantumColor(PixelWand *wand,const PixelPacket *color)
02181 %
02182 %  A description of each parameter follows:
02183 %
02184 %    o wand: the pixel wand.
02185 %
02186 %    o color: the pixel wand color.
02187 %
02188 */
02189 WandExport void PixelSetQuantumColor(PixelWand *wand,const PixelPacket *color)
02190 {
02191   assert(wand != (const PixelWand *) NULL);
02192   assert(wand->signature == WandSignature);
02193   if (wand->debug != MagickFalse)
02194     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02195   assert(color != (PixelPacket *) NULL);
02196   wand->pixel.red=(MagickRealType) color->red;
02197   wand->pixel.green=(MagickRealType) color->green;
02198   wand->pixel.blue=(MagickRealType) color->blue;
02199   wand->pixel.opacity=(MagickRealType) color->opacity;
02200   wand->pixel.matte=color->opacity != OpaqueOpacity ? MagickTrue : MagickFalse;
02201 }
02202 
02203 /*
02204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02205 %                                                                             %
02206 %                                                                             %
02207 %                                                                             %
02208 %   P i x e l S e t R e d                                                     %
02209 %                                                                             %
02210 %                                                                             %
02211 %                                                                             %
02212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02213 %
02214 %  PixelSetRed() sets the normalized red color of the pixel wand.
02215 %
02216 %  The format of the PixelSetRed method is:
02217 %
02218 %      void PixelSetRed(PixelWand *wand,const double red)
02219 %
02220 %  A description of each parameter follows:
02221 %
02222 %    o wand: the pixel wand.
02223 %
02224 %    o red: the red color.
02225 %
02226 */
02227 WandExport void PixelSetRed(PixelWand *wand,const double red)
02228 {
02229   assert(wand != (const PixelWand *) NULL);
02230   assert(wand->signature == WandSignature);
02231   if (wand->debug != MagickFalse)
02232     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02233   wand->pixel.red=(MagickRealType) RoundToQuantum((MagickRealType)
02234     QuantumRange*red);
02235 }
02236 
02237 /*
02238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02239 %                                                                             %
02240 %                                                                             %
02241 %                                                                             %
02242 %   P i x e l S e t R e d Q u a n t u m                                       %
02243 %                                                                             %
02244 %                                                                             %
02245 %                                                                             %
02246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02247 %
02248 %  PixelSetRedQuantum() sets the red color of the pixel wand.
02249 %
02250 %  The format of the PixelSetRedQuantum method is:
02251 %
02252 %      void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
02253 %
02254 %  A description of each parameter follows:
02255 %
02256 %    o wand: the pixel wand.
02257 %
02258 %    o red: the red color.
02259 %
02260 */
02261 WandExport void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
02262 {
02263   assert(wand != (const PixelWand *) NULL);
02264   assert(wand->signature == WandSignature);
02265   if (wand->debug != MagickFalse)
02266     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02267   wand->pixel.red=(MagickRealType) red;
02268 }
02269 
02270 /*
02271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02272 %                                                                             %
02273 %                                                                             %
02274 %                                                                             %
02275 %   P i x e l S e t Y e l l o w                                               %
02276 %                                                                             %
02277 %                                                                             %
02278 %                                                                             %
02279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02280 %
02281 %  PixelSetYellow() sets the normalized yellow color of the pixel wand.
02282 %
02283 %  The format of the PixelSetYellow method is:
02284 %
02285 %      void PixelSetYellow(PixelWand *wand,const double yellow)
02286 %
02287 %  A description of each parameter follows:
02288 %
02289 %    o wand: the pixel wand.
02290 %
02291 %    o yellow: the yellow color.
02292 %
02293 */
02294 WandExport void PixelSetYellow(PixelWand *wand,const double yellow)
02295 {
02296   assert(wand != (const PixelWand *) NULL);
02297   assert(wand->signature == WandSignature);
02298   if (wand->debug != MagickFalse)
02299     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02300   wand->pixel.blue=(MagickRealType) RoundToQuantum((MagickRealType)
02301     QuantumRange*yellow);
02302 }
02303 
02304 /*
02305 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02306 %                                                                             %
02307 %                                                                             %
02308 %                                                                             %
02309 %   P i x e l S e t Y e l l o w Q u a n t u m                                 %
02310 %                                                                             %
02311 %                                                                             %
02312 %                                                                             %
02313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02314 %
02315 %  PixelSetYellowQuantum() sets the yellow color of the pixel wand.
02316 %
02317 %  The format of the PixelSetYellowQuantum method is:
02318 %
02319 %      void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
02320 %
02321 %  A description of each parameter follows:
02322 %
02323 %    o wand: the pixel wand.
02324 %
02325 %    o yellow: the yellow color.
02326 %
02327 */
02328 WandExport void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
02329 {
02330   assert(wand != (const PixelWand *) NULL);
02331   assert(wand->signature == WandSignature);
02332   if (wand->debug != MagickFalse)
02333     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02334   wand->pixel.blue=(MagickRealType) yellow;
02335 }

Generated on 19 Nov 2009 for MagickWand by  doxygen 1.6.1