]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/colorspace-private.h
(no commit message)
[imagemagick] / MagickCore / colorspace-private.h
index 479d7eeb324b0557560ce77354326cca3a084287..7be53c2316f0bf452efde51c23d5d5ce8dd8d19e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  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.
@@ -34,7 +34,9 @@ static inline void ConvertRGBToCMYK(PixelInfo *pixel)
     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;
@@ -57,6 +59,14 @@ static inline void ConvertRGBToCMYK(PixelInfo *pixel)
   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)
 {
@@ -68,9 +78,15 @@ static inline MagickBooleanType IsGrayColorspace(
 
 static inline MagickBooleanType IsRGBColorspace(const ColorspaceType colorspace)
 {
-  if ((IsGrayColorspace(colorspace) != MagickFalse) ||
-      (colorspace == RGBColorspace) || (colorspace == sRGBColorspace) ||
-      (colorspace == TransparentColorspace))
+  if (colorspace == RGBColorspace)
+    return(MagickTrue);
+  return(MagickFalse);
+}
+
+static inline MagickBooleanType IssRGBColorspace(
+  const ColorspaceType colorspace)
+{
+  if ((colorspace == sRGBColorspace) || (colorspace == TransparentColorspace))
     return(MagickTrue);
   return(MagickFalse);
 }