#include "magick/studio.h"
#include "magick/attribute.h"
#include "magick/cache.h"
#include "magick/color.h"
#include "magick/colorspace-private.h"
#include "magick/configure.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/hashmap.h"
#include "magick/image.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/option.h"
#include "magick/option-private.h"
#include "magick/profile.h"
#include "magick/property.h"
#include "magick/quantum.h"
#include "magick/quantum-private.h"
#include "magick/resource_.h"
#include "magick/splay-tree.h"
#include "magick/string_.h"
#include "magick/thread-private.h"
#include "magick/token.h"
#include "magick/utility.h"
#include <wchar.h>
#include "lcms2.h"
#include <libxml/parser.h>
#include <libxml/tree.h>
Defines | |
#define | LCMSHDRI |
#define | LCMSScaleSource(pixel) (pixel) |
#define | LCMSScaleTarget(pixel) (pixel) |
#define | ProfileImageTag "Profile/Image" |
#define | ThrowProfileException(severity, tag, context) |
#define | MaxDirectoryStack 16 |
#define | EXIF_DELIMITER "\n" |
#define | EXIF_NUM_FORMATS 12 |
#define | TAG_EXIF_OFFSET 0x8769 |
#define | TAG_INTEROP_OFFSET 0xa005 |
Typedefs | |
typedef unsigned short | LCMSType |
Functions | |
static MagickBooleanType | SetImageProfileInternal (Image *, const char *, const StringInfo *, const MagickBooleanType) |
static void | WriteTo8BimProfile (Image *, const char *, const StringInfo *) |
MagickExport MagickBooleanType | CloneImageProfiles (Image *image, const Image *clone_image) |
MagickExport MagickBooleanType | DeleteImageProfile (Image *image, const char *name) |
MagickExport void | DestroyImageProfiles (Image *image) |
MagickExport const StringInfo * | GetImageProfile (const Image *image, const char *name) |
MagickExport char * | GetNextImageProfile (const Image *image) |
static LCMSType ** | DestroyPixelThreadSet (LCMSType **pixels) |
static LCMSType ** | AcquirePixelThreadSet (const size_t columns, const size_t channels) |
static cmsHTRANSFORM * | DestroyTransformThreadSet (cmsHTRANSFORM *transform) |
static cmsHTRANSFORM * | AcquireTransformThreadSet (Image *image, const cmsHPROFILE source_profile, const cmsUInt32Number source_type, const cmsHPROFILE target_profile, const cmsUInt32Number target_type, const int intent, const cmsUInt32Number flags) |
static void | LCMSExceptionHandler (cmsContext context, cmsUInt32Number severity, const char *message) |
static MagickBooleanType | SetsRGBImageProfile (Image *image) |
MagickExport MagickBooleanType | ProfileImage (Image *image, const char *name, const void *datum, const size_t length, const MagickBooleanType magick_unused(clone)) |
MagickExport StringInfo * | RemoveImageProfile (Image *image, const char *name) |
MagickExport void | ResetImageProfileIterator (const Image *image) |
static void * | DestroyProfile (void *profile) |
static const unsigned char * | ReadResourceByte (const unsigned char *p, unsigned char *quantum) |
static const unsigned char * | ReadResourceLong (const unsigned char *p, unsigned int *quantum) |
static const unsigned char * | ReadResourceShort (const unsigned char *p, unsigned short *quantum) |
static void | WriteResourceLong (unsigned char *p, const unsigned int quantum) |
static void | GetProfilesFromResourceBlock (Image *image, const StringInfo *resource_block) |
static MagickBooleanType | ValidateXMPProfile (const StringInfo *profile) |
MagickExport MagickBooleanType | SetImageProfile (Image *image, const char *name, const StringInfo *profile) |
static int | ReadProfileByte (unsigned char **p, size_t *length) |
static signed short | ReadProfileShort (const EndianType endian, unsigned char *buffer) |
static signed int | ReadProfileLong (const EndianType endian, unsigned char *buffer) |
static signed int | ReadProfileMSBLong (unsigned char **p, size_t *length) |
static signed short | ReadProfileMSBShort (unsigned char **p, size_t *length) |
static void | WriteProfileLong (const EndianType endian, const size_t value, unsigned char *p) |
static void | WriteProfileShort (const EndianType endian, const unsigned short value, unsigned char *p) |
static MagickBooleanType | Sync8BimProfile (Image *image, StringInfo *profile) |
static MagickBooleanType | SyncExifProfile (Image *image, StringInfo *profile) |
MagickExport MagickBooleanType | SyncImageProfiles (Image *image) |
#define EXIF_DELIMITER "\n" |
#define EXIF_NUM_FORMATS 12 |
Referenced by SyncExifProfile().
#define LCMSHDRI |
#define LCMSScaleSource | ( | pixel | ) | (pixel) |
Referenced by ProfileImage().
#define LCMSScaleTarget | ( | pixel | ) | (pixel) |
Referenced by ProfileImage().
#define MaxDirectoryStack 16 |
Referenced by GetEXIFProperty(), and SyncExifProfile().
#define ProfileImageTag "Profile/Image" |
Referenced by ProfileImage().
#define TAG_EXIF_OFFSET 0x8769 |
Referenced by GetEXIFProperty(), and SyncExifProfile().
#define TAG_INTEROP_OFFSET 0xa005 |
Referenced by GetEXIFProperty(), and SyncExifProfile().
#define ThrowProfileException | ( | severity, | |||
tag, | |||||
context | ) |
{ \ if (source_profile != (cmsHPROFILE) NULL) \ (void) cmsCloseProfile(source_profile); \ if (target_profile != (cmsHPROFILE) NULL) \ (void) cmsCloseProfile(target_profile); \ ThrowBinaryException(severity,tag,context); \ }
Referenced by ProfileImage().
typedef unsigned short LCMSType |
static LCMSType** AcquirePixelThreadSet | ( | const size_t | columns, | |
const size_t | channels | |||
) | [static] |
References AcquireQuantumMemory(), DestroyPixelThreadSet(), GetMagickResourceLimit(), and ThreadResource.
Referenced by ProfileImage().
static cmsHTRANSFORM* AcquireTransformThreadSet | ( | Image * | image, | |
const cmsHPROFILE | source_profile, | |||
const cmsUInt32Number | source_type, | |||
const cmsHPROFILE | target_profile, | |||
const cmsUInt32Number | target_type, | |||
const int | intent, | |||
const cmsUInt32Number | flags | |||
) | [static] |
References AcquireQuantumMemory(), DestroyTransformThreadSet(), GetMagickResourceLimit(), and ThreadResource.
Referenced by ProfileImage().
MagickExport MagickBooleanType CloneImageProfiles | ( | Image * | image, | |
const Image * | clone_image | |||
) |
References CloneSplayTree(), CloneStringInfo(), _Image::color_profile, ConstantString(), _Image::debug, DestroyImageProfiles(), _Image::filename, GetMagickModule, _ProfileInfo::info, _Image::iptc_profile, _ProfileInfo::length, LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, _Image::profiles, _Image::signature, and TraceEvent.
Referenced by CloneImage(), CoalesceImages(), and DisposeImages().
MagickExport MagickBooleanType DeleteImageProfile | ( | Image * | image, | |
const char * | name | |||
) |
References _Image::color_profile, _Image::debug, DeleteNodeFromSplayTree(), _Image::filename, GetMagickModule, _ProfileInfo::info, _Image::iptc_profile, _ProfileInfo::length, LocaleCompare(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _Image::profiles, _Image::signature, TraceEvent, and WriteTo8BimProfile().
Referenced by ProfileImage(), ThumbnailImage(), and TransformImageColorspace().
MagickExport void DestroyImageProfiles | ( | Image * | image | ) |
References DestroySplayTree(), and _Image::profiles.
Referenced by CloneImageProfiles(), DestroyImage(), and StripImage().
References GetMagickResourceLimit(), RelinquishMagickMemory(), and ThreadResource.
Referenced by AcquirePixelThreadSet(), and ProfileImage().
static void* DestroyProfile | ( | void * | profile | ) | [static] |
References DestroyStringInfo().
Referenced by SetImageProfileInternal().
static cmsHTRANSFORM* DestroyTransformThreadSet | ( | cmsHTRANSFORM * | transform | ) | [static] |
References GetMagickResourceLimit(), RelinquishMagickMemory(), and ThreadResource.
Referenced by AcquireTransformThreadSet(), and ProfileImage().
MagickExport const StringInfo* GetImageProfile | ( | const Image * | image, | |
const char * | name | |||
) |
References _Image::debug, _Image::filename, GetMagickModule, GetValueFromSplayTree(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _Image::profiles, _Image::signature, and TraceEvent.
Referenced by Get8BIMProperty(), GetEXIFProperty(), GetICCProperty(), GetIPTCProperty(), GetMagickProperty(), GetXMPProperty(), IdentifyImage(), ProfileImage(), ReadImage(), SetImageProfileInternal(), SetsRGBImageProfile(), and SyncImageProfiles().
MagickExport char* GetNextImageProfile | ( | const Image * | image | ) |
References _Image::debug, _Image::filename, GetMagickModule, GetNextKeyInSplayTree(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _Image::profiles, _Image::signature, and TraceEvent.
Referenced by GetMagickProperty(), IdentifyImage(), ProfileImage(), and ThumbnailImage().
static void GetProfilesFromResourceBlock | ( | Image * | image, | |
const StringInfo * | resource_block | |||
) | [static] |
References AcquireStringInfo(), DestroyStringInfo(), GetStringInfoDatum(), GetStringInfoLength(), LocaleNCompare(), MagickTrue, PixelsPerCentimeterResolution, PixelsPerInchResolution, ReadResourceByte(), ReadResourceLong(), ReadResourceShort(), SetImageProfileInternal(), SetStringInfoDatum(), _Image::units, _PolicyInfo::value, _Image::x_resolution, and _Image::y_resolution.
Referenced by SetImageProfileInternal().
static void LCMSExceptionHandler | ( | cmsContext | context, | |
cmsUInt32Number | severity, | |||
const char * | message | |||
) | [static] |
References _Image::exception, _Image::filename, GetMagickModule, ImageWarning, LogMagickEvent(), ThrowMagickException(), and TransformEvent.
Referenced by ProfileImage().
MagickExport MagickBooleanType ProfileImage | ( | Image * | image, | |
const char * | name, | |||
const void * | datum, | |||
const size_t | length, | |||
const MagickBooleanType | magick_unusedclone | |||
) |
References AbsoluteIntent, AcquireAuthenticCacheView(), AcquirePixelThreadSet(), AcquireStringInfo(), AcquireTransformThreadSet(), cmsUInt32Number, CMYKColorspace, ColorSeparationMatteType, ColorSeparationType, CompareStringInfo(), _Image::debug, DeleteImageProfile(), DestroyCacheView(), DestroyPixelThreadSet(), DestroyStringInfo(), DestroyTransformThreadSet(), DirectClass, _Image::exception, _Image::filename, GetCacheViewAuthenticIndexQueue(), GetCacheViewAuthenticPixels(), GetImageProfile(), GetImageProperty(), GetMagickModule, GetNextImageProfile(), GetOpenMPThreadId(), GetPixelBlue, GetPixelGreen, GetPixelIndex, GetPixelRed, GetStringInfoDatum(), GetStringInfoLength(), GRAYColorspace, GrayscaleMatteType, GrayscaleType, ImageError, IsOptionMember(), LabColorspace, LCMSExceptionHandler(), LCMSScaleSource, LCMSScaleTarget, LocaleCompare(), LogMagickEvent(), magick_restrict, magick_unreferenced, MagickCoreSignature, MagickFalse, MagickTrue, MissingDelegateWarning, PerceptualIntent, ProfileImageTag, RelativeIntent, ResetImageProfileIterator(), ResourceLimitError, SaturationIntent, SetImageColorspace(), SetImageProfile(), SetImageProgress(), SetImageStorageClass(), SetPixelBlue, SetPixelGreen, SetPixelIndex, SetPixelRed, SetsRGBImageProfile(), SetStringInfoDatum(), _PolicyInfo::signature, _Image::signature, sRGBColorspace, SyncCacheViewAuthenticPixels(), ThrowBinaryImageException, ThrowMagickException(), ThrowProfileException, TraceEvent, TrueColorMatteType, TrueColorType, _PolicyInfo::value, XYZColorspace, and YUVColorspace.
static int ReadProfileByte | ( | unsigned char ** | p, | |
size_t * | length | |||
) | [inline, static] |
Referenced by Sync8BimProfile(), and SyncExifProfile().
static signed int ReadProfileLong | ( | const EndianType | endian, | |
unsigned char * | buffer | |||
) | [inline, static] |
References LSBEndian, and _PolicyInfo::value.
Referenced by ReadProfileMSBLong(), and SyncExifProfile().
static signed int ReadProfileMSBLong | ( | unsigned char ** | p, | |
size_t * | length | |||
) | [inline, static] |
References MSBEndian, ReadProfileLong(), and _PolicyInfo::value.
Referenced by Sync8BimProfile().
static signed short ReadProfileMSBShort | ( | unsigned char ** | p, | |
size_t * | length | |||
) | [inline, static] |
References MSBEndian, ReadProfileShort(), and _PolicyInfo::value.
Referenced by Sync8BimProfile().
static signed short ReadProfileShort | ( | const EndianType | endian, | |
unsigned char * | buffer | |||
) | [inline, static] |
References LSBEndian, and _PolicyInfo::value.
Referenced by ReadProfileMSBShort(), and SyncExifProfile().
static const unsigned char* ReadResourceByte | ( | const unsigned char * | p, | |
unsigned char * | quantum | |||
) | [inline, static] |
Referenced by GetProfilesFromResourceBlock(), and WriteTo8BimProfile().
static const unsigned char* ReadResourceLong | ( | const unsigned char * | p, | |
unsigned int * | quantum | |||
) | [inline, static] |
Referenced by GetProfilesFromResourceBlock(), and WriteTo8BimProfile().
static const unsigned char* ReadResourceShort | ( | const unsigned char * | p, | |
unsigned short * | quantum | |||
) | [inline, static] |
Referenced by GetProfilesFromResourceBlock(), and WriteTo8BimProfile().
MagickExport StringInfo* RemoveImageProfile | ( | Image * | image, | |
const char * | name | |||
) |
References _Image::color_profile, _Image::debug, _Image::filename, GetMagickModule, _ProfileInfo::info, _Image::iptc_profile, _ProfileInfo::length, LocaleCompare(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _Image::profiles, RemoveNodeFromSplayTree(), _Image::signature, TraceEvent, and WriteTo8BimProfile().
MagickExport void ResetImageProfileIterator | ( | const Image * | image | ) |
References _Image::debug, _Image::filename, GetMagickModule, LogMagickEvent(), MagickCoreSignature, MagickFalse, _Image::profiles, ResetSplayTreeIterator(), _Image::signature, and TraceEvent.
Referenced by GetMagickProperty(), IdentifyImage(), ProfileImage(), and ThumbnailImage().
MagickExport MagickBooleanType SetImageProfile | ( | Image * | image, | |
const char * | name, | |||
const StringInfo * | profile | |||
) |
References MagickFalse, and SetImageProfileInternal().
Referenced by ProfileImage(), SetImageProperty(), and SetsRGBImageProfile().
static MagickBooleanType SetImageProfileInternal | ( | Image * | image, | |
const char * | name, | |||
const StringInfo * | profile, | |||
const MagickBooleanType | recursive | |||
) | [static] |
References AddValueToSplayTree(), CloneStringInfo(), _Image::color_profile, CompareSplayTreeString(), ConstantString(), CopyMagickString(), _Image::debug, DestroyProfile(), _Image::exception, _Image::filename, FormatLocaleString(), GetImageProfile(), GetImageProperty(), GetMagickModule, GetProfilesFromResourceBlock(), GetStringInfoDatum(), GetStringInfoLength(), ImageWarning, _ProfileInfo::info, _Image::iptc_profile, _ProfileInfo::length, LocaleCompare(), LocaleLower(), LogMagickEvent(), MagickCoreSignature, MagickFalse, MagickTrue, MaxTextExtent, NewSplayTree(), _Image::profiles, RelinquishMagickMemory(), _Image::signature, ThrowMagickException(), TraceEvent, ValidateXMPProfile(), and WriteTo8BimProfile().
Referenced by GetProfilesFromResourceBlock(), and SetImageProfile().
static MagickBooleanType SetsRGBImageProfile | ( | Image * | image | ) | [static] |
References AcquireStringInfo(), DestroyStringInfo(), GetImageProfile(), MagickCoreSignature, MagickFalse, SetImageProfile(), SetStringInfoDatum(), and _Image::signature.
Referenced by ProfileImage().
static MagickBooleanType Sync8BimProfile | ( | Image * | image, | |
StringInfo * | profile | |||
) | [static] |
References GetStringInfoDatum(), GetStringInfoLength(), MagickFalse, MagickTrue, MSBEndian, PixelsPerCentimeterResolution, ReadProfileByte(), ReadProfileMSBLong(), ReadProfileMSBShort(), _Image::units, WriteProfileLong(), WriteProfileShort(), _Image::x_resolution, and _Image::y_resolution.
Referenced by SyncImageProfiles().
static MagickBooleanType SyncExifProfile | ( | Image * | image, | |
StringInfo * | profile | |||
) | [static] |
References AddValueToSplayTree(), DestroySplayTree(), EXIF_NUM_FORMATS, GetStringInfoDatum(), GetStringInfoLength(), GetValueFromSplayTree(), LSBEndian, MagickFalse, MagickTrue, MaxDirectoryStack, MSBEndian, NewSplayTree(), _Image::orientation, ReadProfileByte(), ReadProfileLong(), ReadProfileShort(), TAG_EXIF_OFFSET, TAG_INTEROP_OFFSET, _Image::units, WriteProfileLong(), WriteProfileShort(), _Image::x_resolution, and _Image::y_resolution.
Referenced by SyncImageProfiles().
MagickExport MagickBooleanType SyncImageProfiles | ( | Image * | image | ) |
References GetImageProfile(), MagickFalse, MagickTrue, Sync8BimProfile(), and SyncExifProfile().
Referenced by WriteImage().
static MagickBooleanType ValidateXMPProfile | ( | const StringInfo * | profile | ) | [static] |
References GetStringInfoDatum(), GetStringInfoLength(), MagickFalse, and MagickTrue.
Referenced by SetImageProfileInternal().
static void WriteProfileLong | ( | const EndianType | endian, | |
const size_t | value, | |||
unsigned char * | p | |||
) | [inline, static] |
References LSBEndian.
Referenced by Sync8BimProfile(), and SyncExifProfile().
static void WriteProfileShort | ( | const EndianType | endian, | |
const unsigned short | value, | |||
unsigned char * | p | |||
) | [static] |
References LSBEndian.
Referenced by Sync8BimProfile(), and SyncExifProfile().
static void WriteResourceLong | ( | unsigned char * | p, | |
const unsigned int | quantum | |||
) | [inline, static] |
Referenced by WriteTo8BimProfile().
static void WriteTo8BimProfile | ( | Image * | image, | |
const char * | name, | |||
const StringInfo * | profile | |||
) | [static] |
References AcquireStringInfo(), AddValueToSplayTree(), CloneStringInfo(), ConstantString(), _StringInfo::datum, DestroyStringInfo(), GetStringInfoDatum(), GetStringInfoLength(), GetValueFromSplayTree(), _StringInfo::length, LocaleCompare(), LocaleNCompare(), _Image::profiles, ReadResourceByte(), ReadResourceLong(), ReadResourceShort(), _PolicyInfo::value, and WriteResourceLong().
Referenced by DeleteImageProfile(), RemoveImageProfile(), and SetImageProfileInternal().