2 Copyright 1999-2012 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 UndefinedInterpolatePixel,
64 AverageInterpolatePixel,
65 BicubicInterpolatePixel,
66 BilinearInterpolatePixel,
67 FilterInterpolatePixel,
68 IntegerInterpolatePixel,
70 NearestNeighborInterpolatePixel,
71 SplineInterpolatePixel
72 } PixelInterpolateMethod;
76 UndefinedPixelChannel = 0,
81 GreenPixelChannel = 1,
82 MagentaPixelChannel = 1,
85 YellowPixelChannel = 2,
87 BlackPixelChannel = 3,
88 AlphaPixelChannel = 4,
89 IndexPixelChannel = 5,
90 MaskPixelChannel = 6, /* Image Write Mask */
91 MetaPixelChannel = 7, /* ??? */
92 IntensityPixelChannel = MaxPixelChannels, /* what are these ??? */
93 CompositePixelChannel = MaxPixelChannels,
94 SyncPixelChannel = MaxPixelChannels+1
95 } PixelChannel; /* must correspond to ChannelType */
99 UndefinedPixelTrait = 0x000000,
100 CopyPixelTrait = 0x000001,
101 UpdatePixelTrait = 0x000002,
102 BlendPixelTrait = 0x000004
105 typedef struct _PixelChannelMap
117 typedef struct _PixelInfo
146 typedef struct _PixelPacket
168 typedef struct _CacheView
171 extern MagickExport ChannelType
172 SetPixelChannelMask(Image *,const ChannelType);
174 extern MagickExport MagickBooleanType
175 ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
176 const size_t,const char *,const StorageType,void *,ExceptionInfo *),
177 ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
178 const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
179 InterpolatePixelChannel(const Image *,const CacheView_ *,
180 const PixelChannel,const PixelInterpolateMethod,const double,const double,
181 double *,ExceptionInfo *),
182 InterpolatePixelChannels(const Image *,const CacheView_ *,const Image *,
183 const PixelInterpolateMethod,const double,const double,Quantum *,
185 InterpolatePixelInfo(const Image *,const CacheView_ *,
186 const PixelInterpolateMethod,const double,const double,PixelInfo *,
188 IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
190 IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
191 SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
193 extern MagickExport PixelChannelMap
194 *AcquirePixelChannelMap(void),
195 *ClonePixelChannelMap(PixelChannelMap *),
196 *DestroyPixelChannelMap(PixelChannelMap *);
198 extern MagickExport PixelInfo
199 *ClonePixelInfo(const PixelInfo *);
201 extern MagickExport void
202 InitializePixelChannelMap(Image *),
203 GetPixelInfo(const Image *,PixelInfo *),
204 SetPixelChannelMapMask(Image *,const ChannelType);
206 #if defined(__cplusplus) || defined(c_plusplus)