static inline void GetPixelInfoPixel(const Image *magick_restrict image,
const Quantum *magick_restrict pixel,PixelInfo *magick_restrict pixel_info)
{
- pixel_info->storage_class=image->storage_class;
- pixel_info->colorspace=image->colorspace;
- pixel_info->fuzz=image->fuzz;
- pixel_info->depth=image->depth;
- pixel_info->red=(MagickRealType)
- pixel[image->channel_map[RedPixelChannel].offset];
- pixel_info->green=(MagickRealType)
- pixel[image->channel_map[GreenPixelChannel].offset];
- pixel_info->blue=(MagickRealType)
- pixel[image->channel_map[BluePixelChannel].offset];
+ pixel_info->storage_class=DirectClass;
+ pixel_info->colorspace=sRGBColorspace;
+ pixel_info->fuzz=0.0f;
+ pixel_info->depth=MAGICKCORE_QUANTUM_DEPTH;
+ pixel_info->red=0.0f;
+ pixel_info->green=0.0f;
+ pixel_info->blue=0.0f;
pixel_info->black=0.0f;
- if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
- pixel_info->black=(MagickRealType)
- pixel[image->channel_map[BlackPixelChannel].offset];
- pixel_info->alpha=(MagickRealType) OpaqueAlpha;
+ pixel_info->index=0.0f;
pixel_info->alpha_trait=UndefinedPixelTrait;
- if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+ pixel_info->alpha=(MagickRealType) OpaqueAlpha;
+ pixel_info->count=0;
+ if (image != (Image *) NULL)
{
- pixel_info->alpha=(MagickRealType)
- pixel[image->channel_map[AlphaPixelChannel].offset];
- pixel_info->alpha_trait=BlendPixelTrait;
+ pixel_info->storage_class=image->storage_class;
+ pixel_info->colorspace=image->colorspace;
+ pixel_info->fuzz=image->fuzz;
+ pixel_info->depth=image->depth;
+ pixel_info->alpha_trait=image->alpha_trait;
}
- pixel_info->index=0.0f;
- if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
- pixel_info->index=(MagickRealType)
+ if (pixel != (Quantum *) NULL)
+ {
+ pixel_info->red=(MagickRealType)
+ pixel[image->channel_map[RedPixelChannel].offset];
+ pixel_info->green=(MagickRealType)
+ pixel[image->channel_map[GreenPixelChannel].offset];
+ pixel_info->blue=(MagickRealType)
+ pixel[image->channel_map[BluePixelChannel].offset];
+ if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
+ pixel_info->black=(MagickRealType)
+ pixel[image->channel_map[BlackPixelChannel].offset];
+ if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+ {
+ pixel_info->alpha=(MagickRealType)
+ pixel[image->channel_map[AlphaPixelChannel].offset];
+ pixel_info->alpha_trait=BlendPixelTrait;
+ }
+ if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
+ pixel_info->index=(MagickRealType)
pixel[image->channel_map[IndexPixelChannel].offset];
- pixel_info->count=0;
+ }
}
static inline PixelTrait GetPixelTraits(const Image *magick_restrict image,