% 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 %
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
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));
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
/*
% %
% %
% %
-% 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 %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% 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:
%
% 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
/*
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% 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:
%
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);
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
/*
% 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
/*
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
/*
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
/*
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
/*
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
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- status=QueryMagickColor(color,&pixel,wand->exception);
+ status=QueryColorCompliance(color,AllCompliance,&pixel,wand->exception);
if (status != MagickFalse)
wand->pixel=pixel;
return(status);
%
% 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:
%
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
/*
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
/*
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
/*
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
/*
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
/*
WandExport void PixelSetHSL(PixelWand *wand,const double hue,
const double saturation,const double lightness)
{
- Quantum
+ double
blue,
green,
red;
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
/*
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
/*
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
/*
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
/*
% %
% %
% %
-% 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:
%
% 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);
% %
% %
% %
-% 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 %
% %
% %
%
% 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:
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
/*
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
/*
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
/*
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
/*
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;
}