static inline MagickRealType GetPixelInfoIntensity(
const PixelInfo *restrict pixel_info)
+{
+ if (pixel_info->colorspace == GRAYColorspace)
+ return(pixel_info->red);
+ return(0.212656*pixel_info->red+0.715158*pixel_info->green+0.072186*pixel_info->blue);
+}
+
+static inline MagickRealType GetPixelInfoLuma(const PixelInfo *restrict pixel)
{
MagickRealType
blue,
green,
red;
- if (pixel_info->colorspace == GRAYColorspace)
- return(pixel_info->red);
- if (pixel_info->colorspace != sRGBColorspace)
- return(0.298839*pixel_info->red+0.586811*pixel_info->green+
- 0.114350*pixel_info->blue);
- red=DecodePixelGamma(pixel_info->red);
- green=DecodePixelGamma(pixel_info->green);
- blue=DecodePixelGamma(pixel_info->blue);
- return(0.298839*red+0.586811*green+0.114350*blue);
+ if (pixel->colorspace == GRAYColorspace)
+ return(pixel->red);
+ if (pixel->colorspace == sRGBColorspace)
+ return(0.212656*pixel->red+0.715158*pixel->green+0.072186*pixel->blue);
+ red=EncodePixelGamma(pixel->red);
+ green=EncodePixelGamma(pixel->green);
+ blue=EncodePixelGamma(pixel->blue);
+ return(0.212656*red+0.715158*green+0.072186*blue);
}
static inline MagickRealType GetPixelInfoLuminance(
- const PixelInfo *restrict pixel_info)
+ const PixelInfo *restrict pixel)
{
MagickRealType
blue,
green,
red;
- if (pixel_info->colorspace == GRAYColorspace)
- return(pixel_info->red);
- if (pixel_info->colorspace != sRGBColorspace)
- return(0.21267f*pixel_info->red+0.71516f*pixel_info->green+
- 0.07217f*pixel_info->blue);
- red=DecodePixelGamma(pixel_info->red);
- green=DecodePixelGamma(pixel_info->green);
- blue=DecodePixelGamma(pixel_info->blue);
- return(0.21267f*red+0.71516f*green+0.07217f*blue);
+ if (pixel->colorspace == GRAYColorspace)
+ return(pixel->red);
+ if (pixel->colorspace != sRGBColorspace)
+ return(0.212656*pixel->red+0.715158*pixel->green+0.072186*pixel->blue);
+ red=DecodePixelGamma(pixel->red);
+ green=DecodePixelGamma(pixel->green);
+ blue=DecodePixelGamma(pixel->blue);
+ return(0.212656*red+0.715158*green+0.072186*blue);
}
static inline Quantum GetPixelL(const Image *restrict image,
{
if (image->colorspace == GRAYColorspace)
return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
- return(0.21267f*pixel[image->channel_map[RedPixelChannel].offset]+
- 0.71516f*pixel[image->channel_map[GreenPixelChannel].offset]+
- 0.07217f*pixel[image->channel_map[BluePixelChannel].offset]); /* Rec709 */
+ return(0.212656f*pixel[image->channel_map[RedPixelChannel].offset]+
+ 0.715158f*pixel[image->channel_map[GreenPixelChannel].offset]+
+ 0.072186f*pixel[image->channel_map[BluePixelChannel].offset]); /* Rec709 */
}
static inline MagickRealType GetPixelLuminance(const Image *restrict image,
if (image->colorspace == GRAYColorspace)
return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
if (image->colorspace != sRGBColorspace)
- return(0.21267f*pixel[image->channel_map[RedPixelChannel].offset]+
- 0.71516f*pixel[image->channel_map[GreenPixelChannel].offset]+
- 0.07217f*pixel[image->channel_map[BluePixelChannel].offset]);
+ return(0.212656*pixel[image->channel_map[RedPixelChannel].offset]+
+ 0.715158*pixel[image->channel_map[GreenPixelChannel].offset]+
+ 0.072186*pixel[image->channel_map[BluePixelChannel].offset]);
red=DecodePixelGamma((MagickRealType)
pixel[image->channel_map[RedPixelChannel].offset]);
green=DecodePixelGamma((MagickRealType)
pixel[image->channel_map[GreenPixelChannel].offset]);
blue=DecodePixelGamma((MagickRealType)
pixel[image->channel_map[BluePixelChannel].offset]);
- return(0.21267f*red+0.71516f*green+0.07217f*blue); /* Rec709 */
+ return(0.212656*red+0.715158*green+0.072186*blue); /* Rec709 */
}
static inline Quantum GetPixelMagenta(const Image *restrict image,