2 Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore image pixel methods.
18 #ifndef _MAGICKCORE_PIXEL_H
19 #define _MAGICKCORE_PIXEL_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #include "MagickCore/colorspace.h"
27 #define MaxPixelChannels 32
32 UndefinedChannel = 0x0000,
36 GreenChannel = 0x0002,
37 MagentaChannel = 0x0002,
39 YellowChannel = 0x0004,
40 BlackChannel = 0x0008,
41 AlphaChannel = 0x0010,
42 OpacityChannel = 0x0010,
43 IndexChannel = 0x0020,
46 CompositeChannels = 0x002F,
47 AllChannels = 0x7ffffff,
49 Special purpose channel types.
50 FUTURE: are these needed any more - they are more like hacks
51 SyncChannels for example is NOT a real channel but a 'flag'
52 It really says -- "User has not defined channels"
54 TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
55 RGBChannels = 0x0200, /* set alpha from grayscale mask in RGB */
56 GrayChannels = 0x0400,
57 SyncChannels = 0x20000, /* channels modified as a single unit */
58 DefaultChannels = ((AllChannels | SyncChannels) &~ AlphaChannel)
59 } ChannelType; /* must correspond to PixelChannel */
63 UndefinedPixelChannel = 0,
70 GreenPixelChannel = 1,
71 MagentaPixelChannel = 1,
75 YellowPixelChannel = 2,
77 BlackPixelChannel = 3,
78 AlphaPixelChannel = 4,
79 IndexPixelChannel = 5,
80 MaskPixelChannel = 6, /* Image Write Mask */
81 MetaPixelChannel = 7, /* ??? */
82 IntensityPixelChannel = MaxPixelChannels, /* what are these ??? */
83 CompositePixelChannel = MaxPixelChannels,
84 SyncPixelChannel = MaxPixelChannels+1
85 } PixelChannel; /* must correspond to ChannelType */
89 UndefinedPixelIntensityMethod = 0,
90 AveragePixelIntensityMethod,
91 BrightnessPixelIntensityMethod,
92 LightnessPixelIntensityMethod,
93 Rec601LumaPixelIntensityMethod,
94 Rec709LumaPixelIntensityMethod,
95 RMSPixelIntensityMethod
96 } PixelIntensityMethod;
100 UndefinedInterpolatePixel,
101 AverageInterpolatePixel, /* Average 4 nearest neighbours */
102 Average9InterpolatePixel, /* Average 9 nearest neighbours */
103 Average16InterpolatePixel, /* Average 16 nearest neighbours */
104 BackgroundInterpolatePixel, /* Just return background color */
105 BilinearInterpolatePixel, /* Triangular filter interpolation */
106 BlendInterpolatePixel, /* blend of nearest 1, 2 or 4 pixels */
107 CatromInterpolatePixel, /* Catmull-Rom interpolation */
108 IntegerInterpolatePixel, /* Integer (floor) interpolation */
109 MeshInterpolatePixel, /* Triangular Mesh interpolation */
110 NearestInterpolatePixel, /* Nearest Neighbour Only */
111 SplineInterpolatePixel /* Cubic Spline (blurred) interpolation */
112 /* FilterInterpolatePixel, ** Use resize filter - (very slow) */
113 } PixelInterpolateMethod;
117 UndefinedPixelTrait = 0x000000,
118 CopyPixelTrait = 0x000001,
119 UpdatePixelTrait = 0x000002,
120 BlendPixelTrait = 0x000004
123 typedef struct _PixelChannelMap
135 typedef struct _PixelInfo
164 typedef struct _PixelPacket
186 typedef struct _CacheView
189 extern MagickExport MagickBooleanType
190 ExportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
191 const size_t,const char *,const StorageType,void *,ExceptionInfo *),
192 ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
193 const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
194 InterpolatePixelChannel(const Image *,const CacheView_ *,
195 const PixelChannel,const PixelInterpolateMethod,const double,const double,
196 double *,ExceptionInfo *),
197 InterpolatePixelChannels(const Image *,const CacheView_ *,const Image *,
198 const PixelInterpolateMethod,const double,const double,Quantum *,
200 InterpolatePixelInfo(const Image *,const CacheView_ *,
201 const PixelInterpolateMethod,const double,const double,PixelInfo *,
203 IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
205 IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
206 SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
208 extern MagickExport MagickRealType
209 GetPixelIntensity(const Image *restrict,const Quantum *restrict)
212 extern MagickExport PixelChannelMap
213 *AcquirePixelChannelMap(void),
214 *ClonePixelChannelMap(PixelChannelMap *),
215 *DestroyPixelChannelMap(PixelChannelMap *);
217 extern MagickExport PixelInfo
218 *ClonePixelInfo(const PixelInfo *);
220 extern MagickExport MagickRealType
221 DecodePixelGamma(const MagickRealType) magick_hot_spot,
222 EncodePixelGamma(const MagickRealType) magick_hot_spot;
224 extern MagickExport void
225 InitializePixelChannelMap(Image *),
226 GetPixelInfo(const Image *,PixelInfo *),
227 SetPixelChannelMask(Image *,const ChannelType);
229 #if defined(__cplusplus) || defined(c_plusplus)