MagickBooleanType
status;
- PixelInfo
- background;
-
PixelInfo
pixel;
return(MagickFalse);
if (image->background_color.alpha != OpaqueAlpha)
image->matte=MagickTrue;
- background=image->background_color;
- SetPixelInfo(image,&background,&pixel);
/*
Set image background color.
*/
status=MagickTrue;
+ pixel=image->background_color;
pixel.black=0;
image_view=AcquireCacheView(image);
for (y=0; y < (ssize_t) image->rows; y++)
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- SetPixelInfoPixel(image,&background,q);
+ SetPixelInfoPixel(image,&pixel,q);
q+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
image->channel_map[IndexPixelChannel].traits=traits;
}
-static inline void SetPixelInfo(const Image *restrict image,
- const PixelInfo *restrict p,PixelInfo *restrict q)
-{
- q->red=p->red;
- q->green=p->green;
- q->blue=p->blue;
- q->black=0;
- if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
- q->black=p->black;
- q->alpha=OpaqueAlpha;
- if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
- q->alpha=p->alpha;
- q->index=0;
- if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
- q->index=p->index;
-}
-
static inline void SetPixelInfoPixel(const Image *restrict image,
const PixelInfo *restrict pixel_info,Quantum *restrict pixel)
{
MagickBooleanType
status;
- PixelInfo
- color;
-
PixelInfo
pixel;
image->rows=1;
(void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
status=QueryColorCompliance((char *) image_info->filename,AllCompliance,
- &color,exception);
+ &pixel,exception);
if (status == MagickFalse)
{
image=DestroyImage(image);
return((Image *) NULL);
}
- image->colorspace=color.colorspace;
- image->matte=color.matte;
- GetPixelInfo(image,&pixel);
- SetPixelInfo(image,&color,&pixel);
+ image->colorspace=pixel.colorspace;
+ image->matte=pixel.matte;
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
for (x=0; x < (ssize_t) image->columns; x++)
{
SetPixelInfoPixel(image,&pixel,q);
- if (image->colorspace == CMYKColorspace)
- SetPixelBlack(image,pixel.black,q);
q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)