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