/*
- Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
extern "C" {
#endif
+#include <MagickCore/image.h>
#include <MagickCore/image-private.h>
#include <MagickCore/pixel.h>
-static inline MagickBooleanType IsGrayColorspace(
- const ColorspaceType colorspace)
-{
- if ((colorspace == GRAYColorspace) || (colorspace == Rec601LumaColorspace) ||
- (colorspace == Rec709LumaColorspace))
- return(MagickTrue);
- return(MagickFalse);
-}
-
static inline void ConvertRGBToCMYK(PixelInfo *pixel)
{
MagickRealType
magenta,
yellow;
- if ((pixel->red == 0) && (pixel->green == 0) && (pixel->blue == 0))
+ if ((fabs(pixel->red) < MagickEpsilon) &&
+ (fabs(pixel->green) < MagickEpsilon) &&
+ (fabs(pixel->blue) < MagickEpsilon))
{
pixel->black=(MagickRealType) QuantumRange;
return;
pixel->black=QuantumRange*black;
}
+static inline MagickBooleanType IsCMYKColorspace(
+ const ColorspaceType colorspace)
+{
+ if (colorspace == CMYKColorspace)
+ return(MagickTrue);
+ return(MagickFalse);
+}
+
+static inline MagickBooleanType IsGrayColorspace(
+ const ColorspaceType colorspace)
+{
+ if ((colorspace == GRAYColorspace) || (colorspace == Rec601LumaColorspace) ||
+ (colorspace == Rec709LumaColorspace))
+ return(MagickTrue);
+ return(MagickFalse);
+}
+
+static inline MagickBooleanType IsRGBColorspace(const ColorspaceType colorspace)
+{
+ if (colorspace == RGBColorspace)
+ return(MagickTrue);
+ return(MagickFalse);
+}
+
+static inline MagickBooleanType IssRGBColorspace(
+ const ColorspaceType colorspace)
+{
+ if ((colorspace == sRGBColorspace) || (colorspace == TransparentColorspace))
+ return(MagickTrue);
+ return(MagickFalse);
+}
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif