]> 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   CompositePixelChannel = MaxPixelChannels,
62   SyncPixelChannel = MaxPixelChannels+1
63 } PixelChannel;
64
65 typedef enum
66 {
67   UndefinedPixelTrait = 0x000000,
68   CopyPixelTrait = 0x000001,
69   UpdatePixelTrait = 0x000002,
70   BlendPixelTrait = 0x000004
71 } PixelTrait;
72
73 typedef struct _PixelChannelMap
74 {
75   PixelChannel
76     channel;
77
78   PixelTrait
79     traits;
80 } PixelChannelMap;
81
82 typedef struct _PixelInfo
83 {
84   ClassType
85     storage_class;
86
87   ColorspaceType
88     colorspace;
89
90   MagickBooleanType
91     matte;
92
93   double
94     fuzz;
95
96   size_t
97     depth;
98
99   MagickSizeType
100     count;
101
102   double
103     red,
104     green,
105     blue,
106     black,
107     alpha,
108     index;
109 } PixelInfo;
110
111 typedef struct _PixelPacket
112 {
113   unsigned int
114     red,
115     green,
116     blue,
117     alpha,
118     black;
119 } PixelPacket;
120
121 typedef struct _CacheView
122   CacheView_;
123
124 extern MagickExport ChannelType
125   SetPixelChannelMask(Image *,const ChannelType);
126
127 extern MagickExport MagickBooleanType
128   ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
129     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
130   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
131     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
132   InterpolatePixelChannel(const Image *,const CacheView_ *,
133     const PixelChannel,const PixelInterpolateMethod,const double,const double,
134     double *,ExceptionInfo *),
135   InterpolatePixelChannels(const Image *,const CacheView_ *,const Image *,
136     const PixelInterpolateMethod,const double,const double,Quantum *,
137     ExceptionInfo *),
138   InterpolatePixelInfo(const Image *,const CacheView_ *,
139     const PixelInterpolateMethod,const double,const double,PixelInfo *,
140     ExceptionInfo *),
141   IsFuzzyEquivalencePixel(const Image *,const Quantum *,
142     const Quantum *),
143   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *);
144
145 extern MagickExport PixelChannelMap
146   *AcquirePixelChannelMap(void),
147   *ClonePixelChannelMap(PixelChannelMap *),
148   *DestroyPixelChannelMap(PixelChannelMap *);
149
150 extern MagickExport PixelInfo
151   *ClonePixelInfo(const PixelInfo *);
152
153 extern MagickExport void
154   InitializePixelChannelMap(Image *),
155   GetPixelInfo(const Image *,PixelInfo *),
156   SetPixelChannelMap(Image *,const ChannelType);
157
158 #if defined(__cplusplus) || defined(c_plusplus)
159 }
160 #endif
161
162 #endif