}
for (x=0; x < (ssize_t) image->columns; x++)
{
- luma=0.21267f*GetPixelRed(image,q)+0.71526*GetPixelGreen(image,q)+0.07217f*
- GetPixelBlue(image,q);
+ luma=0.21267f*GetPixelRed(image,q)+0.71526*GetPixelGreen(image,q)+
+ 0.07217f*GetPixelBlue(image,q);
SetPixelRed(image,ClampToQuantum(luma+color_correction.saturation*
(cdl_map[ScaleQuantumToMap(GetPixelRed(image,q))].red-luma)),q);
SetPixelGreen(image,ClampToQuantum(luma+color_correction.saturation*
CacheView
*image_view;
+ ColorspaceType
+ colorspace;
+
MagickBooleanType
status;
/*
Form histogram.
*/
+ colorspace=image->colorspace;
+ if (colorspace == sRGBColorspace)
+ (void) SetImageColorspace(image,RGBColorspace,exception);
status=MagickTrue;
(void) ResetMagickMemory(histogram,0,(MaxMap+1)*GetPixelChannels(image)*
sizeof(*histogram));
stretch_map[GetPixelChannels(image)*j+i]=0.0;
else
if (j > (ssize_t) white[i])
- stretch_map[GetPixelChannels(image)*j+i]=(double)
- QuantumRange;
+ stretch_map[GetPixelChannels(image)*j+i]=(double) QuantumRange;
else
if (black[i] != white[i])
- stretch_map[GetPixelChannels(image)*j+i]=(double)
- ScaleMapToQuantum((double) (MaxMap*(j-black[i])/
- (white[i]-black[i])));
+ stretch_map[GetPixelChannels(image)*j+i]=(double) ScaleMapToQuantum(
+ (double) (MaxMap*(j-black[i])/(white[i]-black[i])));
}
}
if (image->storage_class == PseudoClass)
status=MagickFalse;
}
}
+ if (colorspace == sRGBColorspace)
+ (void) SetImageColorspace(image,sRGBColorspace,exception);
image_view=DestroyCacheView(image_view);
stretch_map=(double *) RelinquishMagickMemory(stretch_map);
white=(double *) RelinquishMagickMemory(white);
SetPixelChannel(colorize_image,channel,p[i],q);
continue;
}
- SetPixelChannel(colorize_image,channel,
- ClampToQuantum(Colorize(p[i],GetPixelInfoChannel(&blend_percentage,
- channel),GetPixelInfoChannel(colorize,channel))),q);
+ SetPixelChannel(colorize_image,channel,ClampToQuantum(Colorize(p[i],
+ GetPixelInfoChannel(&blend_percentage,channel),GetPixelInfoChannel(
+ colorize,channel))),q);
}
p+=GetPixelChannels(image);
q+=GetPixelChannels(colorize_image);