2 Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
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.
16 MagickCore image constitute methods.
18 #ifndef _MAGICKCORE_PIXEL_H
19 #define _MAGICKCORE_PIXEL_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #include <magick/colorspace.h>
26 #include <magick/constitute.h>
28 #define ClampRedPixelComponent(p) ClampToQuantum((p)->red)
29 #define ClampGreenPixelComponent(p) ClampToQuantum((p)->green)
30 #define ClampBluePixelComponent(p) ClampToQuantum((p)->blue)
31 #define ClampOpacityPixelComponent(p) ClampToQuantum((p)->opacity)
32 #define ClampIndexPixelComponent(p) ClampToQuantum((p)->index)
34 #define GetRedPixelComponent(p) ((p)->red)
35 #define GetGreenPixelComponent(p) ((p)->green)
36 #define GetBluePixelComponent(p) ((p)->blue)
37 #define GetOpacityPixelComponent(p) ((p)->opacity)
38 #define GetAlphaPixelComponent(p) (QuantumRange-(p)->opacity)
39 #define GetIndexPixelComponent(p) ((p)->index)
41 #define SetRedPixelComponent(q,component) ((q)->red=(component))
42 #define SetGreenPixelComponent(q,component) ((q)->green=(component))
43 #define SetBluePixelComponent(q,component) ((q)->blue=(component))
44 #define SetOpacityPixelComponent(q,component) ((q)->opacity=(component))
45 #define SetAlphaPixelComponent(q,component) \
46 ((q)->opacity=(QuantumRange-(component)))
47 #define SetIndexPixelComponent(q,component) ((q)->index=(component))
49 #define GetGrayPixelComponent(p) ((p)->red)
50 #define SetGrayPixelComponent(q,component) \
51 ((q)->red=(q)->green=(q)->blue=(component))
53 #define GetYPixelComponent(p) ((p)->red)
54 #define GetCbPixelComponent(p) ((p)->green)
55 #define GetCrPixelComponent(p) ((p)->blue)
57 #define SetYPixelComponent(q,component) ((q)->red=(component))
58 #define SetCbPixelComponent(q,component) ((q)->green=(component))
59 #define SetCrPixelComponent(q,component) ((q)->blue=(component))
61 #define GetCyanPixelComponent(p) ((p)->red)
62 #define GetMagentaPixelComponent(p) ((p)->green)
63 #define GetYellowPixelComponent(p) ((p)->blue)
64 #define GetBlackPixelComponent(p) ((p)->opacity)
66 #define SetCyanPixelComponent(q,component) ((q)->red=(component))
67 #define SetMagentaPixelComponent(q,component) ((q)->green=(component))
68 #define SetYellowPixelComponent(q,component) ((q)->blue=(component))
69 #define SetBlackPixelComponent(q,component) ((q)->opacity=(component))
71 typedef struct _DoublePixelPacket
81 typedef struct _LongPixelPacket
91 typedef struct _MagickPixelPacket
116 typedef Quantum IndexPacket;
118 typedef struct _PixelPacket
120 #if defined(MAGICKCORE_WORDS_BIGENDIAN)
121 #define MAGICK_PIXEL_RGBA 1
128 #define MAGICK_PIXEL_BGRA 1
137 extern MagickExport MagickBooleanType
138 ExportImagePixels(const Image *,const long,const long,const unsigned long,
139 const unsigned long,const char *,const StorageType,void *,ExceptionInfo *),
140 ImportImagePixels(Image *,const long,const long,const unsigned long,
141 const unsigned long,const char *,const StorageType,const void *);
143 extern MagickExport void
144 GetMagickPixelPacket(const Image *,MagickPixelPacket *);
146 #if defined(__cplusplus) || defined(c_plusplus)