#include <X11/Xutil.h>
#include "MagickCore/exception.h"
#include "MagickCore/geometry.h"
+#include "MagickCore/pixel-accessor.h"
#include "MagickCore/quantize.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern MagickExport XrmDatabase
XGetResourceDatabase(Display *,const char *);
-static inline MagickRealType XPixelIntensity(const XColor *pixel)
+static inline double XPixelIntensity(const XColor *pixel)
{
- MagickRealType
- intensity;
-
- intensity=0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue;
- return(intensity);
+ double
+ blue,
+ green,
+ red;
+
+ red=DecodesRGBGamma((double) pixel->red);
+ green=DecodesRGBGamma((double) pixel->green);
+ blue=DecodesRGBGamma((double) pixel->blue);
+ return(0.298839*red+0.586811*green+0.114350*blue);
}
#endif