00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MAGICKCORE_PIXEL_H
00019 #define MAGICKCORE_PIXEL_H
00020
00021 #include "MagickCore/colorspace.h"
00022
00023 #if defined(__cplusplus) || defined(c_plusplus)
00024 extern "C" {
00025 #endif
00026
00027 #define MaxPixelChannels 32
00028 #undef index
00029
00030
00031
00032
00033 typedef enum
00034 {
00035 UndefinedChannel = 0x0000,
00036 RedChannel = 0x0001,
00037 GrayChannel = 0x0001,
00038 CyanChannel = 0x0001,
00039 GreenChannel = 0x0002,
00040 MagentaChannel = 0x0002,
00041 BlueChannel = 0x0004,
00042 YellowChannel = 0x0004,
00043 BlackChannel = 0x0008,
00044 AlphaChannel = 0x0010,
00045 OpacityChannel = 0x0010,
00046 IndexChannel = 0x0020,
00047 ReadMaskChannel = 0x0040,
00048 WriteMaskChannel = 0x0080,
00049 MetaChannel = 0x0100,
00050 CompositeMaskChannel = 0x0200,
00051 CompositeChannels = 0x001F,
00052 AllChannels = 0x7ffffff,
00053
00054
00055
00056
00057
00058
00059
00060 TrueAlphaChannel = 0x0100,
00061 RGBChannels = 0x0200,
00062 GrayChannels = 0x0400,
00063 SyncChannels = 0x20000,
00064 DefaultChannels = AllChannels
00065 } ChannelType;
00066
00067 typedef enum
00068 {
00069 UndefinedPixelChannel = 0,
00070 RedPixelChannel = 0,
00071 CyanPixelChannel = 0,
00072 GrayPixelChannel = 0,
00073 LPixelChannel = 0,
00074 LabelPixelChannel = 0,
00075 YPixelChannel = 0,
00076 aPixelChannel = 1,
00077 GreenPixelChannel = 1,
00078 MagentaPixelChannel = 1,
00079 CbPixelChannel = 1,
00080 bPixelChannel = 2,
00081 BluePixelChannel = 2,
00082 YellowPixelChannel = 2,
00083 CrPixelChannel = 2,
00084 BlackPixelChannel = 3,
00085 AlphaPixelChannel = 4,
00086 IndexPixelChannel = 5,
00087 ReadMaskPixelChannel = 6,
00088 WriteMaskPixelChannel = 7,
00089 MetaPixelChannel = 8,
00090 CompositeMaskPixelChannel = 9,
00091 IntensityPixelChannel = MaxPixelChannels,
00092 CompositePixelChannel = MaxPixelChannels,
00093 SyncPixelChannel = MaxPixelChannels+1
00094 } PixelChannel;
00095
00096 typedef enum
00097 {
00098 UndefinedPixelIntensityMethod = 0,
00099 AveragePixelIntensityMethod,
00100 BrightnessPixelIntensityMethod,
00101 LightnessPixelIntensityMethod,
00102 MSPixelIntensityMethod,
00103 Rec601LumaPixelIntensityMethod,
00104 Rec601LuminancePixelIntensityMethod,
00105 Rec709LumaPixelIntensityMethod,
00106 Rec709LuminancePixelIntensityMethod,
00107 RMSPixelIntensityMethod
00108 } PixelIntensityMethod;
00109
00110 typedef enum
00111 {
00112 UndefinedInterpolatePixel,
00113 AverageInterpolatePixel,
00114 Average9InterpolatePixel,
00115 Average16InterpolatePixel,
00116 BackgroundInterpolatePixel,
00117 BilinearInterpolatePixel,
00118 BlendInterpolatePixel,
00119 CatromInterpolatePixel,
00120 IntegerInterpolatePixel,
00121 MeshInterpolatePixel,
00122 NearestInterpolatePixel,
00123 SplineInterpolatePixel
00124 } PixelInterpolateMethod;
00125
00126 typedef enum
00127 {
00128 UndefinedPixelMask = 0x000000,
00129 ReadPixelMask = 0x000001,
00130 WritePixelMask = 0x000002,
00131 CompositePixelMask = 0x000004
00132 } PixelMask;
00133
00134 typedef enum
00135 {
00136 UndefinedPixelTrait = 0x000000,
00137 CopyPixelTrait = 0x000001,
00138 UpdatePixelTrait = 0x000002,
00139 BlendPixelTrait = 0x000004
00140 } PixelTrait;
00141
00142 typedef enum
00143 {
00144 UndefinedPixel,
00145 CharPixel,
00146 DoublePixel,
00147 FloatPixel,
00148 LongPixel,
00149 LongLongPixel,
00150 QuantumPixel,
00151 ShortPixel
00152 } StorageType;
00153
00154
00155
00156
00157 typedef struct _PixelChannelMap
00158 {
00159 PixelChannel
00160 channel;
00161
00162 PixelTrait
00163 traits;
00164
00165 ssize_t
00166 offset;
00167 } PixelChannelMap;
00168
00169 typedef struct _PixelInfo
00170 {
00171 ClassType
00172 storage_class;
00173
00174 ColorspaceType
00175 colorspace;
00176
00177 PixelTrait
00178 alpha_trait;
00179
00180 double
00181 fuzz;
00182
00183 size_t
00184 depth;
00185
00186 MagickSizeType
00187 count;
00188
00189 MagickRealType
00190 red,
00191 green,
00192 blue,
00193 black,
00194 alpha,
00195 index;
00196 } PixelInfo;
00197
00198 typedef struct _PixelPacket
00199 {
00200 unsigned int
00201 red,
00202 green,
00203 blue,
00204 alpha,
00205 black;
00206 } PixelPacket;
00207
00208 typedef struct _CacheView
00209 CacheView_;
00210
00211
00212
00213
00214 extern MagickExport ChannelType
00215 SetPixelChannelMask(Image *,const ChannelType);
00216
00217 extern MagickExport MagickBooleanType
00218 ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
00219 const size_t,const char *,const StorageType,void *,ExceptionInfo *),
00220 ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
00221 const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
00222 InterpolatePixelChannel(const Image *magick_restrict,const CacheView_ *,
00223 const PixelChannel,const PixelInterpolateMethod,const double,const double,
00224 double *,ExceptionInfo *),
00225 InterpolatePixelChannels(const Image *magick_restrict,const CacheView_ *,
00226 const Image * magick_restrict,const PixelInterpolateMethod,const double,
00227 const double,Quantum *,ExceptionInfo *),
00228 InterpolatePixelInfo(const Image *,const CacheView_ *,
00229 const PixelInterpolateMethod,const double,const double,PixelInfo *,
00230 ExceptionInfo *),
00231 IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
00232 const Quantum *) magick_attribute((__pure__)),
00233 IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *)
00234 magick_attribute((__pure__)),
00235 SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
00236
00237 extern MagickExport MagickRealType
00238 GetPixelInfoIntensity(const Image *magick_restrict,
00239 const PixelInfo *magick_restrict) magick_hot_spot,
00240 GetPixelIntensity(const Image *magick_restrict,
00241 const Quantum *magick_restrict) magick_hot_spot;
00242
00243 extern MagickExport PixelChannelMap
00244 *AcquirePixelChannelMap(void),
00245 *ClonePixelChannelMap(PixelChannelMap *),
00246 *DestroyPixelChannelMap(PixelChannelMap *);
00247
00248 extern MagickExport PixelInfo
00249 *ClonePixelInfo(const PixelInfo *);
00250
00251 extern MagickExport MagickRealType
00252 DecodePixelGamma(const MagickRealType) magick_hot_spot,
00253 EncodePixelGamma(const MagickRealType) magick_hot_spot;
00254
00255 extern MagickExport void
00256 ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
00257 GetPixelInfo(const Image *,PixelInfo *),
00258 InitializePixelChannelMap(Image *);
00259
00260 #if defined(__cplusplus) || defined(c_plusplus)
00261 }
00262 #endif
00263
00264 #endif