]> granicus.if.org Git - imagemagick/blob - MagickCore/pixel.h
(no commit message)
[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 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   UndefinedPixelChannel = 0,
47   RedPixelChannel = 0,
48   CyanPixelChannel = 0,
49   GrayPixelChannel = 0,
50   YPixelChannel = 0,
51   GreenPixelChannel = 1,
52   MagentaPixelChannel = 1,
53   CbPixelChannel = 1,
54   BluePixelChannel = 2,
55   YellowPixelChannel = 2,
56   CrPixelChannel = 2,
57   BlackPixelChannel = 3,
58   AlphaPixelChannel = 4,
59   IndexPixelChannel = 5,
60   MaskPixelChannel = 6,
61   MetaPixelChannel = 7,
62   IntensityPixelChannel = MaxPixelChannels,
63   CompositePixelChannel = MaxPixelChannels,
64   SyncPixelChannel = MaxPixelChannels+1
65 } PixelChannel;
66
67 typedef enum
68 {
69   UndefinedPixelTrait = 0x000000,
70   CopyPixelTrait = 0x000001,
71   UpdatePixelTrait = 0x000002,
72   BlendPixelTrait = 0x000004
73 } PixelTrait;
74
75 typedef struct _PixelChannelMap
76 {
77   PixelChannel
78     channel;
79
80   PixelTrait
81     traits;
82
83   ssize_t
84     offset;
85 } PixelChannelMap;
86
87 typedef struct _PixelInfo
88 {
89   ClassType
90     storage_class;
91
92   ColorspaceType
93     colorspace;
94
95   MagickBooleanType
96     matte;
97
98   double
99     fuzz;
100
101   size_t
102     depth;
103
104   MagickSizeType
105     count;
106
107   double
108     red,
109     green,
110     blue,
111     black,
112     alpha,
113     index;
114 } PixelInfo;
115
116 typedef struct _PixelPacket
117 {
118   unsigned int
119     red,
120     green,
121     blue,
122     alpha,
123     black;
124 } PixelPacket;
125
126 typedef struct _CacheView
127   CacheView_;
128
129 extern MagickExport ChannelType
130   SetPixelChannelMask(Image *,const ChannelType);
131
132 extern MagickExport MagickBooleanType
133   ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
134     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
135   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
136     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
137   InterpolatePixelChannel(const Image *,const CacheView_ *,
138     const PixelChannel,const PixelInterpolateMethod,const double,const double,
139     double *,ExceptionInfo *),
140   InterpolatePixelChannels(const Image *,const CacheView_ *,const Image *,
141     const PixelInterpolateMethod,const double,const double,Quantum *,
142     ExceptionInfo *),
143   InterpolatePixelInfo(const Image *,const CacheView_ *,
144     const PixelInterpolateMethod,const double,const double,PixelInfo *,
145     ExceptionInfo *),
146   IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
147     const Quantum *),
148   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *);
149
150 extern MagickExport PixelChannelMap
151   *AcquirePixelChannelMap(void),
152   *ClonePixelChannelMap(PixelChannelMap *),
153   *DestroyPixelChannelMap(PixelChannelMap *);
154
155 extern MagickExport PixelInfo
156   *ClonePixelInfo(const PixelInfo *);
157
158 extern MagickExport void
159   InitializePixelChannelMap(Image *),
160   GetPixelInfo(const Image *,PixelInfo *),
161   SetPixelChannelMapMask(Image *,const ChannelType);
162
163 #if defined(__cplusplus) || defined(c_plusplus)
164 }
165 #endif
166
167 #endif