MagickCore  7.0.2
colorspace.c File Reference
Include dependency graph for colorspace.c:

Go to the source code of this file.

Data Structures

struct  _TransformPacket
 

Macros

#define sRGBTransformImageTag   "RGBTransform/Image"
 
#define DisplayGamma   (1.0/1.7)
 
#define FilmGamma   0.6
 
#define ReferenceBlack   95.0
 
#define ReferenceWhite   685.0
 
#define TransformsRGBImageTag   "Transform/Image"
 

Typedefs

typedef struct _TransformPacket TransformPacket
 

Functions

static MagickBooleanType TransformsRGBImage (Image *, ExceptionInfo *)
 
static void ConvertRGBToCMY (const double red, const double green, const double blue, double *cyan, double *magenta, double *yellow)
 
static void ConvertXYZToLMS (const double x, const double y, const double z, double *L, double *M, double *S)
 
static void ConvertRGBToLMS (const double red, const double green, const double blue, double *L, double *M, double *S)
 
static void ConvertRGBToLab (const double red, const double green, const double blue, double *L, double *a, double *b)
 
static void ConvertRGBToLuv (const double red, const double green, const double blue, double *L, double *u, double *v)
 
static void ConvertRGBToxyY (const double red, const double green, const double blue, double *low_x, double *low_y, double *cap_Y)
 
static void ConvertRGBToYDbDr (const double red, const double green, const double blue, double *Y, double *Db, double *Dr)
 
static void ConvertRGBToYIQ (const double red, const double green, const double blue, double *Y, double *I, double *Q)
 
static void ConvertRGBToYPbPr (const double red, const double green, const double blue, double *Y, double *Pb, double *Pr)
 
static void ConvertRGBToYCbCr (const double red, const double green, const double blue, double *Y, double *Cb, double *Cr)
 
static void ConvertRGBToYUV (const double red, const double green, const double blue, double *Y, double *U, double *V)
 
static MagickBooleanType sRGBTransformImage (Image *image, const ColorspaceType colorspace, ExceptionInfo *exception)
 
MagickExport MagickBooleanType SetImageColorspace (Image *image, const ColorspaceType colorspace, ExceptionInfo *exception)
 
MagickExport MagickBooleanType SetImageGray (Image *image, ExceptionInfo *exception)
 
MagickExport MagickBooleanType SetImageMonochrome (Image *image, ExceptionInfo *exception)
 
MagickExport MagickBooleanType TransformImageColorspace (Image *image, const ColorspaceType colorspace, ExceptionInfo *exception)
 
static void ConvertCMYToRGB (const double cyan, const double magenta, const double yellow, double *red, double *green, double *blue)
 
static void ConvertLMSToXYZ (const double L, const double M, const double S, double *X, double *Y, double *Z)
 
static void ConvertLMSToRGB (const double L, const double M, const double S, double *red, double *green, double *blue)
 
static void ConvertLuvToRGB (const double L, const double u, const double v, double *red, double *green, double *blue)
 
static ssize_t RoundToYCC (const double value)
 
static void ConvertLabToRGB (const double L, const double a, const double b, double *red, double *green, double *blue)
 
static void ConvertxyYToRGB (const double low_x, const double low_y, const double cap_Y, double *red, double *green, double *blue)
 
static void ConvertYPbPrToRGB (const double Y, const double Pb, const double Pr, double *red, double *green, double *blue)
 
static void ConvertYCbCrToRGB (const double Y, const double Cb, const double Cr, double *red, double *green, double *blue)
 
static void ConvertYIQToRGB (const double Y, const double I, const double Q, double *red, double *green, double *blue)
 
static void ConvertYDbDrToRGB (const double Y, const double Db, const double Dr, double *red, double *green, double *blue)
 
static void ConvertYUVToRGB (const double Y, const double U, const double V, double *red, double *green, double *blue)
 

Macro Definition Documentation

#define DisplayGamma   (1.0/1.7)
#define FilmGamma   0.6
#define ReferenceBlack   95.0
#define ReferenceWhite   685.0
#define sRGBTransformImageTag   "RGBTransform/Image"

Referenced by sRGBTransformImage().

#define TransformsRGBImageTag   "Transform/Image"

Referenced by TransformsRGBImage().

