MagickCore  7.1.0
Convert, Edit, Or Compose Bitmap Images
pixel.h
Go to the documentation of this file.
1 /*
2  Copyright @ 1999 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. You may
6  obtain a copy of the License at
7 
8  https://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 pixel methods.
17 */
18 #ifndef MAGICKCORE_PIXEL_H
19 #define MAGICKCORE_PIXEL_H
20 
21 #include "MagickCore/colorspace.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 #define MaxPixelChannels 64
28 #undef index
29 
30 /*
31  Pixel enum declarations.
32 */
33 typedef enum
34 {
35  UndefinedChannel = 0x0000,
36  RedChannel = 0x0001,
37  GrayChannel = 0x0001,
38  CyanChannel = 0x0001,
39  LChannel = 0x0001,
40  GreenChannel = 0x0002,
41  MagentaChannel = 0x0002,
42  aChannel = 0x0002,
43  BlueChannel = 0x0004,
44  bChannel = 0x0002,
45  YellowChannel = 0x0004,
46  BlackChannel = 0x0008,
47  AlphaChannel = 0x0010,
48  OpacityChannel = 0x0010,
49  IndexChannel = 0x0020, /* Color Index Table? */
50  ReadMaskChannel = 0x0040, /* Pixel is Not Readable? */
51  WriteMaskChannel = 0x0080, /* Pixel is Write Protected? */
52  MetaChannel = 0x0100, /* not used */
53  CompositeMaskChannel = 0x0200, /* SVG mask */
55  AllChannels = 0x7ffffff,
56  /*
57  Special purpose channel types.
58  FUTURE: are these needed any more - they are more like hacks
59  SyncChannels for example is NOT a real channel but a 'flag'
60  It really says -- "User has not defined channels"
61  Though it does have extra meaning in the "-auto-level" operator
62  */
63  TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
64  RGBChannels = 0x0200, /* set alpha from grayscale mask in RGB */
65  GrayChannels = 0x0400,
66  SyncChannels = 0x20000, /* channels modified as a single unit */
68 } ChannelType; /* must correspond to PixelChannel */
69 
70 typedef enum
71 {
97  SyncPixelChannel = MaxPixelChannels+1 /* not a real channel */
98 } PixelChannel; /* must correspond to ChannelType */
99 
100 typedef enum
101 {
113 
114 typedef enum
115 {
117  AverageInterpolatePixel, /* Average 4 nearest neighbours */
118  Average9InterpolatePixel, /* Average 9 nearest neighbours */
119  Average16InterpolatePixel, /* Average 16 nearest neighbours */
120  BackgroundInterpolatePixel, /* Just return background color */
121  BilinearInterpolatePixel, /* Triangular filter interpolation */
122  BlendInterpolatePixel, /* blend of nearest 1, 2 or 4 pixels */
123  CatromInterpolatePixel, /* Catmull-Rom interpolation */
124  IntegerInterpolatePixel, /* Integer (floor) interpolation */
125  MeshInterpolatePixel, /* Triangular Mesh interpolation */
126  NearestInterpolatePixel, /* Nearest Neighbour Only */
127  SplineInterpolatePixel /* Cubic Spline (blurred) interpolation */
129 
130 typedef enum
131 {
132  UndefinedPixelMask = 0x000000,
133  ReadPixelMask = 0x000001,
134  WritePixelMask = 0x000002,
136 } PixelMask;
137 
138 typedef enum
139 {
141  CopyPixelTrait = 0x000001,
142  UpdatePixelTrait = 0x000002,
143  BlendPixelTrait = 0x000004
144 } PixelTrait;
145 
146 typedef enum
147 {
156 } StorageType;
157 
158 /*
159  Pixel typedef declarations.
160 */
161 typedef struct _PixelChannelMap
162 {
165 
166  PixelTrait
168 
169  ssize_t
172 
173 typedef struct _PixelInfo
174 {
175  ClassType
177 
180 
181  PixelTrait
183 
184  double
186 
187  size_t
189 
192 
195  green,
196  blue,
197  black,
198  alpha,
199  index;
200 } PixelInfo;
201 
202 typedef struct _PixelPacket
203 {
204  unsigned int
206  green,
207  blue,
208  alpha,
209  black;
210 } PixelPacket;
211 
212 typedef struct _CacheView
213  CacheView_;
214 
215 /*
216  Pixel method declarations.
217 */
220 
222  ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
223  const size_t,const char *,const StorageType,void *,ExceptionInfo *),
224  ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
225  const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
227  const PixelChannel,const PixelInterpolateMethod,const double,const double,
228  double *,ExceptionInfo *),
230  const Image * magick_restrict,const PixelInterpolateMethod,const double,
231  const double,Quantum *,ExceptionInfo *),
232  InterpolatePixelInfo(const Image *,const CacheView_ *,
233  const PixelInterpolateMethod,const double,const double,PixelInfo *,
234  ExceptionInfo *),
235  IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
236  const Quantum *) magick_attribute((__pure__)),
238  magick_attribute((__pure__)),
239  SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *),
241 
247 
249  *AcquirePixelChannelMap(void),
252 
253 extern MagickExport PixelInfo
254  *ClonePixelInfo(const PixelInfo *);
255 
259 
260 extern MagickExport void
262  GetPixelInfo(const Image *,PixelInfo *),
264 
265 #if defined(__cplusplus) || defined(c_plusplus)
266 }
267 #endif
268 
269 #endif
PixelChannel channel
Definition: pixel.h:164
#define magick_restrict
Definition: MagickCore.h:41
MagickExport MagickBooleanType InterpolatePixelChannel(const Image *magick_restrict, const CacheView_ *, const PixelChannel, const PixelInterpolateMethod, const double, const double, double *, ExceptionInfo *)
MagickDoubleType MagickRealType
Definition: magick-type.h:124
double fuzz
Definition: pixel.h:185
unsigned int green
Definition: pixel.h:205
PixelTrait alpha_trait
Definition: pixel.h:182
MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *, const Quantum *, const Image *, const Quantum *) magick_attribute((__pure__))
PixelInterpolateMethod
Definition: pixel.h:114
MagickExport MagickBooleanType ImportImagePixels(Image *, const ssize_t, const ssize_t, const size_t, const size_t, const char *, const StorageType, const void *, ExceptionInfo *)
MagickExport MagickRealType GetPixelIntensity(const Image *magick_restrict, const Quantum *magick_restrict) magick_hot_spot
StorageType
Definition: pixel.h:146
PixelIntensityMethod
Definition: pixel.h:100
MagickRealType red
Definition: pixel.h:194
ClassType storage_class
Definition: pixel.h:176
MagickSizeType count
Definition: pixel.h:191
unsigned int blue
Definition: pixel.h:205
Definition: pixel.h:44
MagickRealType alpha
Definition: pixel.h:194
MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *, const PixelInfo *) magick_attribute((__pure__))
ssize_t offset
Definition: pixel.h:170
Definition: image.h:151
#define magick_attribute(x)
MagickExport MagickRealType DecodePixelGamma(const MagickRealType) magick_hot_spot
MagickBooleanType
Definition: magick-type.h:161
ClassType
Definition: magick-type.h:154
unsigned int black
Definition: pixel.h:205
struct _PixelInfo PixelInfo
#define magick_hot_spot
MagickExport PixelChannelMap * DestroyPixelChannelMap(PixelChannelMap *)
Definition: pixel.c:350
struct _PixelChannelMap PixelChannelMap
size_t MagickSizeType
Definition: magick-type.h:134
MagickRealType blue
Definition: pixel.h:194
unsigned int alpha
Definition: pixel.h:205
ChannelType
Definition: pixel.h:33
MagickExport void ConformPixelInfo(Image *, const PixelInfo *, PixelInfo *, ExceptionInfo *)
PixelChannel
Definition: pixel.h:70
size_t depth
Definition: pixel.h:188
MagickRealType index
Definition: pixel.h:194
MagickExport MagickBooleanType InterpolatePixelInfo(const Image *, const CacheView_ *, const PixelInterpolateMethod, const double, const double, PixelInfo *, ExceptionInfo *)
struct _PixelPacket PixelPacket
unsigned short Quantum
Definition: magick-type.h:86
unsigned int red
Definition: pixel.h:205
MagickRealType black
Definition: pixel.h:194
Definition: pixel.h:42
Definition: pixel.h:39
ColorspaceType
Definition: colorspace.h:25
#define MaxPixelChannels
Definition: pixel.h:27
MagickExport PixelChannelMap * AcquirePixelChannelMap(void)
MagickExport void GetPixelInfo(const Image *, PixelInfo *)
MagickExport void InitializePixelChannelMap(Image *)
Definition: pixel.c:4334
MagickRealType green
Definition: pixel.h:194
MagickExport MagickBooleanType SortImagePixels(Image *, ExceptionInfo *)
Definition: pixel.c:6397
MagickExport MagickRealType GetPixelInfoIntensity(const Image *magick_restrict, const PixelInfo *magick_restrict) magick_hot_spot
#define MagickExport
PixelTrait traits
Definition: pixel.h:167
ColorspaceType colorspace
Definition: pixel.h:179
PixelMask
Definition: pixel.h:130
MagickExport MagickBooleanType InterpolatePixelChannels(const Image *magick_restrict, const CacheView_ *, const Image *magick_restrict, const PixelInterpolateMethod, const double, const double, Quantum *, ExceptionInfo *)
PixelTrait
Definition: pixel.h:138
MagickExport ChannelType SetPixelChannelMask(Image *, const ChannelType)
Definition: pixel.c:6279
MagickExport MagickBooleanType SetPixelMetaChannels(Image *, const size_t, ExceptionInfo *)
MagickExport MagickBooleanType ExportImagePixels(const Image *, const ssize_t, const ssize_t, const size_t, const size_t, const char *, const StorageType, void *, ExceptionInfo *)
MagickExport PixelChannelMap * ClonePixelChannelMap(PixelChannelMap *)
MagickExport PixelInfo * ClonePixelInfo(const PixelInfo *)
Definition: pixel.c:170
MagickExport MagickRealType EncodePixelGamma(const MagickRealType) magick_hot_spot
Definition: pixel.c:446