MagickCore 6.9.13
Loading...
Searching...
No Matches
pixel.h
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 constitute methods.
17*/
18#ifndef MAGICKCORE_PIXEL_H
19#define MAGICKCORE_PIXEL_H
20
21#include "magick/colorspace.h"
22#include "magick/constitute.h"
23
24#if defined(__cplusplus) || defined(c_plusplus)
25extern "C" {
26#endif
27
28/*
29 Pixel enum declarations.
30*/
31typedef enum
32{
33 UndefinedInterpolatePixel,
34 AverageInterpolatePixel, /* Average 4 nearest neighbours */
35 BicubicInterpolatePixel, /* Catmull-Rom interpolation */
36 BilinearInterpolatePixel, /* Triangular filter interpolation */
37 FilterInterpolatePixel, /* Use resize filter - (very slow) */
38 IntegerInterpolatePixel, /* Integer (floor) interpolation */
39 MeshInterpolatePixel, /* Triangular mesh interpolation */
40 NearestNeighborInterpolatePixel, /* Nearest neighbour only */
41 SplineInterpolatePixel, /* Cubic Spline (blurred) interpolation */
42 Average9InterpolatePixel, /* Average 9 nearest neighbours */
43 Average16InterpolatePixel, /* Average 16 nearest neighbours */
44 BlendInterpolatePixel, /* blend of nearest 1, 2 or 4 pixels */
45 BackgroundInterpolatePixel, /* just return background color */
46 CatromInterpolatePixel /* Catmull-Rom interpolation */
47} InterpolatePixelMethod;
48
49typedef enum
50{
51 PixelRed = 0,
52 PixelCyan = 0,
53 PixelGray = 0,
54 PixelY = 0,
55 PixelGreen = 1,
56 PixelMagenta = 1,
57 PixelCb = 1,
58 PixelBlue = 2,
59 PixelYellow = 2,
60 PixelCr = 2,
61 PixelAlpha = 3,
62 PixelBlack = 4,
63 PixelIndex = 4,
64 MaskPixelComponent = 5
65} PixelComponent;
66
67typedef enum
68{
69 UndefinedPixelIntensityMethod = 0,
70 AveragePixelIntensityMethod,
71 BrightnessPixelIntensityMethod,
72 LightnessPixelIntensityMethod,
73 Rec601LumaPixelIntensityMethod,
74 Rec601LuminancePixelIntensityMethod,
75 Rec709LumaPixelIntensityMethod,
76 Rec709LuminancePixelIntensityMethod,
77 RMSPixelIntensityMethod,
78 MSPixelIntensityMethod
79} PixelIntensityMethod;
80
81/*
82 Pixel typedef declarations.
83*/
84typedef struct _DoublePixelPacket
85{
86 double
87 red,
88 green,
89 blue,
90 opacity,
91 index;
93
94typedef struct _LongPixelPacket
95{
96 unsigned int
97 red,
98 green,
99 blue,
100 opacity,
101 index;
103
104typedef struct _MagickPixelPacket
105{
106 ClassType
107 storage_class;
108
109 ColorspaceType
110 colorspace;
111
112 MagickBooleanType
113 matte;
114
115 double
116 fuzz;
117
118 size_t
119 depth;
120
121 MagickRealType
122 red,
123 green,
124 blue,
125 opacity,
126 index;
128
129typedef Quantum IndexPacket;
130
131typedef struct _PixelPacket
132{
133#if defined(MAGICKCORE_WORDS_BIGENDIAN)
134#define MAGICK_PIXEL_RGBA 1
135 Quantum
136 red,
137 green,
138 blue,
139 opacity;
140#else
141#define MAGICK_PIXEL_BGRA 1
142 Quantum
143 blue,
144 green,
145 red,
146 opacity;
147#endif
149
151{
152 Quantum
153 red,
154 green,
155 blue,
156 opacity,
157 index;
159
160typedef struct _CacheView
162
163/*
164 Pixel method declarations.
165*/
166extern MagickExport MagickBooleanType
167 ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
168 const size_t,const char *,const StorageType,void *,ExceptionInfo *),
169 ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
170 const size_t,const char *,const StorageType,const void *),
171 InterpolateMagickPixelPacket(const Image *magick_restrict,const CacheView_ *,
172 const InterpolatePixelMethod,const double,const double,MagickPixelPacket *,
173 ExceptionInfo *);
174
175extern MagickExport MagickPixelPacket
176 *CloneMagickPixelPacket(const MagickPixelPacket *);
177
178extern MagickExport MagickRealType
179 DecodePixelGamma(const MagickRealType) magick_hot_spot,
180 EncodePixelGamma(const MagickRealType) magick_hot_spot,
181 GetMagickPixelIntensity(const Image *image,
182 const MagickPixelPacket *magick_restrict) magick_hot_spot,
183 GetPixelIntensity(const Image *image,const PixelPacket *magick_restrict)
184 magick_hot_spot;
185
186extern MagickExport void
187 ConformMagickPixelPacket(Image *,const MagickPixelPacket *,
189 GetMagickPixelPacket(const Image *,MagickPixelPacket *);
190
191#if defined(__cplusplus) || defined(c_plusplus)
192}
193#endif
194
195#endif