File indexing completed on 2025-11-04 10:15:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef MAGICKCORE_PIXEL_H
0019 #define MAGICKCORE_PIXEL_H
0020
0021 #include "MagickCore/colorspace.h"
0022
0023 #if defined(__cplusplus) || defined(c_plusplus)
0024 extern "C" {
0025 #endif
0026
0027 #define MaxPixelChannels 64
0028 #undef index
0029
0030
0031
0032
0033 #if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT)
0034 typedef enum : MagickOffsetType
0035 #else
0036 typedef enum
0037 #endif
0038 {
0039 UndefinedChannel = 0x0000,
0040 RedChannel = 0x0001,
0041 GrayChannel = 0x0001,
0042 CyanChannel = 0x0001,
0043 LChannel = 0x0001,
0044 GreenChannel = 0x0002,
0045 MagentaChannel = 0x0002,
0046 aChannel = 0x0002,
0047 BlueChannel = 0x0004,
0048 bChannel = 0x0002,
0049 YellowChannel = 0x0004,
0050 BlackChannel = 0x0008,
0051 AlphaChannel = 0x0010,
0052 OpacityChannel = 0x0010,
0053 IndexChannel = 0x0020,
0054 ReadMaskChannel = 0x0040,
0055 WriteMaskChannel = 0x0080,
0056 MetaChannel = 0x0100,
0057 CompositeMaskChannel = 0x0200,
0058 CompositeChannels = 0x001F,
0059 #if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT)
0060 AllChannels = MagickLLConstant(0x7FFFFFFFFFFFFFFF),
0061 #else
0062 AllChannels = 0X7FFFFFF,
0063 #endif
0064
0065
0066
0067
0068
0069
0070
0071 TrueAlphaChannel = 0x0100,
0072 RGBChannels = 0x0200,
0073 GrayChannels = 0x0400,
0074 SyncChannels = 0x20000,
0075 DefaultChannels = AllChannels
0076 } ChannelType;
0077
0078 typedef enum
0079 {
0080 UndefinedPixelChannel = 0,
0081 RedPixelChannel = 0,
0082 CyanPixelChannel = 0,
0083 GrayPixelChannel = 0,
0084 LPixelChannel = 0,
0085 LabelPixelChannel = 0,
0086 YPixelChannel = 0,
0087 aPixelChannel = 1,
0088 GreenPixelChannel = 1,
0089 MagentaPixelChannel = 1,
0090 CbPixelChannel = 1,
0091 bPixelChannel = 2,
0092 BluePixelChannel = 2,
0093 YellowPixelChannel = 2,
0094 CrPixelChannel = 2,
0095 BlackPixelChannel = 3,
0096 AlphaPixelChannel = 4,
0097 IndexPixelChannel = 5,
0098 ReadMaskPixelChannel = 6,
0099 WriteMaskPixelChannel = 7,
0100 MetaPixelChannel = 8,
0101 CompositeMaskPixelChannel = 9,
0102 MetaPixelChannels = 10,
0103 IntensityPixelChannel = MaxPixelChannels,
0104 CompositePixelChannel = MaxPixelChannels,
0105 SyncPixelChannel = MaxPixelChannels+1
0106 } PixelChannel;
0107
0108 typedef enum
0109 {
0110 UndefinedPixelIntensityMethod = 0,
0111 AveragePixelIntensityMethod,
0112 BrightnessPixelIntensityMethod,
0113 LightnessPixelIntensityMethod,
0114 MSPixelIntensityMethod,
0115 Rec601LumaPixelIntensityMethod,
0116 Rec601LuminancePixelIntensityMethod,
0117 Rec709LumaPixelIntensityMethod,
0118 Rec709LuminancePixelIntensityMethod,
0119 RMSPixelIntensityMethod
0120 } PixelIntensityMethod;
0121
0122 typedef enum
0123 {
0124 UndefinedInterpolatePixel,
0125 AverageInterpolatePixel,
0126 Average9InterpolatePixel,
0127 Average16InterpolatePixel,
0128 BackgroundInterpolatePixel,
0129 BilinearInterpolatePixel,
0130 BlendInterpolatePixel,
0131 CatromInterpolatePixel,
0132 IntegerInterpolatePixel,
0133 MeshInterpolatePixel,
0134 NearestInterpolatePixel,
0135 SplineInterpolatePixel
0136 } PixelInterpolateMethod;
0137
0138 typedef enum
0139 {
0140 UndefinedPixelMask = 0x000000,
0141 ReadPixelMask = 0x000001,
0142 WritePixelMask = 0x000002,
0143 CompositePixelMask = 0x000004
0144 } PixelMask;
0145
0146 typedef enum
0147 {
0148 UndefinedPixelTrait = 0x000000,
0149 CopyPixelTrait = 0x000001,
0150 UpdatePixelTrait = 0x000002,
0151 BlendPixelTrait = 0x000004
0152 } PixelTrait;
0153
0154 typedef enum
0155 {
0156 UndefinedPixel,
0157 CharPixel,
0158 DoublePixel,
0159 FloatPixel,
0160 LongPixel,
0161 LongLongPixel,
0162 QuantumPixel,
0163 ShortPixel
0164 } StorageType;
0165
0166
0167
0168
0169 typedef struct _PixelChannelMap
0170 {
0171 PixelChannel
0172 channel;
0173
0174 PixelTrait
0175 traits;
0176
0177 ssize_t
0178 offset;
0179 } PixelChannelMap;
0180
0181 typedef struct _PixelInfo
0182 {
0183 ClassType
0184 storage_class;
0185
0186 ColorspaceType
0187 colorspace;
0188
0189 PixelTrait
0190 alpha_trait;
0191
0192 double
0193 fuzz;
0194
0195 size_t
0196 depth;
0197
0198 MagickSizeType
0199 count;
0200
0201 MagickRealType
0202 red,
0203 green,
0204 blue,
0205 black,
0206 alpha,
0207 index;
0208 } PixelInfo;
0209
0210 typedef struct _PixelPacket
0211 {
0212 unsigned int
0213 red,
0214 green,
0215 blue,
0216 alpha,
0217 black;
0218 } PixelPacket;
0219
0220 typedef struct _CacheView
0221 CacheView_;
0222
0223
0224
0225
0226 extern MagickExport ChannelType
0227 SetPixelChannelMask(Image *,const ChannelType);
0228
0229 extern MagickExport MagickBooleanType
0230 ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
0231 const size_t,const char *,const StorageType,void *,ExceptionInfo *),
0232 ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
0233 const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
0234 InterpolatePixelChannel(const Image *magick_restrict,const CacheView_ *,
0235 const PixelChannel,const PixelInterpolateMethod,const double,const double,
0236 double *,ExceptionInfo *),
0237 InterpolatePixelChannels(const Image *magick_restrict,const CacheView_ *,
0238 const Image * magick_restrict,const PixelInterpolateMethod,const double,
0239 const double,Quantum *,ExceptionInfo *),
0240 InterpolatePixelInfo(const Image *,const CacheView_ *,
0241 const PixelInterpolateMethod,const double,const double,PixelInfo *,
0242 ExceptionInfo *),
0243 IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
0244 const Quantum *) magick_attribute((__pure__)),
0245 IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *)
0246 magick_attribute((__pure__)),
0247 SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *),
0248 SortImagePixels(Image *,ExceptionInfo *);
0249
0250 extern MagickExport MagickRealType
0251 GetPixelInfoIntensity(const Image *magick_restrict,
0252 const PixelInfo *magick_restrict) magick_hot_spot,
0253 GetPixelIntensity(const Image *magick_restrict,
0254 const Quantum *magick_restrict) magick_hot_spot;
0255
0256 extern MagickExport PixelChannelMap
0257 *AcquirePixelChannelMap(void),
0258 *ClonePixelChannelMap(PixelChannelMap *),
0259 *DestroyPixelChannelMap(PixelChannelMap *);
0260
0261 extern MagickExport PixelInfo
0262 *ClonePixelInfo(const PixelInfo *);
0263
0264 extern MagickExport MagickRealType
0265 DecodePixelGamma(const MagickRealType) magick_hot_spot,
0266 EncodePixelGamma(const MagickRealType) magick_hot_spot;
0267
0268 extern MagickExport void
0269 ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
0270 GetPixelInfo(const Image *,PixelInfo *);
0271
0272 #if defined(__cplusplus) || defined(c_plusplus)
0273 }
0274 #endif
0275
0276 #endif