]> granicus.if.org Git - imagemagick/blob - MagickCore/pixel.h
(no commit message)
[imagemagick] / MagickCore / pixel.h
1 /*
2   Copyright 1999-2011 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 constitute 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 #include <MagickCore/constitute.h>
27
28 #define MaxPixelChannels  32
29 #undef index
30
31 typedef enum
32 {
33   UndefinedInterpolatePixel,
34   AverageInterpolatePixel,
35   BicubicInterpolatePixel,
36   BilinearInterpolatePixel,
37   FilterInterpolatePixel,
38   IntegerInterpolatePixel,
39   MeshInterpolatePixel,
40   NearestNeighborInterpolatePixel,
41   SplineInterpolatePixel
42 } PixelInterpolateMethod;
43
44 typedef enum
45 {
46   RedPixelChannel = 0,
47   CyanPixelChannel = 0,
48   GrayPixelChannel = 0,
49   YPixelChannel = 0,
50   GreenPixelChannel = 1,
51   MagentaPixelChannel = 1,
52   CbPixelChannel = 1,
53   BluePixelChannel = 2,
54   YellowPixelChannel = 2,
55   CrPixelChannel = 2,
56   AlphaPixelChannel = 3,
57   BlackPixelChannel = 4,
58   IndexPixelChannel = 4,
59   MaskPixelChannel = 5,
60   IntensityPixelChannel = MaxPixelChannels,
61   SyncPixelChannel = MaxPixelChannels+1
62 } PixelChannel;
63
64 typedef enum
65 {
66   UndefinedPixelTrait = 0x000000,
67   CopyPixelTrait = 0x000001,
68   UpdatePixelTrait = 0x000002,
69   BlendPixelTrait = 0x000004
70 } PixelTrait;
71
72 typedef struct _PixelChannelMap
73 {
74   PixelChannel
75     channel;
76
77   PixelTrait
78     traits;
79 } PixelChannelMap;
80
81 typedef struct _PixelDoublePacket
82 {
83   double
84     red,
85     green,
86     blue,
87     alpha,
88     black;
89 } PixelDoublePacket;
90
91 typedef struct _PixelInfo
92 {
93   ClassType
94     storage_class;
95
96   ColorspaceType
97     colorspace;
98
99   MagickBooleanType
100     matte;
101
102   double
103     fuzz;
104
105   size_t
106     depth;
107
108   MagickSizeType
109     count;
110
111   double
112     red,
113     green,
114     blue,
115     black,
116     alpha,
117     index;
118 } PixelInfo;
119
120 typedef struct _PixelLongPacket
121 {
122   unsigned int
123     red,
124     green,
125     blue,
126     alpha,
127     black;
128 } PixelLongPacket;
129
130 typedef struct _PixelPacket
131 {
132   ClassType
133     storage_class;
134
135   ColorspaceType
136     colorspace;
137
138   MagickBooleanType
139     matte;
140
141   double
142     fuzz;
143
144   size_t
145     depth;
146
147   MagickSizeType
148     count;
149
150   double
151     red,
152     green,
153     blue,
154     black,
155     alpha,
156     index;
157 } PixelPacket;
158
159 typedef struct _CacheView
160   CacheView_;
161
162 extern MagickExport ChannelType
163   SetPixelChannelMask(Image *,const ChannelType);
164
165 extern MagickExport MagickBooleanType
166   ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
167     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
168   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
169     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
170   InterpolatePixelChannel(const Image *,const CacheView_ *,
171     const PixelChannel,const PixelInterpolateMethod,const double,const double,
172     double *,ExceptionInfo *),
173   InterpolatePixelChannels(const Image *,const CacheView_ *,const Image *,
174     const PixelInterpolateMethod,const double,const double,Quantum *,
175     ExceptionInfo *),
176   InterpolatePixelInfo(const Image *,const CacheView_ *,
177     const PixelInterpolateMethod,const double,const double,PixelInfo *,
178     ExceptionInfo *),
179   IsFuzzyEquivalencePixel(const Image *,const Quantum *,
180     const Quantum *),
181   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
182   IsFuzzyEquivalencePixelPacket(const Image *,const PixelPacket *,
183     const PixelPacket *);
184
185 extern MagickExport PixelChannelMap
186   *AcquirePixelChannelMap(void),
187   *ClonePixelChannelMap(PixelChannelMap *),
188   *DestroyPixelChannelMap(PixelChannelMap *);
189
190 extern MagickExport PixelInfo
191   *ClonePixelInfo(const PixelInfo *);
192
193 extern MagickExport void
194   InitializePixelChannelMap(Image *),
195   GetPixelInfo(const Image *,PixelInfo *),
196   SetPixelChannelMap(Image *,const ChannelType);
197
198 #if defined(__cplusplus) || defined(c_plusplus)
199 }
200 #endif
201
202 #endif