MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
|
#include "MagickCore/studio.h"
#include "MagickCore/artifact.h"
#include "MagickCore/attribute.h"
#include "MagickCore/property.h"
#include "MagickCore/cache.h"
#include "MagickCore/cache-private.h"
#include "MagickCore/cache-view.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colorspace.h"
#include "MagickCore/colorspace-private.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/enhance.h"
#include "MagickCore/image.h"
#include "MagickCore/image-private.h"
#include "MagickCore/gem.h"
#include "MagickCore/gem-private.h"
#include "MagickCore/memory_.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/quantize.h"
#include "MagickCore/quantum.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/resource_.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/utility.h"
Go to the source code of this file.
Data Structures | |
struct | _TransformPacket |
Macros | |
#define | Jzazbz_b 1.15 /* https://observablehq.com/@jrus/jzazbz */ |
#define | Jzazbz_g 0.66 |
#define | Jzazbz_c1 (3424.0/4096.0) |
#define | Jzazbz_c2 (2413.0/128.0) |
#define | Jzazbz_c3 (2392.0/128.0) |
#define | Jzazbz_n (2610.0/16384.0) |
#define | Jzazbz_p (1.7*2523.0/32.0) |
#define | Jzazbz_d (-0.56) |
#define | Jzazbz_d0 (1.6295499532821566e-11) |
#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 *) |
MagickExport ColorspaceType | GetImageColorspaceType (const Image *image, ExceptionInfo *exception) |
static void | ConvertAdobe98ToRGB (const double r, const double g, const double b, double *red, double *green, double *blue) |
static void | ConvertDisplayP3ToRGB (const double r, const double g, const double b, double *red, double *green, double *blue) |
static void | ConvertProPhotoToRGB (const double r, const double g, const double b, double *red, double *green, double *blue) |
static void | ConvertRGBToCMY (const double red, const double green, const double blue, double *cyan, double *magenta, double *yellow) |
static void | ConvertRGBToAdobe98 (const double red, const double green, const double blue, double *r, double *g, double *b) |
static void | ConvertRGBToDisplayP3 (const double red, const double green, const double blue, double *r, double *g, double *b) |
static void | ConvertRGBToProPhoto (const double red, const double green, const double blue, double *r, double *g, double *b) |
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 | ConvertRGBToLuv (const double red, const double green, const double blue, const IlluminantType illuminant, 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 | ConvertXYZToJzazbz (const double X, const double Y, const double Z, const double white_luminance, double *Jz, double *az, double *bz) |
static void | ConvertJzazbzToXYZ (const double Jz, const double az, const double bz, const double white_luminance, double *X, double *Y, double *Z) |
static void | ConvertRGBToJzazbz (const double red, const double green, const double blue, const double white_luminance, double *Jz, double *az, double *bz) |
static void | ConvertJzazbzToRGB (const double Jz, const double az, const double bz, const double white_luminance, double *red, double *green, double *blue) |
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, const IlluminantType illuminant, 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, const IlluminantType illuminant, 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) |
#define DisplayGamma (1.0/1.7) |
#define FilmGamma 0.6 |
#define Jzazbz_b 1.15 /* https://observablehq.com/@jrus/jzazbz */ |
#define Jzazbz_c1 (3424.0/4096.0) |
#define Jzazbz_c2 (2413.0/128.0) |
#define Jzazbz_c3 (2392.0/128.0) |
#define Jzazbz_d (-0.56) |
#define Jzazbz_d0 (1.6295499532821566e-11) |
#define Jzazbz_g 0.66 |
#define Jzazbz_n (2610.0/16384.0) |
#define Jzazbz_p (1.7*2523.0/32.0) |
#define ReferenceBlack 95.0 |
#define ReferenceWhite 685.0 |
#define sRGBTransformImageTag "RGBTransform/Image" |
#define TransformsRGBImageTag "Transform/Image" |
typedef struct _TransformPacket TransformPacket |
|
inlinestatic |
Definition at line 172 of file colorspace.c.
References ConvertAdobe98ToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
inlinestatic |
Definition at line 1670 of file colorspace.c.
References QuantumRange.
Referenced by TransformsRGBImage().
|
inlinestatic |
Definition at line 184 of file colorspace.c.
References ConvertDisplayP3ToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
static |
Definition at line 400 of file colorspace.c.
References ConvertJzazbzToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
inlinestatic |
|
inlinestatic |
Definition at line 1720 of file colorspace.c.
References ConvertLabToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
inlinestatic |
Definition at line 1686 of file colorspace.c.
References ConvertLMSToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
inlinestatic |
Definition at line 1678 of file colorspace.c.
Referenced by ConvertLMSToRGB().
|
inlinestatic |
Definition at line 1698 of file colorspace.c.
References ConvertLuvToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
inlinestatic |
Definition at line 196 of file colorspace.c.
References ConvertProPhotoToXYZ(), and ConvertXYZToRGB().
Referenced by TransformsRGBImage().
|
static |
Definition at line 216 of file colorspace.c.
References ConvertRGBToXYZ(), and ConvertXYZToAdobe98().
Referenced by sRGBTransformImage().
|
inlinestatic |
Definition at line 208 of file colorspace.c.
References QuantumRange, and QuantumScale.
Referenced by sRGBTransformImage().
|
static |
Definition at line 228 of file colorspace.c.
References ConvertRGBToXYZ(), and ConvertXYZToDisplayP3().
Referenced by sRGBTransformImage().
|
static |
Definition at line 387 of file colorspace.c.
References ConvertRGBToXYZ(), and ConvertXYZToJzazbz().
Referenced by sRGBTransformImage().
|
static |
Definition at line 260 of file colorspace.c.
References ConvertRGBToXYZ(), and ConvertXYZToLMS().
Referenced by sRGBTransformImage().
|
static |
Definition at line 272 of file colorspace.c.
References ConvertRGBToXYZ(), and ConvertXYZToLuv().
Referenced by sRGBTransformImage().
|
static |
Definition at line 240 of file colorspace.c.
References ConvertRGBToXYZ(), and ConvertXYZToProPhoto().
Referenced by sRGBTransformImage().
|
static |
Definition at line 285 of file colorspace.c.
References ConvertRGBToXYZ(), and PerceptibleReciprocal().
Referenced by sRGBTransformImage().
|
static |
Definition at line 437 of file colorspace.c.
References ConvertRGBToYPbPr().
Referenced by sRGBTransformImage().
|
static |
Definition at line 413 of file colorspace.c.
References QuantumScale.
Referenced by sRGBTransformImage().
|
static |
Definition at line 421 of file colorspace.c.
References QuantumScale.
Referenced by sRGBTransformImage().
|
static |
Definition at line 429 of file colorspace.c.
References QuantumScale.
Referenced by ConvertRGBToYCbCr(), and sRGBTransformImage().
|
static |
Definition at line 443 of file colorspace.c.
References QuantumScale.
Referenced by sRGBTransformImage().
|
inlinestatic |
Definition at line 1733 of file colorspace.c.
References ConvertXYZToRGB(), and PerceptibleReciprocal().
Referenced by TransformsRGBImage().
|
inlinestatic |
Definition at line 301 of file colorspace.c.
References Jzazbz_b, Jzazbz_c1, Jzazbz_c2, Jzazbz_c3, Jzazbz_d, Jzazbz_d0, Jzazbz_g, Jzazbz_n, Jzazbz_p, and PerceptibleReciprocal().
Referenced by ConvertRGBToJzazbz().
|
inlinestatic |
Definition at line 252 of file colorspace.c.
Referenced by ConvertRGBToLMS().
|
static |
Definition at line 1760 of file colorspace.c.
References ConvertYPbPrToRGB().
Referenced by TransformsRGBImage().
|
static |
Definition at line 1777 of file colorspace.c.
References QuantumRange.
Referenced by TransformsRGBImage().
|
static |
Definition at line 1766 of file colorspace.c.
References QuantumRange.
Referenced by TransformsRGBImage().
|
static |
Definition at line 1749 of file colorspace.c.
References QuantumRange.
Referenced by ConvertYCbCrToRGB(), and TransformsRGBImage().
|
static |
Definition at line 1788 of file colorspace.c.
References QuantumRange.
Referenced by TransformsRGBImage().
MagickExport ColorspaceType GetImageColorspaceType | ( | const Image * | image, |
ExceptionInfo * | exception | ||
) |
Definition at line 121 of file colorspace.c.
References _Image::colorspace, _Image::filename, GetMagickModule, GRAYColorspace, IdentifyImageType(), IsEventLogging(), IsGrayImageType(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _Image::signature, and TraceEvent.
|
inlinestatic |
Definition at line 1711 of file colorspace.c.
Referenced by TransformsRGBImage().
MagickExport MagickBooleanType SetImageColorspace | ( | Image * | image, |
const ColorspaceType | colorspace, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1418 of file colorspace.c.
References _ChromaticityInfo::blue_primary, _Image::chromaticity, _Image::colorspace, _Image::filename, _Image::gamma, GetMagickModule, GrayscaleType, _ChromaticityInfo::green_primary, IsEventLogging(), IsGrayColorspace(), IsRGBColorspace(), LinearGRAYColorspace, LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, PerceptualIntent, _ChromaticityInfo::red_primary, _Image::rendering_intent, _ExceptionInfo::signature, _Image::signature, SyncImagePixelCache(), TraceEvent, _Image::type, UndefinedIntent, _ChromaticityInfo::white_point, _PrimaryInfo::x, xyYColorspace, XYZColorspace, _PrimaryInfo::y, and _PrimaryInfo::z.
Referenced by AnnotateImage(), AppendImages(), BilevelImage(), BlackThresholdImage(), ChannelFxImage(), ClutImage(), ColorizeImage(), CombineImages(), CompositeImage(), ConsolidateCMYKImages(), ContrastStretchImage(), DistortImage(), DrawPrimitive(), FloodfillPaintImage(), FrameImage(), GetImageMask(), GrayscaleImage(), ImportImagePixels(), LevelImageColors(), MagnifyImage(), ModulateImage(), ProfileImage(), SeparateImage(), SetImageProperty(), SetPixelCacheVirtualMethod(), ShadowImage(), SolarizeImage(), SpliceImage(), sRGBTransformImage(), StereoAnaglyphImage(), TintImage(), TransformImageColorspace(), and TransformsRGBImage().
MagickExport MagickBooleanType SetImageGray | ( | Image * | image, |
ExceptionInfo * | exception | ||
) |
Definition at line 1498 of file colorspace.c.
References _Image::colorspace, _Image::filename, GetImageProperty(), GetMagickModule, GRAYColorspace, IdentifyImageGray(), IsEventLogging(), IsImageGray(), IssRGBCompatibleColorspace(), IsStringFalse(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, _Image::signature, SyncImagePixelCache(), TraceEvent, _Image::type, and UndefinedType.
MagickExport MagickBooleanType SetImageMonochrome | ( | Image * | image, |
ExceptionInfo * | exception | ||
) |
Definition at line 1555 of file colorspace.c.
References BilevelType, _Image::colorspace, _Image::filename, GetMagickModule, GRAYColorspace, IdentifyImageMonochrome(), IsEventLogging(), IsImageMonochrome(), IssRGBCompatibleColorspace(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, _Image::signature, SyncImagePixelCache(), TraceEvent, and _Image::type.
Referenced by SetGrayscaleImage().
|
static |
Definition at line 451 of file colorspace.c.
References AcquireAuthenticCacheView(), AcquireQuantumMemory(), Adobe98Colorspace, _Image::alpha_trait, _PixelInfo::blue, ClampToQuantum(), CMYColorspace, CMYKColorspace, _Image::colormap, _Image::colors, ColorSeparationAlphaType, ColorSeparationType, _Image::columns, ConvertRGBToAdobe98(), ConvertRGBToCMY(), ConvertRGBToCMYK(), ConvertRGBToDisplayP3(), ConvertRGBToHCL(), ConvertRGBToHCLp(), ConvertRGBToHSB(), ConvertRGBToHSI(), ConvertRGBToHSL(), ConvertRGBToHSV(), ConvertRGBToHWB(), ConvertRGBToJzazbz(), ConvertRGBToLab(), ConvertRGBToLCHab(), ConvertRGBToLCHuv(), ConvertRGBToLMS(), ConvertRGBToLuv(), ConvertRGBToProPhoto(), ConvertRGBToxyY(), ConvertRGBToXYZ(), ConvertRGBToYCbCr(), ConvertRGBToYDbDr(), ConvertRGBToYIQ(), ConvertRGBToYPbPr(), ConvertRGBToYUV(), D65Illuminant, DecodePixelGamma(), DestroyCacheView(), DirectClass, DisplayGamma, DisplayP3Colorspace, _Image::filename, FilmGamma, GetCacheViewAuthenticPixels(), GetImageArtifact(), GetImageProperty(), GetMagickModule, GetPixelBlue(), GetPixelChannels(), GetPixelGreen(), GetPixelInfo(), GetPixelInfoPixel(), GetPixelRed(), GRAYColorspace, GrayscaleType, _PixelInfo::green, HCLColorspace, HCLpColorspace, HSBColorspace, HSIColorspace, HSLColorspace, HSVColorspace, HWBColorspace, IsEventLogging(), JzazbzColorspace, LabColorspace, LCHabColorspace, LCHColorspace, LCHuvColorspace, LinearGRAYColorspace, LMSColorspace, LogColorspace, LogMagickEvent(), LuvColorspace, magick_restrict, MagickCoreSignature, MagickFalse, MagickIlluminantOptions, MagickTrue, MaxMap, OHTAColorspace, ParseCommandOption(), PerceptibleReciprocal(), _Image::progress_monitor, ProPhotoColorspace, PseudoClass, QuantumRange, QuantumScale, Rec601YCbCrColorspace, Rec709YCbCrColorspace, _PixelInfo::red, ReferenceBlack, ReferenceWhite, RelinquishMagickMemory(), 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, UndefinedIlluminant, 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().
MagickExport MagickBooleanType TransformImageColorspace | ( | Image * | image, |
const ColorspaceType | colorspace, | ||
ExceptionInfo * | exception | ||
) |
Definition at line 1607 of file colorspace.c.
References _Image::colorspace, DeleteImageProfile(), _Image::filename, GetMagickModule, IsEventLogging(), IssRGBColorspace(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, SetImageColorspace(), _Image::signature, sRGBTransformImage(), TraceEvent, TransformsRGBImage(), and UndefinedColorspace.
Referenced by AssignImageColors(), CannyEdgeImage(), CLAHEImage(), ClassifyImageColors(), ConformPixelInfo(), GetImagePerceptualHash(), RangeThresholdImage(), SegmentImage(), SelectiveBlurImage(), SetGrayscaleImage(), SetImageType(), TextureImage(), VignetteImage(), WhiteBalanceImage(), and WhiteThresholdImage().
|
static |
Definition at line 1799 of file colorspace.c.
References AcquireAuthenticCacheView(), AcquireQuantumMemory(), Adobe98Colorspace, _PixelInfo::blue, ClampToQuantum(), CMYColorspace, CMYKColorspace, _Image::colormap, _Image::colors, _Image::colorspace, _Image::columns, ConvertAdobe98ToRGB(), ConvertCMYKToRGB(), ConvertCMYToRGB(), ConvertDisplayP3ToRGB(), ConvertHCLpToRGB(), ConvertHCLToRGB(), ConvertHSBToRGB(), ConvertHSIToRGB(), ConvertHSLToRGB(), ConvertHSVToRGB(), ConvertHWBToRGB(), ConvertJzazbzToRGB(), ConvertLabToRGB(), ConvertLCHabToRGB(), ConvertLCHuvToRGB(), ConvertLMSToRGB(), ConvertLuvToRGB(), ConvertProPhotoToRGB(), ConvertxyYToRGB(), ConvertXYZToRGB(), ConvertYCbCrToRGB(), ConvertYDbDrToRGB(), ConvertYIQToRGB(), ConvertYPbPrToRGB(), ConvertYUVToRGB(), D65Illuminant, DestroyCacheView(), DirectClass, DisplayGamma, DisplayP3Colorspace, EncodePixelGamma(), _Image::filename, FilmGamma, GetCacheViewAuthenticPixels(), GetImageArtifact(), GetImageProperty(), GetMagickModule, GetPixelBlue(), GetPixelChannels(), GetPixelGreen(), GetPixelInfo(), GetPixelInfoPixel(), GetPixelRed(), GRAYColorspace, _PixelInfo::green, HCLColorspace, HCLpColorspace, HSBColorspace, HSIColorspace, HSLColorspace, HSVColorspace, HWBColorspace, IsEventLogging(), JzazbzColorspace, LabColorspace, LCHabColorspace, LCHColorspace, LCHuvColorspace, LinearGRAYColorspace, LMSColorspace, LogColorspace, LogMagickEvent(), LuvColorspace, magick_restrict, MagickCoreSignature, MagickFalse, MagickIlluminantOptions, MagickTrue, MaxMap, OHTAColorspace, ParseCommandOption(), PerceptibleReciprocal(), _Image::progress_monitor, ProPhotoColorspace, PseudoClass, QuantumRange, QuantumScale, Rec601YCbCrColorspace, 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, UndefinedIlluminant, _TransformPacket::x, xyYColorspace, XYZColorspace, _TransformPacket::y, YCbCrColorspace, YCCColorspace, YDbDrColorspace, YIQColorspace, YPbPrColorspace, YUVColorspace, and _TransformPacket::z.
Referenced by TransformImageColorspace().