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