/*
Determine RGB values of the pen color.
*/
- flags=ParseGeometry(blend,&geometry_info);
GetPixelInfo(image,&pixel);
+ flags=ParseGeometry(blend,&geometry_info);
pixel.red=geometry_info.rho;
pixel.green=geometry_info.rho;
pixel.blue=geometry_info.rho;
%
% The format of the TintImage method is:
%
-% Image *TintImage(const Image *image,const char *opacity,
+% Image *TintImage(const Image *image,const char *blend,
% const PixelInfo *tint,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image.
%
-% o opacity: A color value used for tinting.
+% o blend: A color value used for tinting.
%
% o tint: A color value used for tinting.
%
% o exception: return any errors or warnings in this structure.
%
*/
-MagickExport Image *TintImage(const Image *image,const char *opacity,
+MagickExport Image *TintImage(const Image *image,const char *blend,
const PixelInfo *tint,ExceptionInfo *exception)
{
#define TintImageTag "Tint/Image"
Determine RGB values of the color.
*/
GetPixelInfo(image,&pixel);
- flags=ParseGeometry(opacity,&geometry_info);
+ flags=ParseGeometry(blend,&geometry_info);
pixel.red=geometry_info.rho;
pixel.green=geometry_info.rho;
pixel.blue=geometry_info.rho;
- pixel.black=geometry_info.rho;
pixel.alpha=OpaqueAlpha;
if ((flags & SigmaValue) != 0)
pixel.green=geometry_info.sigma;
if ((flags & XiValue) != 0)
pixel.blue=geometry_info.xi;
+ if ((flags & PsiValue) != 0)
+ pixel.alpha=geometry_info.psi;
if (image->colorspace == CMYKColorspace)
{
+ pixel.black=geometry_info.rho;
if ((flags & PsiValue) != 0)
pixel.black=geometry_info.psi;
if ((flags & ChiValue) != 0)
pixel.alpha=geometry_info.chi;
}
- else
- if ((flags & PsiValue) != 0)
- pixel.alpha=geometry_info.psi;
intensity=(MagickRealType) GetPixelInfoIntensity(tint);
color_vector.red=(MagickRealType) (pixel.red*tint->red/100.0-intensity);
color_vector.green=(MagickRealType) (pixel.green*tint->green/100.0-intensity);
PixelInfo
target;
- Quantum
- virtual_pixel[MaxPixelChannels];
-
assert(wand != (MagickWand *) NULL);
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
PixelGetAlphaQuantum(blend)));
- PixelGetQuantumPixel(wand->images,colorize,virtual_pixel);
- GetPixelInfo(wand->images,&target);
- target.red=virtual_pixel[RedPixelChannel];
- target.green=virtual_pixel[GreenPixelChannel];
- target.blue=virtual_pixel[BluePixelChannel];
- target.black=virtual_pixel[BlackPixelChannel];
- target.alpha=virtual_pixel[AlphaPixelChannel];
+ target=PixelGetPixel(tint);
colorize_image=ColorizeImage(wand->images,percent_blend,&target,
wand->exception);
if (colorize_image == (Image *) NULL)
% The format of the MagickTintImage method is:
%
% MagickBooleanType MagickTintImage(MagickWand *wand,
-% const PixelWand *tint,const PixelWand *alpha)
+% const PixelWand *tint,const PixelWand *blend)
%
% A description of each parameter follows:
%
%
*/
WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
- const PixelWand *tint,const PixelWand *alpha)
+ const PixelWand *tint,const PixelWand *blend)
{
char
- percent_opaque[MaxTextExtent];
+ percent_blend[MaxTextExtent];
Image
*tint_image;
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
if (wand->images->colorspace != CMYKColorspace)
- (void) FormatLocaleString(percent_opaque,MaxTextExtent,
+ (void) FormatLocaleString(percent_blend,MaxTextExtent,
"%g,%g,%g,%g",(double) (100.0*QuantumScale*
- PixelGetRedQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetGreenQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetBlueQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetAlphaQuantum(alpha)));
+ PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetAlphaQuantum(blend)));
else
- (void) FormatLocaleString(percent_opaque,MaxTextExtent,
+ (void) FormatLocaleString(percent_blend,MaxTextExtent,
"%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
- PixelGetCyanQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetMagentaQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetYellowQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetBlackQuantum(alpha)),(double) (100.0*QuantumScale*
- PixelGetAlphaQuantum(alpha)));
+ PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
+ PixelGetAlphaQuantum(blend)));
target=PixelGetPixel(tint);
- tint_image=TintImage(wand->images,percent_opaque,&target,wand->exception);
+ tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
if (tint_image == (Image *) NULL)
return(MagickFalse);
ReplaceImageInList(&wand->images,tint_image);
{ "Thumbnail", { {"geometry", StringReference}, {"width", IntegerReference},
{"height", IntegerReference} } },
{ "Strip", },
- { "Tint", { {"fill", StringReference}, {"opacity", StringReference} } },
+ { "Tint", { {"fill", StringReference}, {"blend", StringReference} } },
{ "Channel", { {"channel", MagickChannelOptions} } },
{ "Splice", { {"geometry", StringReference}, {"width", IntegerReference},
{"height", IntegerReference}, {"x", IntegerReference},