2017-02-15 7.0.4-10 Cristy <quetzlzacatenango@image...>
* Prevent random pixel data for corrupt JPEG image (bug report from
Hirokazu Moriguchi, Sony).
+ * Restore -mattecolor option.
2017-02-14 7.0.4-9 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.4-9, GIT revision 19580:d474b37:20170214.
clone_image=CloneImage(image,0,0,MagickTrue,exception);
if (clone_image == (Image *) NULL)
return((Image *) NULL);
- clone_image->alpha_color=image->border_color;
+ clone_image->matte_color=image->border_color;
border_image=FrameImage(clone_image,&frame_info,compose,exception);
clone_image=DestroyImage(clone_image);
if (border_image != (Image *) NULL)
- border_image->alpha_color=image->alpha_color;
+ border_image->matte_color=image->matte_color;
return(border_image);
}
\f
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% FrameImage() adds a simulated three-dimensional border around the image.
-% The color of the border is defined by the alpha_color member of image.
+% The color of the border is defined by the matte_color member of image.
% Members width and height of frame_info specify the border width of the
% vertical and horizontal sides of the frame. Members inner and outer
% indicate the width of the inner and outer shadows of the frame.
if ((IsPixelInfoGray(&frame_image->border_color) == MagickFalse) &&
(IsGrayColorspace(frame_image->colorspace) != MagickFalse))
(void) SetImageColorspace(frame_image,sRGBColorspace,exception);
- if ((frame_image->alpha_color.alpha_trait != UndefinedPixelTrait) &&
+ if ((frame_image->matte_color.alpha_trait != UndefinedPixelTrait) &&
(frame_image->alpha_trait == UndefinedPixelTrait))
(void) SetImageAlpha(frame_image,OpaqueAlpha,exception);
frame_image->page=image->page;
/*
Initialize 3D effects color.
*/
- matte=image->alpha_color;
+ matte=image->matte_color;
accentuate=matte;
accentuate.red=(double) (QuantumScale*((QuantumRange-
AccentuateModulate)*matte.red+(QuantumRange*AccentuateModulate)));
exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) QueryColorCompliance(color,AllCompliance,&(*image)->alpha_color,
+ (void) QueryColorCompliance(color,AllCompliance,&(*image)->matte_color,
exception);
(void) ParsePageGeometry(*image,geometry,&page_geometry,
exception);
}
/* Initialize default pixel validity
- * negative: pixel is invalid output 'alpha_color'
+ * negative: pixel is invalid output 'matte_color'
* 0.0 to 1.0: antialiased, mix with resample output
* 1.0 or greater: use resampled output.
*/
validity = 1.0;
- ConformPixelInfo(distort_image,&distort_image->alpha_color,&invalid,
+ ConformPixelInfo(distort_image,&distort_image->matte_color,&invalid,
exception);
for (i=0; i < (ssize_t) distort_image->columns; i++)
{
if (i == (NumberTiles/2))
{
(void) QueryColorCompliance("#dfdfdf",AllCompliance,
- &thumbnail->alpha_color,exception);
+ &thumbnail->matte_color,exception);
AppendImageToList(&images,thumbnail);
continue;
}
(void) FormatLocaleFile(file," Tile geometry: %.20gx%.20g%+.20g%+.20g\n",
(double) image->extract_info.width,(double) image->extract_info.height,
(double) image->extract_info.x,(double) image->extract_info.y);
- (void) QueryColorname(image,&image->alpha_color,SVGCompliance,color,
+ (void) QueryColorname(image,&image->matte_color,SVGCompliance,color,
exception);
- (void) FormatLocaleFile(file," Alpha color: %s\n",color);
+ (void) FormatLocaleFile(file," Matte color: %s\n",color);
(void) QueryColorname(image,&image->background_color,SVGCompliance,color,
exception);
(void) FormatLocaleFile(file," Background color: %s\n",color);
Constant declaration.
*/
const char
- AlphaColor[] = "#bdbdbd", /* gray */
BackgroundColor[] = "#ffffff", /* white */
BorderColor[] = "#dfdfdf", /* gray */
DefaultTileFrame[] = "15x15+3+3",
ForegroundColor[] = "#000", /* black */
LoadImageTag[] = "Load/Image",
LoadImagesTag[] = "Load/Images",
+ MatteColor[] = "#bdbdbd", /* gray */
PSDensityGeometry[] = "72.0x72.0",
PSPageGeometry[] = "612x792",
SaveImageTag[] = "Save/Image",
image->interlace=NoInterlace;
image->ticks_per_second=UndefinedTicksPerSecond;
image->compose=OverCompositeOp;
- (void) QueryColorCompliance(AlphaColor,AllCompliance,&image->alpha_color,
+ (void) QueryColorCompliance(MatteColor,AllCompliance,&image->matte_color,
exception);
(void) QueryColorCompliance(BackgroundColor,AllCompliance,
&image->background_color,exception);
if (image_info->depth != 0)
image->depth=image_info->depth;
image->dither=image_info->dither;
- image->alpha_color=image_info->alpha_color;
+ image->matte_color=image_info->matte_color;
image->background_color=image_info->background_color;
image->border_color=image_info->border_color;
image->transparent_color=image_info->transparent_color;
(void) CloneString(&clone_info->density,image_info->density);
clone_info->pointsize=image_info->pointsize;
clone_info->fuzz=image_info->fuzz;
- clone_info->alpha_color=image_info->alpha_color;
+ clone_info->matte_color=image_info->matte_color;
clone_info->background_color=image_info->background_color;
clone_info->border_color=image_info->border_color;
clone_info->transparent_color=image_info->transparent_color;
synchronize=DestroyString(synchronize);
}
exception=AcquireExceptionInfo();
- (void) QueryColorCompliance(AlphaColor,AllCompliance,&image_info->alpha_color,
- exception);
(void) QueryColorCompliance(BackgroundColor,AllCompliance,
&image_info->background_color,exception);
(void) QueryColorCompliance(BorderColor,AllCompliance,
&image_info->border_color,exception);
+ (void) QueryColorCompliance(MatteColor,AllCompliance,&image_info->matte_color,
+ exception);
(void) QueryColorCompliance(TransparentColor,AllCompliance,
&image_info->transparent_color,exception);
exception=DestroyExceptionInfo(exception);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- option=GetImageOption(image_info,"alpha-color");
- if (option != (const char *) NULL)
- (void) QueryColorCompliance(option,AllCompliance,&image->alpha_color,
- exception);
option=GetImageOption(image_info,"background");
if (option != (const char *) NULL)
(void) QueryColorCompliance(option,AllCompliance,&image->background_color,
option=GetImageOption(image_info,"loop");
if (option != (const char *) NULL)
image->iterations=StringToUnsignedLong(option);
+ option=GetImageOption(image_info,"mattecolor");
+ if (option != (const char *) NULL)
+ (void) QueryColorCompliance(option,AllCompliance,&image->matte_color,
+ exception);
option=GetImageOption(image_info,"orient");
if (option != (const char *) NULL)
image->orientation=(OrientationType) ParseCommandOption(
PixelInfo
*colormap,
- alpha_color, /* current alphacolor attribute */
+ alpha_color, /* deprecated */
background_color, /* current background color attribute */
border_color, /* current bordercolor attribute */
transparent_color; /* color for 'transparent' color index in GIF */
size_t
signature;
+
+ PixelInfo
+ matte_color; /* current mattecolor attribute */
};
/*
fuzz; /* current color fuzz attribute */
PixelInfo
- alpha_color, /* alpha (frame) color */
+ alpha_color, /* deprecated */
background_color, /* user set background color */
border_color, /* user set border color */
transparent_color; /* color for transparent index in color tables */
CustomStreamInfo
*custom_stream;
+
+ PixelInfo
+ matte_color; /* matte (frame) color */
};
extern MagickExport ChannelType
clone_info->shadow=montage_info->shadow;
clone_info->fill=montage_info->fill;
clone_info->stroke=montage_info->stroke;
- clone_info->alpha_color=montage_info->alpha_color;
+ clone_info->matte_color=montage_info->matte_color;
clone_info->background_color=montage_info->background_color;
clone_info->border_color=montage_info->border_color;
clone_info->gravity=montage_info->gravity;
montage_info->pointsize=image_info->pointsize;
montage_info->fill.alpha=OpaqueAlpha;
montage_info->stroke.alpha=(Quantum) TransparentAlpha;
- montage_info->alpha_color=image_info->alpha_color;
+ montage_info->matte_color=image_info->matte_color;
montage_info->background_color=image_info->background_color;
montage_info->border_color=image_info->border_color;
montage_info->debug=IsEventLogging();
shadow;
PixelInfo
- alpha_color,
+ alpha_color, /* deprecated */
background_color,
border_color,
fill,
size_t
signature;
+
+ PixelInfo
+ matte_color;
} MontageInfo;
extern MagickExport Image
{ "-affine", 1L, ReplacedOptionFlag | DrawInfoOptionFlag, MagickTrue },
{ "+affinity", 0L, DeprecateOptionFlag, MagickTrue },
{ "-affinity", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
- { "+alpha-color", 0L, ImageInfoOptionFlag, MagickFalse },
- { "-alpha-color", 1L, ImageInfoOptionFlag, MagickFalse },
+ { "+mattecolor", 0L, ImageInfoOptionFlag, MagickFalse },
+ { "-mattecolor", 1L, ImageInfoOptionFlag, MagickFalse },
{ "+annotate", 0L, DeprecateOptionFlag, MagickTrue },
{ "-annotate", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse },
{ "-antialias", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
image->compression=clone_image->compression;
image->quality=clone_image->quality;
image->depth=clone_image->depth;
- image->alpha_color=clone_image->alpha_color;
+ image->matte_color=clone_image->matte_color;
image->background_color=clone_image->background_color;
image->border_color=clone_image->border_color;
image->transparent_color=clone_image->transparent_color;
else
if (raised)
(void) XSetForeground(display,window_info->widget_context,
- window_info->pixel_info->alpha_color.pixel);
+ window_info->pixel_info->matte_color.pixel);
else
(void) XSetForeground(display,window_info->widget_context,
window_info->pixel_info->depth_color.pixel);
}
foreground=(ssize_t) XPixelIntensity(
&window_info->pixel_info->foreground_color);
- matte=(ssize_t) XPixelIntensity(&window_info->pixel_info->alpha_color);
+ matte=(ssize_t) XPixelIntensity(&window_info->pixel_info->matte_color);
if (MagickAbsoluteValue((int) (foreground-matte)) > (65535L >> 3))
(void) XSetForeground(display,window_info->widget_context,
window_info->pixel_info->foreground_color.pixel);
/*
Display the selected color in a drawing area.
*/
- color=windows->widget.pixel_info->alpha_color;
+ color=windows->widget.pixel_info->matte_color;
(void) XParseColor(display,windows->widget.map_info->colormap,
- reply_info.text,&windows->widget.pixel_info->alpha_color);
+ reply_info.text,&windows->widget.pixel_info->matte_color);
XBestPixel(display,windows->widget.map_info->colormap,(XColor *) NULL,
(unsigned int) windows->widget.visual_info->colormap_size,
- &windows->widget.pixel_info->alpha_color);
+ &windows->widget.pixel_info->matte_color);
mode_info.text=colorname;
- (void) FormatLocaleString(mode_info.text,MagickPathExtent,"#%02x%02x%02x",
- windows->widget.pixel_info->alpha_color.red,
- windows->widget.pixel_info->alpha_color.green,
- windows->widget.pixel_info->alpha_color.blue);
+ (void) FormatLocaleString(mode_info.text,MagickPathExtent,
+ "#%02x%02x%02x",windows->widget.pixel_info->matte_color.red,
+ windows->widget.pixel_info->matte_color.green,
+ windows->widget.pixel_info->matte_color.blue);
XDrawBeveledButton(display,&windows->widget,&mode_info);
- windows->widget.pixel_info->alpha_color=color;
+ windows->widget.pixel_info->matte_color=color;
state&=(~RedrawActionState);
}
/*
*pixels;
XColor
- alpha_color,
+ alpha_color, /* deprecated */
foreground_color,
background_color,
border_color,
unsigned short
box_index,
pen_index;
+
+ XColor
+ matte_color;
} XPixelInfo;
typedef struct _XResourceInfo
*image_geometry;
char
- *alpha_color,
+ *alpha_color, /* deprecated */
*map_type,
*name;
char
home_directory[MagickPathExtent];
+
+ char
+ *matte_color;
} XResourceInfo;
typedef struct _XWindowInfo
/*
Set matte color.
*/
- pixel->alpha_color=pixel->background_color;
- if (resource_info->alpha_color != (char *) NULL)
+ pixel->matte_color=pixel->background_color;
+ if (resource_info->matte_color != (char *) NULL)
{
/*
Matte color is specified as a X resource or command line argument.
*/
- status=XParseColor(display,colormap,resource_info->alpha_color,
- &pixel->alpha_color);
+ status=XParseColor(display,colormap,resource_info->matte_color,
+ &pixel->matte_color);
if (status == False)
ThrowXWindowException(XServerError,"ColorIsNotKnownToServer",
- resource_info->alpha_color);
- pixel->alpha_color.pixel=XStandardPixel(map_info,&pixel->alpha_color);
- pixel->alpha_color.flags=(char) (DoRed | DoGreen | DoBlue);
+ resource_info->matte_color);
+ pixel->matte_color.pixel=XStandardPixel(map_info,&pixel->matte_color);
+ pixel->matte_color.flags=(char) (DoRed | DoGreen | DoBlue);
}
/*
Set highlight color.
*/
pixel->highlight_color.red=(unsigned short) (((double)
- pixel->alpha_color.red*ScaleQuantumToShort(HighlightModulate))/65535L+
+ pixel->matte_color.red*ScaleQuantumToShort(HighlightModulate))/65535L+
(ScaleQuantumToShort((Quantum) (QuantumRange-HighlightModulate))));
pixel->highlight_color.green=(unsigned short) (((double)
- pixel->alpha_color.green*ScaleQuantumToShort(HighlightModulate))/65535L+
+ pixel->matte_color.green*ScaleQuantumToShort(HighlightModulate))/65535L+
(ScaleQuantumToShort((Quantum) (QuantumRange-HighlightModulate))));
pixel->highlight_color.blue=(unsigned short) (((double)
- pixel->alpha_color.blue*ScaleQuantumToShort(HighlightModulate))/65535L+
+ pixel->matte_color.blue*ScaleQuantumToShort(HighlightModulate))/65535L+
(ScaleQuantumToShort((Quantum) (QuantumRange-HighlightModulate))));
pixel->highlight_color.pixel=XStandardPixel(map_info,&pixel->highlight_color);
pixel->highlight_color.flags=(char) (DoRed | DoGreen | DoBlue);
Set shadow color.
*/
pixel->shadow_color.red=(unsigned short) (((double)
- pixel->alpha_color.red*ScaleQuantumToShort(ShadowModulate))/65535L);
+ pixel->matte_color.red*ScaleQuantumToShort(ShadowModulate))/65535L);
pixel->shadow_color.green=(unsigned short) (((double)
- pixel->alpha_color.green*ScaleQuantumToShort(ShadowModulate))/65535L);
+ pixel->matte_color.green*ScaleQuantumToShort(ShadowModulate))/65535L);
pixel->shadow_color.blue=(unsigned short) (((double)
- pixel->alpha_color.blue*ScaleQuantumToShort(ShadowModulate))/65535L);
+ pixel->matte_color.blue*ScaleQuantumToShort(ShadowModulate))/65535L);
pixel->shadow_color.pixel=XStandardPixel(map_info,&pixel->shadow_color);
pixel->shadow_color.flags=(char) (DoRed | DoGreen | DoBlue);
/*
Set depth color.
*/
pixel->depth_color.red=(unsigned short) (((double)
- pixel->alpha_color.red*ScaleQuantumToShort(DepthModulate))/65535L);
+ pixel->matte_color.red*ScaleQuantumToShort(DepthModulate))/65535L);
pixel->depth_color.green=(unsigned short) (((double)
- pixel->alpha_color.green*ScaleQuantumToShort(DepthModulate))/65535L);
+ pixel->matte_color.green*ScaleQuantumToShort(DepthModulate))/65535L);
pixel->depth_color.blue=(unsigned short) (((double)
- pixel->alpha_color.blue*ScaleQuantumToShort(DepthModulate))/65535L);
+ pixel->matte_color.blue*ScaleQuantumToShort(DepthModulate))/65535L);
pixel->depth_color.pixel=XStandardPixel(map_info,&pixel->depth_color);
pixel->depth_color.flags=(char) (DoRed | DoGreen | DoBlue);
/*
Set trough color.
*/
pixel->trough_color.red=(unsigned short) (((double)
- pixel->alpha_color.red*ScaleQuantumToShort(TroughModulate))/65535L);
+ pixel->matte_color.red*ScaleQuantumToShort(TroughModulate))/65535L);
pixel->trough_color.green=(unsigned short) (((double)
- pixel->alpha_color.green*ScaleQuantumToShort(TroughModulate))/65535L);
+ pixel->matte_color.green*ScaleQuantumToShort(TroughModulate))/65535L);
pixel->trough_color.blue=(unsigned short) (((double)
- pixel->alpha_color.blue*ScaleQuantumToShort(TroughModulate))/65535L);
+ pixel->matte_color.blue*ScaleQuantumToShort(TroughModulate))/65535L);
pixel->trough_color.pixel=XStandardPixel(map_info,&pixel->trough_color);
pixel->trough_color.flags=(char) (DoRed | DoGreen | DoBlue);
/*
resource_info->quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);
resource_info->close_server=MagickTrue;
resource_info->client_name=AcquireString(client_name);
- resource_info->alpha_color=XGetResourceInstance(database,client_name,
- "alpha-color",(char *) NULL);
resource_value=XGetResourceClass(database,client_name,"backdrop",
(char *) "False");
resource_info->backdrop=IsStringTrue(resource_value);
resource_info->magnify=(unsigned int) StringToUnsignedLong(resource_value);
resource_info->map_type=XGetResourceClass(database,client_name,"map",
(char *) NULL);
+ resource_info->matte_color=XGetResourceInstance(database,client_name,
+ "mattecolor",(char *) NULL);
resource_info->name=ConstantString(XGetResourceClass(database,client_name,
"name",(char *) NULL));
resource_info->pen_colors[0]=XGetResourceClass(database,client_name,"pen1",
(void) XAllocColor(display,colormap,&pixel->foreground_color);
(void) XAllocColor(display,colormap,&pixel->background_color);
(void) XAllocColor(display,colormap,&pixel->border_color);
- (void) XAllocColor(display,colormap,&pixel->alpha_color);
+ (void) XAllocColor(display,colormap,&pixel->matte_color);
(void) XAllocColor(display,colormap,&pixel->highlight_color);
(void) XAllocColor(display,colormap,&pixel->shadow_color);
(void) XAllocColor(display,colormap,&pixel->depth_color);
XBestPixel(display,colormap,colors,(unsigned int) number_colors,
&pixel->border_color);
XBestPixel(display,colormap,colors,(unsigned int) number_colors,
- &pixel->alpha_color);
+ &pixel->matte_color);
XBestPixel(display,colormap,colors,(unsigned int) number_colors,
&pixel->highlight_color);
XBestPixel(display,colormap,colors,(unsigned int) number_colors,
(void) printf(
"resources as command line options: -background, -bordercolor,\n");
(void) printf(
- "-alpha-color, -borderwidth, -font, -foreground, -iconGeometry,\n");
+ "-mattecolor, -borderwidth, -font, -foreground, -iconGeometry,\n");
(void) printf("-iconic, -name, -shared-memory, or -title.\n");
(void) printf(
"\nBy default, the image format of 'file' is determined by its magic\n");
"UnrecognizedAlphaChannelOption",argv[i]);
break;
}
- if (LocaleCompare("alpha-color",option+1) == 0)
- {
- if (*option == '+')
- break;
- i++;
- if (i == (ssize_t) argc)
- ThrowAnimateException(OptionError,"MissingArgument",option);
- resource_info.alpha_color=argv[i];
- break;
- }
if (LocaleCompare("authenticate",option+1) == 0)
{
if (*option == '+')
}
if (LocaleCompare("matte",option+1) == 0)
break;
+ if (LocaleCompare("mattecolor",option+1) == 0)
+ {
+ if (*option == '+')
+ break;
+ i++;
+ if (i == (ssize_t) argc)
+ ThrowAnimateException(OptionError,"MissingArgument",option);
+ resource_info.matte_color=argv[i];
+ break;
+ }
if (LocaleCompare("monitor",option+1) == 0)
break;
if (LocaleCompare("monochrome",option+1) == 0)
"-adjoin join images into a single multi-image file",
"-affine matrix affine transform matrix",
"-alpha option activate, deactivate, reset, or set the alpha channel",
- "-alpha-color color frame color",
"-antialias remove pixel-aliasing",
"-authenticate password",
" decipher image with this password",
"-limit type value pixel cache resource limit",
"-loop iterations add Netscape loop extension to your GIF animation",
"-matte store matte channel if the image has one",
+ "-mattecolor color frame color",
"-moments report image moments",
"-monitor monitor progress",
"-orient type image orientation",
"UnrecognizedAlphaChannelOption",argv[i]);
break;
}
- if (LocaleCompare("alpha-color", option + 1) == 0)
- {
- if (*option == '+')
- break;
- i++;
- if (i == (ssize_t)argc)
- ThrowConvertException(OptionError, "MissingArgument", option);
- break;
- }
if (LocaleCompare("annotate",option+1) == 0)
{
if (*option == '+')
}
if (LocaleCompare("matte",option+1) == 0)
break;
+ if (LocaleCompare("mattecolor",option+1) == 0)
+ {
+ if (*option == '+')
+ break;
+ i++;
+ if (i == (ssize_t)argc)
+ ThrowConvertException(OptionError, "MissingArgument", option);
+ break;
+ }
if (LocaleCompare("maximum",option+1) == 0)
break;
if (LocaleCompare("mean-shift",option+1) == 0)
#include "MagickCore/thread-private.h"
\f
#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
-
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% M a g i c k G e t I m a g e A l p h a C o l o r %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MagickGetImageAlphaColor() returns the image alpha color.
+%
+% The format of the MagickGetImageAlphaColor method is:
+%
+% MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand,
+% PixelWand *alpha_color)
+%
+% A description of each parameter follows:
+%
+% o wand: the magick wand.
+%
+% o alpha_color: return the alpha color.
+%
+*/
+WandExport MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand,
+ PixelWand *alpha_color)
+{
+ assert(wand != (MagickWand *)NULL);
+ assert(wand->signature == MagickWandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ if (wand->images == (Image *)NULL)
+ ThrowWandException(WandError, "ContainsNoImages", wand->name);
+ PixelSetPixelColor(alpha_color,&wand->images->matte_color);
+ return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% M a g i c k S e t I m a g e A l p h a C o l o r %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MagickSetImageAlphaColor() sets the image alpha color.
+%
+% The format of the MagickSetImageAlphaColor method is:
+%
+% MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
+% const PixelWand *matte)
+%
+% A description of each parameter follows:
+%
+% o wand: the magick wand.
+%
+% o matte: the alpha pixel wand.
+%
+*/
+WandExport MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
+ const PixelWand *alpha)
+{
+ assert(wand != (MagickWand *)NULL);
+ assert(wand->signature == MagickWandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ if (wand->images == (Image *)NULL)
+ ThrowWandException(WandError,"ContainsNoImages",wand->name);
+ PixelGetQuantumPacket(alpha,&wand->images->matte_color);
+ return(MagickTrue);
+}
#endif
extern "C" {
#endif
+#include "MagickWand/pixel-wand.h"
+
#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
+extern WandExport MagickBooleanType
+ MagickGetImageAlphaColor(MagickWand *,PixelWand *),
+ MagickSetImageAlphaColor(MagickWand *,const PixelWand *);
+
#endif
#if defined(__cplusplus) || defined(c_plusplus)
(void) printf(
"resources as command line options: -background, -bordercolor,\n");
(void) printf(
- " -alpha-color, -borderwidth, -font, -foreground, -iconGeometry,\n");
+ " -mattecolor, -borderwidth, -font, -foreground, -iconGeometry,\n");
(void) printf("-iconic, -name, -shared-memory, -usePixmap, or -title.\n");
(void) printf(
"\nBy default, the image format of 'file' is determined by its magic\n");
}
if (LocaleCompare("matte",option+1) == 0)
break;
- if (LocaleCompare("alpha-color",option+1) == 0)
+ if (LocaleCompare("mattecolor",option+1) == 0)
{
if (*option == '+')
break;
i++;
if (i == (ssize_t) argc)
ThrowDisplayException(OptionError,"MissingArgument",option);
- resource_info.alpha_color=argv[i];
+ resource_info.matte_color=argv[i];
break;
}
if (LocaleCompare("monitor",option+1) == 0)
% The format of the MagickFrameImage method is:
%
% MagickBooleanType MagickFrameImage(MagickWand *wand,
-% const PixelWand *alpha_color,const size_t width,
+% const PixelWand *matte_color,const size_t width,
% const size_t height,const ssize_t inner_bevel,
% const ssize_t outer_bevel,const CompositeOperator compose)
%
%
% o wand: the magick wand.
%
-% o alpha_color: the frame color pixel wand.
+% o matte_color: the frame color pixel wand.
%
% o width: the border width.
%
%
*/
WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
- const PixelWand *alpha_color,const size_t width,const size_t height,
+ const PixelWand *matte_color,const size_t width,const size_t height,
const ssize_t inner_bevel,const ssize_t outer_bevel,
const CompositeOperator compose)
{
frame_info.y=(ssize_t) height;
frame_info.inner_bevel=inner_bevel;
frame_info.outer_bevel=outer_bevel;
- PixelGetQuantumPacket(alpha_color,&wand->images->alpha_color);
+ PixelGetQuantumPacket(matte_color,&wand->images->matte_color);
frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception);
if (frame_image == (Image *) NULL)
return(MagickFalse);
ThrowWandException(WandError,"ContainsNoImages",wand->name);
return(GetImageAlphaChannel(wand->images));
}
-
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-% M a g i c k G e t I m a g e A l p h a C o l o r %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% MagickGetImageAlhpaColor() returns the image alpha color.
-%
-% The format of the MagickGetImageAlhpaColor method is:
-%
-% MagickBooleanType MagickGetImageAlhpaColor(MagickWand *wand,
-% PixelWand *alpha_color)
-%
-% A description of each parameter follows:
-%
-% o wand: the magick wand.
-%
-% o alpha_color: return the alpha color.
-%
-*/
-WandExport MagickBooleanType MagickGetImageAlhpaColor(MagickWand *wand,
- PixelWand *alpha_color)
-{
- assert(wand != (MagickWand *)NULL);
- assert(wand->signature == MagickWandSignature);
- if (wand->debug != MagickFalse)
- (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name);
- if (wand->images == (Image *)NULL)
- ThrowWandException(WandError, "ContainsNoImages", wand->name);
- PixelSetPixelColor(alpha_color, &wand->images->alpha_color);
- return(MagickTrue);
-}
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
+% M a g i c k G e t I m a g e M a t t e C o l o r %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MagickGetImageMatteColor() returns the image matte color.
+%
+% The format of the MagickGetImageMatteColor method is:
+%
+% MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
+% PixelWand *matte_color)
+%
+% A description of each parameter follows:
+%
+% o wand: the magick wand.
+%
+% o matte_color: return the alpha color.
+%
+*/
+WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand,
+ PixelWand *matte_color)
+{
+ assert(wand != (MagickWand *)NULL);
+ assert(wand->signature == MagickWandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ if (wand->images == (Image *)NULL)
+ ThrowWandException(WandError, "ContainsNoImages", wand->name);
+ PixelSetPixelColor(matte_color,&wand->images->matte_color);
+ return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% M a g i c k G e t I m a g e O r i e n t a t i o n %
% %
% %
% %
% %
% %
-% M a g i c k S e t I m a g e A l p h a C o l o r %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% MagickSetImageAlphaColor() sets the image alpha color.
-%
-% The format of the MagickSetImageAlphaColor method is:
-%
-% MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
-% const PixelWand *matte)
-%
-% A description of each parameter follows:
-%
-% o wand: the magick wand.
-%
-% o matte: the alpha pixel wand.
-%
-*/
-WandExport MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
- const PixelWand *alpha)
-{
- assert(wand != (MagickWand *)NULL);
- assert(wand->signature == MagickWandSignature);
- if (wand->debug != MagickFalse)
- (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name);
- if (wand->images == (Image *)NULL)
- ThrowWandException(WandError, "ContainsNoImages", wand->name);
- PixelGetQuantumPacket(alpha, &wand->images->alpha_color);
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% M a g i c k S e t I m a g e B a c k g r o u n d C o l o r %
% %
% %
% %
% %
% %
+% M a g i c k S e t I m a g e M a t t e C o l o r %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MagickSetImageMatteColor() sets the image alpha color.
+%
+% The format of the MagickSetImageMatteColor method is:
+%
+% MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
+% const PixelWand *matte)
+%
+% A description of each parameter follows:
+%
+% o wand: the magick wand.
+%
+% o matte: the alpha pixel wand.
+%
+*/
+WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand,
+ const PixelWand *alpha)
+{
+ assert(wand != (MagickWand *)NULL);
+ assert(wand->signature == MagickWandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name);
+ if (wand->images == (Image *)NULL)
+ ThrowWandException(WandError, "ContainsNoImages", wand->name);
+ PixelGetQuantumPacket(alpha,&wand->images->matte_color);
+ return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% M a g i c k S e t I m a g e O p a c i t y %
% %
% %
MagickCommentImage(MagickWand *,const char *),
MagickCompositeImage(MagickWand *,const MagickWand *,const CompositeOperator,
const MagickBooleanType,const ssize_t,const ssize_t),
- MagickCompositeImageGravity(MagickWand *,const MagickWand *,const CompositeOperator,
- const GravityType),
+ MagickCompositeImageGravity(MagickWand *,const MagickWand *,
+ const CompositeOperator,const GravityType),
MagickCompositeLayers(MagickWand *,const MagickWand *,const CompositeOperator,
const ssize_t,const ssize_t),
MagickConstituteImage(MagickWand *,const size_t,const size_t,const char *,
MagickGammaImage(MagickWand *,const double),
MagickGaussianBlurImage(MagickWand *,const double,const double),
MagickGetImageAlphaChannel(MagickWand *),
- MagickGetImageAlphaColor(MagickWand *,PixelWand *),
MagickGetImageBackgroundColor(MagickWand *,PixelWand *),
MagickGetImageBluePrimary(MagickWand *,double *,double *,double *),
MagickGetImageBorderColor(MagickWand *,PixelWand *),
double *),
MagickGetImageGreenPrimary(MagickWand *,double *,double *,double *),
MagickGetImageLength(MagickWand *,MagickSizeType *),
+ MagickGetImageMatteColor(MagickWand *,PixelWand *),
MagickGetImagePage(MagickWand *,size_t *,size_t *,ssize_t *,
ssize_t *),
MagickGetImagePixelColor(MagickWand *,const ssize_t,const ssize_t,
MagickSetImage(MagickWand *,const MagickWand *),
MagickSetImageAlpha(MagickWand *,const double),
MagickSetImageAlphaChannel(MagickWand *,const AlphaChannelOption),
- MagickSetImageAlphaColor(MagickWand *,const PixelWand *),
MagickSetImageBackgroundColor(MagickWand *,const PixelWand *),
MagickSetImageBluePrimary(MagickWand *,const double,const double,
const double),
MagickSetImageInterpolateMethod(MagickWand *,const PixelInterpolateMethod),
MagickSetImageIterations(MagickWand *,const size_t),
MagickSetImageMatte(MagickWand *,const MagickBooleanType),
+ MagickSetImageMatteColor(MagickWand *,const PixelWand *),
MagickSetImageOrientation(MagickWand *,const OrientationType),
MagickSetImagePage(MagickWand *,const size_t,const size_t,const ssize_t,
const ssize_t),
"-adjoin join images into a single multi-image file",
"-affine matrix affine transform matrix",
"-alpha option activate, deactivate, reset, or set the alpha channel",
- "-alpha-color color frame color",
"-antialias remove pixel-aliasing",
"-authenticate password",
" decipher image with this password",
"-limit type value pixel cache resource limit",
"-loop iterations add Netscape loop extension to your GIF animation",
"-matte store matte channel if the image has one",
+ "-mattecolor color frame color",
"-monitor monitor progress",
"-orient type image orientation",
"-page geometry size and location of an image canvas (setting)",
"UnrecognizedAlphaChannelOption",argv[i]);
break;
}
- if (LocaleCompare("alpha-color",option+1) == 0)
- {
- if (*option == '+')
- break;
- i++;
- if (i == (ssize_t) argc)
- ThrowMogrifyException(OptionError,"MissingArgument",option);
- break;
- }
if (LocaleCompare("annotate",option+1) == 0)
{
if (*option == '+')
}
if (LocaleCompare("matte",option+1) == 0)
break;
+ if (LocaleCompare("mattecolor",option+1) == 0)
+ {
+ if (*option == '+')
+ break;
+ i++;
+ if (i == (ssize_t) argc)
+ ThrowMogrifyException(OptionError,"MissingArgument",option);
+ break;
+ }
if (LocaleCompare("maximum",option+1) == 0)
break;
if (LocaleCompare("mean-shift",option+1) == 0)
image_info->adjoin=(*option == '-') ? MagickTrue : MagickFalse;
break;
}
- if (LocaleCompare("alpha-color",option+1) == 0)
- {
- if (*option == '+')
- {
- (void) SetImageOption(image_info,option+1,argv[i+1]);
- (void) QueryColorCompliance(MogrifyAlphaColor,AllCompliance,
- &image_info->alpha_color,exception);
- break;
- }
- (void) SetImageOption(image_info,option+1,argv[i+1]);
- (void) QueryColorCompliance(argv[i+1],AllCompliance,
- &image_info->alpha_color,exception);
- break;
- }
if (LocaleCompare("antialias",option+1) == 0)
{
image_info->antialias=(*option == '-') ? MagickTrue : MagickFalse;
(void) SetImageOption(image_info,option+1,"true");
break;
}
+ if (LocaleCompare("mattecolor",option+1) == 0)
+ {
+ if (*option == '+')
+ {
+ (void) SetImageOption(image_info,option+1,argv[i+1]);
+ (void) QueryColorCompliance(MogrifyAlphaColor,AllCompliance,
+ &image_info->matte_color,exception);
+ break;
+ }
+ (void) SetImageOption(image_info,option+1,argv[i+1]);
+ (void) QueryColorCompliance(argv[i+1],AllCompliance,
+ &image_info->matte_color,exception);
+ break;
+ }
if (LocaleCompare("metric",option+1) == 0)
{
if (*option == '+')
"-affine matrix affine transform matrix",
"-alpha option on, activate, off, deactivate, set, opaque, copy",
" transparent, extract, background, or shape",
- "-alpha-color color frame color",
"-authenticate password",
" decipher image with this password",
"-blue-primary point chromaticity blue primary point",
"-label string assign a label to an image",
"-limit type value pixel cache resource limit",
"-matte store matte channel if the image has one",
+ "-mattecolor color frame color",
"-mode type framing style",
"-monitor monitor progress",
"-page geometry size and location of an image canvas (setting)",
(void) printf(
"resources as command line options: -background, -bordercolor,\n");
(void) printf(
- "-alpha-color, -borderwidth, -font, or -title\n");
+ "-mattecolor, -borderwidth, -font, or -title\n");
(void) printf(
"\nBy default, the image format of 'file' is determined by its magic\n");
(void) printf(
i++;
if (i == (ssize_t) argc)
ThrowMontageException(OptionError,"MissingArgument",option);
- type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
+ type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
+ argv[i]);
if (type < 0)
- ThrowMontageException(OptionError,"UnrecognizedAlphaChannelOption",
- argv[i]);
- break;
- }
- if (LocaleCompare("alpha-color",option+1) == 0)
- {
- if (*option == '+')
- break;
- i++;
- if (i == (ssize_t) argc)
- ThrowMontageException(OptionError,"MissingArgument",option);
- (void) QueryColorCompliance(argv[i],AllCompliance,
- &montage_info->alpha_color,exception);
+ ThrowMontageException(OptionError,
+ "UnrecognizedAlphaChannelOption",argv[i]);
break;
}
if (LocaleCompare("annotate",option+1) == 0)
{
if (LocaleCompare("matte",option+1) == 0)
break;
+ if (LocaleCompare("mattecolor",option+1) == 0)
+ {
+ if (*option == '+')
+ break;
+ i++;
+ if (i == (ssize_t) argc)
+ ThrowMontageException(OptionError,"MissingArgument",option);
+ (void) QueryColorCompliance(argv[i],AllCompliance,
+ &montage_info->matte_color,exception);
+ break;
+ }
if (LocaleCompare("mode",option+1) == 0)
{
MontageMode
GetAffineMatrix(&_draw_info->affine);
break;
}
- if (LocaleCompare("alpha-color",option+1) == 0)
- {
- /* SyncImageSettings() used to set per-image attribute. */
- (void) SetImageOption(_image_info,option+1,ArgOption(NULL));
- (void) QueryColorCompliance(ArgOption(MogrifyAlphaColor),AllCompliance,
- &_image_info->alpha_color,_exception);
- break;
- }
if (LocaleCompare("antialias",option+1) == 0)
{
_image_info->antialias =
}
case 'm':
{
+ if (LocaleCompare("mattecolor",option+1) == 0)
+ {
+ /* SyncImageSettings() used to set per-image attribute. */
+ (void) SetImageOption(_image_info,option+1,ArgOption(NULL));
+ (void) QueryColorCompliance(ArgOption(MogrifyAlphaColor),
+ AllCompliance,&_image_info->matte_color,_exception);
+ break;
+ }
if (LocaleCompare("metric",option+1) == 0)
{
/* FUTURE: this is only used by CompareImages() which is used
" \"x\": %.20g,\n \"y\": %.20g\n },\n",
(double) image->extract_info.width,(double) image->extract_info.height,
(double) image->extract_info.x,(double) image->extract_info.y);
- GetColorTuple(&image->alpha_color,MagickTrue,color);
- (void) FormatLocaleFile(file," \"alphaColor\": \"%s\",\n",color);
+ GetColorTuple(&image->matte_color,MagickTrue,color);
+ (void) FormatLocaleFile(file," \"matteColor\": \"%s\",\n",color);
GetColorTuple(&image->background_color,MagickTrue,color);
(void) FormatLocaleFile(file," \"backgroundColor\": \"%s\",\n",color);
GetColorTuple(&image->border_color,MagickTrue,color);
case 'a':
case 'A':
{
- if (LocaleCompare(keyword,"alpha-color") == 0)
- {
- (void) QueryColorCompliance(options,AllCompliance,
- &image->alpha_color,exception);
- break;
- }
if (LocaleCompare(keyword,"alpha-trait") == 0)
{
ssize_t
BlendPixelTrait;
break;
}
+ if (LocaleCompare(keyword,"mattecolor") == 0)
+ {
+ (void) QueryColorCompliance(options,AllCompliance,
+ &image->matte_color,exception);
+ break;
+ }
if (LocaleCompare(keyword,"montage") == 0)
{
(void) CloneString(&image->montage,options);
case 'a':
case 'A':
{
- if (LocaleCompare(keyword,"alpha-color") == 0)
- {
- (void) QueryColorCompliance(options,AllCompliance,
- &image->alpha_color,exception);
- break;
- }
if (LocaleCompare(keyword,"alpha-trait") == 0)
{
ssize_t
signature=(unsigned int) StringToUnsignedLong(options);
break;
}
+ if (LocaleCompare(keyword,"mattecolor") == 0)
+ {
+ (void) QueryColorCompliance(options,AllCompliance,
+ &image->matte_color,exception);
+ break;
+ }
if (LocaleCompare(keyword,"maximum-error") == 0)
{
image->error.normalized_maximum_error=StringToDouble(
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->alpha_color,exception);
+ &msl_info->image[n]->matte_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
exception);
break;
}
- if (LocaleCompare(keyword,"alpha-color") == 0)
- {
- (void) QueryColorCompliance(value,AllCompliance,
- &image_info->alpha_color,exception);
- break;
- }
if (LocaleCompare(keyword,"antialias") == 0)
{
ssize_t
(void) CopyMagickString(image_info->magick,value,MagickPathExtent);
break;
}
+ if (LocaleCompare(keyword,"mattecolor") == 0)
+ {
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->matte_color,exception);
+ break;
+ }
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
break;
}