Typedef Documentation

Function Documentation

static void ConvertCMYToRGB ( const double  cyan,
const double  magenta,
const double  yellow,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 1327 of file colorspace.c.

References QuantumRange.

Referenced by TransformsRGBImage().

static void ConvertLabToRGB ( const double  L,
const double  a,
const double  b,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 1376 of file colorspace.c.

References ConvertLabToXYZ(), and ConvertXYZToRGB().

Referenced by TransformsRGBImage().

static void ConvertLMSToRGB ( const double  L,
const double  M,
const double  S,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 1343 of file colorspace.c.

References ConvertLMSToXYZ(), and ConvertXYZToRGB().

Referenced by TransformsRGBImage().

static void ConvertLMSToXYZ ( const double  L,
const double  M,
const double  S,
double *  X,
double *  Y,
double *  Z 
)
inlinestatic

Definition at line 1335 of file colorspace.c.

Referenced by ConvertLMSToRGB().

static void ConvertLuvToRGB ( const double  L,
const double  u,
const double  v,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 1355 of file colorspace.c.

References ConvertLuvToXYZ(), and ConvertXYZToRGB().

Referenced by TransformsRGBImage().

static void ConvertRGBToCMY ( const double  red,
const double  green,
const double  blue,
double *  cyan,
double *  magenta,
double *  yellow 
)
inlinestatic

Definition at line 119 of file colorspace.c.

References QuantumRange, and QuantumScale.

Referenced by sRGBTransformImage().

static void ConvertRGBToLab ( const double  red,
const double  green,
const double  blue,
double *  L,
double *  a,
double *  b 
)
static

Definition at line 147 of file colorspace.c.

References ConvertRGBToXYZ(), and ConvertXYZToLab().

Referenced by sRGBTransformImage().

static void ConvertRGBToLMS ( const double  red,
const double  green,
const double  blue,
double *  L,
double *  M,
double *  S 
)
static

Definition at line 135 of file colorspace.c.

References ConvertRGBToXYZ(), and ConvertXYZToLMS().

Referenced by sRGBTransformImage().

static void ConvertRGBToLuv ( const double  red,
const double  green,
const double  blue,
double *  L,
double *  u,
double *  v 
)
static

Definition at line 159 of file colorspace.c.

References ConvertRGBToXYZ(), and ConvertXYZToLuv().

Referenced by sRGBTransformImage().

static void ConvertRGBToxyY ( const double  red,
const double  green,
const double  blue,
double *  low_x,
double *  low_y,
double *  cap_Y 
)
static

Definition at line 171 of file colorspace.c.

References ConvertRGBToXYZ().

Referenced by sRGBTransformImage().

static void ConvertRGBToYCbCr ( const double  red,
const double  green,
const double  blue,
double *  Y,
double *  Cb,
double *  Cr 
)
static

Definition at line 209 of file colorspace.c.

References ConvertRGBToYPbPr().

Referenced by sRGBTransformImage().

static void ConvertRGBToYDbDr ( const double  red,
const double  green,
const double  blue,
double *  Y,
double *  Db,
double *  Dr 
)
static

Definition at line 185 of file colorspace.c.

References QuantumScale.

Referenced by sRGBTransformImage().

static void ConvertRGBToYIQ ( const double  red,
const double  green,
const double  blue,
double *  Y,
double *  I,
double *  Q 
)
static

Definition at line 193 of file colorspace.c.

References QuantumScale.

Referenced by sRGBTransformImage().

static void ConvertRGBToYPbPr ( const double  red,
const double  green,
const double  blue,
double *  Y,
double *  Pb,
double *  Pr 
)
static

Definition at line 201 of file colorspace.c.

References QuantumScale.

Referenced by ConvertRGBToYCbCr(), and sRGBTransformImage().

static void ConvertRGBToYUV ( const double  red,
const double  green,
const double  blue,
double *  Y,
double *  U,
double *  V 
)
static

Definition at line 215 of file colorspace.c.

References QuantumScale.

Referenced by sRGBTransformImage().

static void ConvertxyYToRGB ( const double  low_x,
const double  low_y,
const double  cap_Y,
double *  red,
double *  green,
double *  blue 
)
inlinestatic

Definition at line 1388 of file colorspace.c.

References ConvertXYZToRGB().

Referenced by TransformsRGBImage().

static void ConvertXYZToLMS ( const double  x,
const double  y,
const double  z,
double *  L,
double *  M,
double *  S 
)
inlinestatic

Definition at line 127 of file colorspace.c.

Referenced by ConvertRGBToLMS().

static void ConvertYCbCrToRGB ( const double  Y,
const double  Cb,
const double  Cr,
double *  red,
double *  green,
double *  blue 
)
static

Definition at line 1413 of file colorspace.c.

References ConvertYPbPrToRGB().

Referenced by TransformsRGBImage().

static void ConvertYDbDrToRGB ( const double  Y,
const double  Db,
const double  Dr,
double *  red,
double *  green,
double *  blue 
)
static

Definition at line 1430 of file colorspace.c.

References QuantumRange.

Referenced by TransformsRGBImage().

static void ConvertYIQToRGB ( const double  Y,
const double  I,
const double  Q,
double *  red,
double *  green,
double *  blue 
)
static

Definition at line 1419 of file colorspace.c.

References QuantumRange.

Referenced by TransformsRGBImage().

static void ConvertYPbPrToRGB ( const double  Y,
const double  Pb,
const double  Pr,
double *  red,
double *  green,
double *  blue 
)
static

Definition at line 1402 of file colorspace.c.

References QuantumRange.

Referenced by ConvertYCbCrToRGB(), and TransformsRGBImage().

static void ConvertYUVToRGB ( const double  Y,
const double  U,
const double  V,
double *  red,
double *  green,
double *  blue 
)
static

Definition at line 1441 of file colorspace.c.

References QuantumRange.

Referenced by TransformsRGBImage().

static ssize_t RoundToYCC ( const double  value)
inlinestatic

Definition at line 1367 of file colorspace.c.

Referenced by TransformsRGBImage().

static MagickBooleanType sRGBTransformImage ( Image image,
const ColorspaceType  colorspace,
ExceptionInfo exception 
)
static

Definition at line 223 of file colorspace.c.

References AcquireAuthenticCacheView(), AcquireQuantumMemory(), _Image::alpha_trait, _PixelInfo::blue, ClampToQuantum(), CMYColorspace, CMYKColorspace, _Image::colormap, _Image::colors, ColorSeparationAlphaType, ColorSeparationType, _Image::columns, ConvertRGBToCMY(), ConvertRGBToCMYK(), ConvertRGBToHCL(), ConvertRGBToHCLp(), ConvertRGBToHSB(), ConvertRGBToHSI(), ConvertRGBToHSL(), ConvertRGBToHSV(), ConvertRGBToHWB(), ConvertRGBToLab(), ConvertRGBToLCHab(), ConvertRGBToLCHuv(), ConvertRGBToLMS(), ConvertRGBToLuv(), ConvertRGBToxyY(), ConvertRGBToXYZ(), ConvertRGBToYCbCr(), ConvertRGBToYDbDr(), ConvertRGBToYIQ(), ConvertRGBToYPbPr(), ConvertRGBToYUV(), _Image::debug, DecodePixelGamma(), DestroyCacheView(), DirectClass, DisplayGamma, _Image::filename, FilmGamma, GetCacheViewAuthenticPixels(), GetImageProperty(), GetMagickModule, GetPixelBlue(), GetPixelChannels(), GetPixelGreen(), GetPixelInfo(), GetPixelInfoPixel(), GetPixelIntensity(), GetPixelRed(), GRAYColorspace, GrayscaleType, _PixelInfo::green, HCLColorspace, HCLpColorspace, HSBColorspace, HSIColorspace, HSLColorspace, HSVColorspace, HWBColorspace, LabColorspace, LCHabColorspace, LCHColorspace, LCHuvColorspace, LMSColorspace, LogColorspace, LogMagickEvent(), LuvColorspace, magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, MaxMap, OHTAColorspace, PerceptibleReciprocal(), _Image::progress_monitor, PseudoClass, QuantumRange, QuantumScale, Rec601YCbCrColorspace, Rec709YCbCrColorspace, _PixelInfo::red, ReferenceBlack, ReferenceWhite, RelinquishMagickMemory(), ResetMagickMemory(), ResourceLimitError, RGBColorspace, _Image::rows, scRGBColorspace, SetImageColorspace(), SetImageProgress(), SetImageStorageClass(), SetPixelBlue(), SetPixelGray(), SetPixelGreen(), SetPixelRed(), SetPixelViaPixelInfo(), _Image::signature, sRGBColorspace, sRGBTransformImageTag, _Image::storage_class, StringToDouble(), SyncCacheViewAuthenticPixels(), SyncImage(), ThrowBinaryException, TraceEvent, TransparentColorspace, _Image::type, UndefinedColorspace, UndefinedPixelTrait, _TransformPacket::x, _PrimaryInfo::x, xyYColorspace, XYZColorspace, _TransformPacket::y, _PrimaryInfo::y, YCbCrColorspace, YCCColorspace, YDbDrColorspace, YIQColorspace, YPbPrColorspace, YUVColorspace, _TransformPacket::z, and _PrimaryInfo::z.

Referenced by TransformImageColorspace().

static MagickBooleanType TransformsRGBImage ( Image image,
ExceptionInfo exception 
)
static

Definition at line 1452 of file colorspace.c.

References AcquireAuthenticCacheView(), AcquireQuantumMemory(), _PixelInfo::blue, ClampToQuantum(), CMYColorspace, CMYKColorspace, _Image::colormap, _Image::colors, _Image::colorspace, _Image::columns, ConvertCMYKToRGB(), ConvertCMYToRGB(), ConvertHCLpToRGB(), ConvertHCLToRGB(), ConvertHSBToRGB(), ConvertHSIToRGB(), ConvertHSLToRGB(), ConvertHSVToRGB(), ConvertHWBToRGB(), ConvertLabToRGB(), ConvertLCHabToRGB(), ConvertLCHuvToRGB(), ConvertLMSToRGB(), ConvertLuvToRGB(), ConvertxyYToRGB(), ConvertXYZToRGB(), ConvertYCbCrToRGB(), ConvertYDbDrToRGB(), ConvertYIQToRGB(), ConvertYPbPrToRGB(), ConvertYUVToRGB(), _Image::debug, DestroyCacheView(), DirectClass, DisplayGamma, EncodePixelGamma(), _Image::filename, FilmGamma, GetCacheViewAuthenticPixels(), GetImageProperty(), GetMagickModule, GetPixelBlue(), GetPixelChannels(), GetPixelGray(), GetPixelGreen(), GetPixelInfo(), GetPixelInfoPixel(), GetPixelRed(), GRAYColorspace, _PixelInfo::green, HCLColorspace, HCLpColorspace, HSBColorspace, HSIColorspace, HSLColorspace, HSVColorspace, HWBColorspace, _Image::intensity, LabColorspace, LCHabColorspace, LCHColorspace, LCHuvColorspace, LMSColorspace, LogColorspace, LogMagickEvent(), LuvColorspace, magick_restrict, MagickCoreSignature, MagickFalse, MagickTrue, MaxMap, OHTAColorspace, PerceptibleReciprocal(), _Image::progress_monitor, PseudoClass, QuantumRange, QuantumScale, Rec601LuminancePixelIntensityMethod, Rec601YCbCrColorspace, Rec709LuminancePixelIntensityMethod, Rec709YCbCrColorspace, _PixelInfo::red, ReferenceBlack, ReferenceWhite, RelinquishMagickMemory(), ResourceLimitError, RGBColorspace, RoundToYCC(), _Image::rows, scRGBColorspace, SetImageColorspace(), SetImageProgress(), SetImageStorageClass(), SetPixelBlue(), SetPixelGreen(), SetPixelRed(), SetPixelViaPixelInfo(), _Image::signature, sRGBColorspace, _Image::storage_class, StringToDouble(), SyncCacheViewAuthenticPixels(), SyncImage(), ThrowBinaryException, TraceEvent, TransformsRGBImageTag, _TransformPacket::x, xyYColorspace, XYZColorspace, _TransformPacket::y, YCbCrColorspace, YCCColorspace, YDbDrColorspace, YIQColorspace, YPbPrColorspace, YUVColorspace, and _TransformPacket::z.

Referenced by TransformImageColorspace().