]> granicus.if.org Git - imagemagick/blob - MagickCore/pixel.h
Add RobidouxSharp filter depreciate Bessel Filter and Static Gravity
[imagemagick] / MagickCore / pixel.h
1 /*
2   Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
3   dedicated to making software imaging solutions freely available.
4
5   You may not use this file except in compliance with the License.
6   obtain a copy of the License at
7
8     http://www.imagemagick.org/script/license.php
9
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.
15
16   MagickCore image pixel methods.
17 */
18 #ifndef _MAGICKCORE_PIXEL_H
19 #define _MAGICKCORE_PIXEL_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 #include <MagickCore/colorspace.h>
26
27 #define MaxPixelChannels  32
28 #undef index
29
30 typedef enum
31 {
32   UndefinedChannel = 0x0000,
33   RedChannel = 0x0001,
34   GrayChannel = 0x0001,
35   CyanChannel = 0x0001,
36   GreenChannel = 0x0002,
37   MagentaChannel = 0x0002,
38   BlueChannel = 0x0004,
39   YellowChannel = 0x0004,
40   BlackChannel = 0x0008,
41   AlphaChannel = 0x0010,
42   OpacityChannel = 0x0010,
43   IndexChannel = 0x0020,
44   MaskChannel = 0x0040,
45   MetaChannel = 0x0080,
46   CompositeChannels = 0x002F,
47   AllChannels = 0x7ffffff,
48   /*
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"
53   */
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 */
60
61 typedef enum
62 {
63   UndefinedInterpolatePixel,
64   AverageInterpolatePixel,
65   BicubicInterpolatePixel,
66   BilinearInterpolatePixel,
67   FilterInterpolatePixel,
68   IntegerInterpolatePixel,
69   MeshInterpolatePixel,
70   NearestNeighborInterpolatePixel,
71   SplineInterpolatePixel
72 } PixelInterpolateMethod;
73
74 typedef enum
75 {
76   UndefinedPixelChannel = 0,
77   RedPixelChannel = 0,
78   CyanPixelChannel = 0,
79   GrayPixelChannel = 0,
80   YPixelChannel = 0,
81   GreenPixelChannel = 1,
82   MagentaPixelChannel = 1,
83   CbPixelChannel = 1,
84   BluePixelChannel = 2,
85   YellowPixelChannel = 2,
86   CrPixelChannel = 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 */
96
97 typedef enum
98 {
99   UndefinedPixelTrait = 0x000000,
100   CopyPixelTrait = 0x000001,
101   UpdatePixelTrait = 0x000002,
102   BlendPixelTrait = 0x000004
103 } PixelTrait;
104
105 typedef struct _PixelChannelMap
106 {
107   PixelChannel
108     channel;
109
110   PixelTrait
111     traits;
112
113   ssize_t
114     offset;
115 } PixelChannelMap;
116
117 typedef struct _PixelInfo
118 {
119   ClassType
120     storage_class;
121
122   ColorspaceType
123     colorspace;
124
125   MagickBooleanType
126     matte;
127
128   double
129     fuzz;
130
131   size_t
132     depth;
133
134   MagickSizeType
135     count;
136
137   double
138     red,
139     green,
140     blue,
141     black,
142     alpha,
143     index;
144 } PixelInfo;
145
146 typedef struct _PixelPacket
147 {
148   unsigned int
149     red,
150     green,
151     blue,
152     alpha,
153     black;
154 } PixelPacket;
155
156 typedef enum
157 {
158   UndefinedPixel,
159   CharPixel,
160   DoublePixel,
161   FloatPixel,
162   LongPixel,
163   LongLongPixel,
164   QuantumPixel,
165   ShortPixel
166 } StorageType;
167
168 typedef struct _CacheView
169   CacheView_;
170
171 extern MagickExport ChannelType
172   SetPixelChannelMask(Image *,const ChannelType);
173
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 *,
184     ExceptionInfo *),
185   InterpolatePixelInfo(const Image *,const CacheView_ *,
186     const PixelInterpolateMethod,const double,const double,PixelInfo *,
187     ExceptionInfo *),
188   IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
189     const Quantum *),
190   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
191   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
192
193 extern MagickExport PixelChannelMap
194   *AcquirePixelChannelMap(void),
195   *ClonePixelChannelMap(PixelChannelMap *),
196   *DestroyPixelChannelMap(PixelChannelMap *);
197
198 extern MagickExport PixelInfo
199   *ClonePixelInfo(const PixelInfo *);
200
201 extern MagickExport void
202   InitializePixelChannelMap(Image *),
203   GetPixelInfo(const Image *,PixelInfo *),
204   SetPixelChannelMapMask(Image *,const ChannelType);
205
206 #if defined(__cplusplus) || defined(c_plusplus)
207 }
208 #endif
209
210 #endif