]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/pixel-wand.c
Added "+combine {colorspace}"
[imagemagick] / MagickWand / pixel-wand.c
index f16e899e614debeae09fe72723e9a6c17a4c9bf3..ff209a1d4ca7b69ba8241abc9ae252839250913e 100644 (file)
@@ -23,7 +23,7 @@
 %                                March 2003                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -113,7 +113,7 @@ WandExport void ClearPixelWand(PixelWand *wand)
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   ClearMagickException(wand->exception);
-  wand->pixel.colorspace=RGBColorspace;
+  wand->pixel.colorspace=sRGBColorspace;
   wand->debug=IsEventLogging();
 }
 \f
@@ -754,7 +754,7 @@ WandExport char *PixelGetColorAsNormalizedString(const PixelWand *wand)
   if (wand->pixel.colorspace == CMYKColorspace)
     (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
       (double) (QuantumScale*wand->pixel.black));
-  if (wand->pixel.matte != MagickFalse)
+  if (wand->pixel.alpha_trait == BlendPixelTrait)
     (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
       (double) (QuantumScale*wand->pixel.alpha));
   return(ConstantString(color));
@@ -1067,9 +1067,9 @@ WandExport void PixelGetHSL(const PixelWand *wand,double *hue,
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  ConvertRGBToHSL(ClampToQuantum(wand->pixel.red),ClampToQuantum(
-    wand->pixel.green),ClampToQuantum(wand->pixel.blue),hue,saturation,
-    lightness);
+  ConvertRGBToHSL((double) ClampToQuantum(wand->pixel.red),(double)
+    ClampToQuantum(wand->pixel.green),(double) ClampToQuantum(wand->pixel.blue),
+    hue,saturation,lightness);
 }
 \f
 /*
@@ -1205,68 +1205,6 @@ WandExport void PixelGetMagickColor(const PixelWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   P i x e l G e t O p a c i t y                                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  PixelGetOpacity() returns the normalized opacity color of the pixel wand.
-%
-%  The format of the PixelGetOpacity method is:
-%
-%      double PixelGetOpacity(const PixelWand *wand)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the pixel wand.
-%
-*/
-WandExport double PixelGetOpacity(const PixelWand *wand)
-{
-  assert(wand != (const PixelWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  return((double) QuantumScale*wand->pixel.alpha);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   P i x e l G e t O p a c i t y Q u a n t u m                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  PixelGetOpacityQuantum() returns the opacity color of the pixel wand.
-%
-%  The format of the PixelGetOpacityQuantum method is:
-%
-%      Quantum PixelGetOpacityQuantum(const PixelWand *wand)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the pixel wand.
-%
-*/
-WandExport Quantum PixelGetOpacityQuantum(const PixelWand *wand)
-{
-  assert(wand != (const PixelWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  return(ClampToQuantum(wand->pixel.alpha));
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   P i x e l G e t P i x e l                                                 %
 %                                                                             %
 %                                                                             %
@@ -1304,11 +1242,11 @@ WandExport PixelInfo PixelGetPixel(const PixelWand *wand)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  PixelGetQuantumPacket() gets the packet of the pixel wand as a PixelPacket.
+%  PixelGetQuantumPacket() gets the packet of the pixel wand as a PixelInfo.
 %
 %  The format of the PixelGetQuantumPacket method is:
 %
-%      void PixelGetQuantumPacket(PixelWand *wand,PixelPacket *packet)
+%      void PixelGetQuantumPacket(PixelWand *wand,PixelInfo *packet)
 %
 %  A description of each parameter follows:
 %
@@ -1317,31 +1255,31 @@ WandExport PixelInfo PixelGetPixel(const PixelWand *wand)
 %    o packet:  The pixel wand packet is returned here.
 %
 */
-WandExport void PixelGetQuantumPacket(const PixelWand *wand,PixelPacket *packet)
+WandExport void PixelGetQuantumPacket(const PixelWand *wand,PixelInfo *packet)
 {
   assert(wand != (const PixelWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  assert(packet != (PixelPacket *) NULL);
-  packet->alpha=ClampToQuantum(wand->pixel.alpha);
+  assert(packet != (PixelInfo *) NULL);
+  packet->alpha=(double) ClampToQuantum(wand->pixel.alpha);
   if (wand->pixel.colorspace == CMYKColorspace)
     {
-      packet->red=ClampToQuantum((MagickRealType) QuantumRange-
+      packet->red=(double) ClampToQuantum(QuantumRange-
         (wand->pixel.red*(QuantumRange-wand->pixel.black)+
         wand->pixel.black));
-      packet->green=ClampToQuantum((MagickRealType) QuantumRange-
+      packet->green=(double) ClampToQuantum(QuantumRange-
         (wand->pixel.green*(QuantumRange-wand->pixel.black)+
         wand->pixel.black));
-      packet->blue=ClampToQuantum((MagickRealType) QuantumRange-
+      packet->blue=(double) ClampToQuantum(QuantumRange-
         (wand->pixel.blue*(QuantumRange-wand->pixel.black)+
         wand->pixel.black));
-      packet->black=ClampToQuantum(wand->pixel.black);
+      packet->black=(double) ClampToQuantum(wand->pixel.black);
       return;
     }
-  packet->red=ClampToQuantum(wand->pixel.red);
-  packet->green=ClampToQuantum(wand->pixel.green);
-  packet->blue=ClampToQuantum(wand->pixel.blue);
+  packet->red=(double) ClampToQuantum(wand->pixel.red);
+  packet->green=(double) ClampToQuantum(wand->pixel.green);
+  packet->blue=(double) ClampToQuantum(wand->pixel.blue);
 }
 \f
 /*
@@ -1355,7 +1293,7 @@ WandExport void PixelGetQuantumPacket(const PixelWand *wand,PixelPacket *packet)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  PixelGetQuantumPixel() gets the pixel of the pixel wand as a PixelPacket.
+%  PixelGetQuantumPixel() gets the pixel of the pixel wand as a PixelInfo.
 %
 %  The format of the PixelGetQuantumPixel method is:
 %
@@ -1380,13 +1318,13 @@ WandExport void PixelGetQuantumPixel(const Image *image,const PixelWand *wand,
   SetPixelAlpha(image,ClampToQuantum(wand->pixel.alpha),pixel);
   if (wand->pixel.colorspace == CMYKColorspace)
     {
-      SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange-
+      SetPixelRed(image,ClampToQuantum(QuantumRange-
         (wand->pixel.red*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
         pixel);
-      SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange-
+      SetPixelGreen(image,ClampToQuantum(QuantumRange-
         (wand->pixel.green*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
         pixel);
-      SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange-
+      SetPixelBlue(image,ClampToQuantum(QuantumRange-
         (wand->pixel.blue*(QuantumRange-wand->pixel.black)+wand->pixel.black)),
         pixel);
       SetPixelBlack(image,ClampToQuantum(wand->pixel.black),pixel);
@@ -1552,7 +1490,7 @@ WandExport void PixelSetAlpha(PixelWand *wand,const double alpha)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.alpha=ClampToQuantum(QuantumRange*alpha);
+  wand->pixel.alpha=(double) ClampToQuantum(QuantumRange*alpha);
 }
 \f
 /*
@@ -1571,22 +1509,22 @@ WandExport void PixelSetAlpha(PixelWand *wand,const double alpha)
 %  The format of the PixelSetAlphaQuantum method is:
 %
 %      void PixelSetAlphaQuantum(PixelWand *wand,
-%        const Quantum opacity)
+%        const Quantum alpha)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the pixel wand.
 %
-%    o opacity: the opacity color.
+%    o alpha: the alpha color.
 %
 */
-WandExport void PixelSetAlphaQuantum(PixelWand *wand,const Quantum opacity)
+WandExport void PixelSetAlphaQuantum(PixelWand *wand,const Quantum alpha)
 {
   assert(wand != (const PixelWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.alpha=(MagickRealType) opacity;
+  wand->pixel.alpha=(double) alpha;
 }
 \f
 /*
@@ -1619,8 +1557,7 @@ WandExport void PixelSetBlack(PixelWand *wand,const double black)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.black=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*black);
+  wand->pixel.black=(double) ClampToQuantum(QuantumRange*black);
 }
 \f
 /*
@@ -1653,7 +1590,7 @@ WandExport void PixelSetBlackQuantum(PixelWand *wand,const Quantum black)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.black=(MagickRealType) black;
+  wand->pixel.black=(double) black;
 }
 \f
 /*
@@ -1686,8 +1623,7 @@ WandExport void PixelSetBlue(PixelWand *wand,const double blue)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*blue);
+  wand->pixel.blue=(double) ClampToQuantum(QuantumRange*blue);
 }
 \f
 /*
@@ -1720,7 +1656,7 @@ WandExport void PixelSetBlueQuantum(PixelWand *wand,const Quantum blue)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.blue=(MagickRealType) blue;
+  wand->pixel.blue=(double) blue;
 }
 \f
 /*
@@ -1760,7 +1696,7 @@ WandExport MagickBooleanType PixelSetColor(PixelWand *wand,const char *color)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  status=QueryMagickColorCompliance(color,AllCompliance,&pixel,wand->exception);
+  status=QueryColorCompliance(color,AllCompliance,&pixel,wand->exception);
   if (status != MagickFalse)
     wand->pixel=pixel;
   return(status);
@@ -1814,7 +1750,7 @@ WandExport void PixelSetColorCount(PixelWand *wand,const size_t count)
 %
 %  The format of the PixelSetColorFromWand method is:
 %
-%      PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
+%      void PixelSetColorFromWand(PixelWand *wand,const PixelWand *color)
 %
 %  A description of each parameter follows:
 %
@@ -1863,8 +1799,7 @@ WandExport void PixelSetCyan(PixelWand *wand,const double cyan)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*cyan);
+  wand->pixel.red=(double) ClampToQuantum(QuantumRange*cyan);
 }
 \f
 /*
@@ -1897,7 +1832,7 @@ WandExport void PixelSetCyanQuantum(PixelWand *wand,const Quantum cyan)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.red=(MagickRealType) cyan;
+  wand->pixel.red=(double) cyan;
 }
 \f
 /*
@@ -1930,7 +1865,7 @@ WandExport void PixelSetFuzz(PixelWand *wand,const double fuzz)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.fuzz=(MagickRealType) fuzz;
+  wand->pixel.fuzz=(double) fuzz;
 }
 \f
 /*
@@ -1963,8 +1898,7 @@ WandExport void PixelSetGreen(PixelWand *wand,const double green)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*green);
+  wand->pixel.green=(double) ClampToQuantum(QuantumRange*green);
 }
 \f
 /*
@@ -1997,7 +1931,7 @@ WandExport void PixelSetGreenQuantum(PixelWand *wand,const Quantum green)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.green=(MagickRealType) green;
+  wand->pixel.green=(double) green;
 }
 \f
 /*
@@ -2039,9 +1973,9 @@ WandExport void PixelSetHSL(PixelWand *wand,const double hue,
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
-  wand->pixel.red=(MagickRealType) red;
-  wand->pixel.green=(MagickRealType) green;
-  wand->pixel.blue=(MagickRealType) blue;
+  wand->pixel.red=(double) red;
+  wand->pixel.green=(double) green;
+  wand->pixel.blue=(double) blue;
 }
 \f
 /*
@@ -2074,7 +2008,7 @@ WandExport void PixelSetIndex(PixelWand *wand,const Quantum index)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.index=(MagickRealType) index;
+  wand->pixel.index=(double) index;
 }
 \f
 /*
@@ -2107,8 +2041,7 @@ WandExport void PixelSetMagenta(PixelWand *wand,const double magenta)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*magenta);
+  wand->pixel.green=(double) ClampToQuantum(QuantumRange*magenta);
 }
 \f
 /*
@@ -2142,7 +2075,7 @@ WandExport void PixelSetMagentaQuantum(PixelWand *wand,const Quantum magenta)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.green=(MagickRealType) magenta;
+  wand->pixel.green=(double) magenta;
 }
 \f
 /*
@@ -2150,17 +2083,17 @@ WandExport void PixelSetMagentaQuantum(PixelWand *wand,const Quantum magenta)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   P i x e l S e t M a g i c k C o l o r                                     %
+%   P i x e l S e t P i x e l C o l o r                                       %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  PixelSetPixelInfo() sets the color of the pixel wand.
+%  PixelSetPixelColor() sets the color of the pixel wand.
 %
-%  The format of the PixelSetPixelInfo method is:
+%  The format of the PixelSetPixelColor method is:
 %
-%      PixelSetPixelInfo(PixelWand *wand,const PixelInfo *color)
+%      void PixelSetPixelColor(PixelWand *wand,const PixelInfo *color)
 %
 %  A description of each parameter follows:
 %
@@ -2169,8 +2102,7 @@ WandExport void PixelSetMagentaQuantum(PixelWand *wand,const Quantum magenta)
 %    o color: the pixel wand color.
 %
 */
-WandExport void PixelSetPixelInfo(PixelWand *wand,
-  const PixelInfo *color)
+WandExport void PixelSetPixelColor(PixelWand *wand,const PixelInfo *color)
 {
   assert(wand != (const PixelWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -2185,114 +2117,6 @@ WandExport void PixelSetPixelInfo(PixelWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   P i x e l S e t O p a c i t y                                             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  PixelSetOpacity() sets the normalized opacity color of the pixel wand.
-%
-%  The format of the PixelSetOpacity method is:
-%
-%      void PixelSetOpacity(PixelWand *wand,const double opacity)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the pixel wand.
-%
-%    o opacity: the opacity color.
-%
-*/
-WandExport void PixelSetOpacity(PixelWand *wand,const double opacity)
-{
-  assert(wand != (const PixelWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.matte=MagickTrue;
-  wand->pixel.alpha=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*opacity);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   P i x e l S e t O p a c i t y Q u a n t u m                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  PixelSetOpacityQuantum() sets the opacity color of the pixel wand.
-%
-%  The format of the PixelSetOpacityQuantum method is:
-%
-%      void PixelSetOpacityQuantum(PixelWand *wand,
-%        const Quantum opacity)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the pixel wand.
-%
-%    o opacity: the opacity color.
-%
-*/
-WandExport void PixelSetOpacityQuantum(PixelWand *wand,const Quantum opacity)
-{
-  assert(wand != (const PixelWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.alpha=(MagickRealType) opacity;
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   P i x e l S e t Q u a n t u m P a c k e t                                 %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  PixelSetQuantumPacket() sets the packet of the pixel wand.
-%
-%  The format of the PixelSetQuantumPacket method is:
-%
-%      PixelSetQuantumPacket(PixelWand *wand,const PixelPacket *packet)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the pixel wand.
-%
-%    o packet: the pixel wand packet.
-%
-*/
-WandExport void PixelSetQuantumPacket(PixelWand *wand,const PixelPacket *packet)
-{
-  assert(wand != (const PixelWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  assert(packet != (PixelPacket *) NULL);
-  wand->pixel.red=(MagickRealType) packet->red;
-  wand->pixel.green=(MagickRealType) packet->green;
-  wand->pixel.blue=(MagickRealType) packet->blue;
-  wand->pixel.black=(MagickRealType) packet->black;
-  wand->pixel.alpha=(MagickRealType) packet->alpha;
-  wand->pixel.matte=packet->alpha != OpaqueAlpha ? MagickTrue : MagickFalse;
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   P i x e l S e t Q u a n t u m P i x e l                                   %
 %                                                                             %
 %                                                                             %
@@ -2303,7 +2127,7 @@ WandExport void PixelSetQuantumPacket(PixelWand *wand,const PixelPacket *packet)
 %
 %  The format of the PixelSetQuantumPixel method is:
 %
-%      PixelSetQuantumPixel(const Image *image,const QixelPixel *pixel,
+%      void PixelSetQuantumPixel(const Image *image,const Quantum *pixel,
 %        PixelWand *wand)
 %
 %  A description of each parameter follows:
@@ -2321,13 +2145,13 @@ WandExport void PixelSetQuantumPixel(const Image *image,const Quantum *pixel,
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   assert(pixel != (Quantum *) NULL);
-  wand->pixel.red=(MagickRealType) GetPixelRed(image,pixel);
-  wand->pixel.green=(MagickRealType) GetPixelGreen(image,pixel);
-  wand->pixel.blue=(MagickRealType) GetPixelBlue(image,pixel);
-  wand->pixel.black=(MagickRealType) GetPixelBlack(image,pixel);
-  wand->pixel.alpha=(MagickRealType) GetPixelAlpha(image,pixel);
-  wand->pixel.matte=GetPixelAlpha(image,pixel) != OpaqueAlpha ? MagickTrue :
-    MagickFalse;
+  wand->pixel.red=(double) GetPixelRed(image,pixel);
+  wand->pixel.green=(double) GetPixelGreen(image,pixel);
+  wand->pixel.blue=(double) GetPixelBlue(image,pixel);
+  wand->pixel.black=(double) GetPixelBlack(image,pixel);
+  wand->pixel.alpha=(double) GetPixelAlpha(image,pixel);
+  wand->pixel.alpha_trait=GetPixelAlpha(image,pixel) != OpaqueAlpha ?
+    BlendPixelTrait : UndefinedPixelTrait;
 }
 \f
 /*
@@ -2360,8 +2184,7 @@ WandExport void PixelSetRed(PixelWand *wand,const double red)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*red);
+  wand->pixel.red=(double) ClampToQuantum(QuantumRange*red);
 }
 \f
 /*
@@ -2394,7 +2217,7 @@ WandExport void PixelSetRedQuantum(PixelWand *wand,const Quantum red)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.red=(MagickRealType) red;
+  wand->pixel.red=(double) red;
 }
 \f
 /*
@@ -2427,8 +2250,7 @@ WandExport void PixelSetYellow(PixelWand *wand,const double yellow)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
-    QuantumRange*yellow);
+  wand->pixel.blue=(double) ClampToQuantum(QuantumRange*yellow);
 }
 \f
 /*
@@ -2461,5 +2283,5 @@ WandExport void PixelSetYellowQuantum(PixelWand *wand,const Quantum yellow)
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  wand->pixel.blue=(MagickRealType) yellow;
+  wand->pixel.blue=(double) yellow;
 }