pixel.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004 
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007 
00008     https://imagemagick.org/script/license.php
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore image pixel methods.
00017 */
00018 #ifndef MAGICKCORE_PIXEL_H
00019 #define MAGICKCORE_PIXEL_H
00020 
00021 #include "MagickCore/colorspace.h"
00022 
00023 #if defined(__cplusplus) || defined(c_plusplus)
00024 extern "C" {
00025 #endif
00026 
00027 #define MaxPixelChannels  32
00028 #undef index
00029 
00030 /*
00031   Pixel enum declarations.
00032 */
00033 typedef enum
00034 {
00035   UndefinedChannel = 0x0000,
00036   RedChannel = 0x0001,
00037   GrayChannel = 0x0001,
00038   CyanChannel = 0x0001,
00039   LChannel = 0x0001,
00040   GreenChannel = 0x0002,
00041   MagentaChannel = 0x0002,
00042   aChannel = 0x0002,
00043   BlueChannel = 0x0004,
00044   bChannel = 0x0002,
00045   YellowChannel = 0x0004,
00046   BlackChannel = 0x0008,
00047   AlphaChannel = 0x0010,
00048   OpacityChannel = 0x0010,
00049   IndexChannel = 0x0020,             /* Color Index Table? */
00050   ReadMaskChannel = 0x0040,          /* Pixel is Not Readable? */
00051   WriteMaskChannel = 0x0080,         /* Pixel is Write Protected? */
00052   MetaChannel = 0x0100,              /* not used */
00053   CompositeMaskChannel = 0x0200,     /* SVG mask */
00054   CompositeChannels = 0x001F,
00055   AllChannels = 0x7ffffff,
00056   /*
00057     Special purpose channel types.
00058     FUTURE: are these needed any more - they are more like hacks
00059     SyncChannels for example is NOT a real channel but a 'flag'
00060     It really says -- "User has not defined channels"
00061     Though it does have extra meaning in the "-auto-level" operator
00062   */
00063   TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
00064   RGBChannels = 0x0200,      /* set alpha from grayscale mask in RGB */
00065   GrayChannels = 0x0400,
00066   SyncChannels = 0x20000,    /* channels modified as a single unit */
00067   DefaultChannels = AllChannels
00068 } ChannelType;  /* must correspond to PixelChannel */
00069 
00070 typedef enum
00071 {
00072   UndefinedPixelChannel = 0,
00073   RedPixelChannel = 0,
00074   CyanPixelChannel = 0,
00075   GrayPixelChannel = 0,
00076   LPixelChannel = 0,
00077   LabelPixelChannel = 0,
00078   YPixelChannel = 0,
00079   aPixelChannel = 1,
00080   GreenPixelChannel = 1,
00081   MagentaPixelChannel = 1,
00082   CbPixelChannel = 1,
00083   bPixelChannel = 2,
00084   BluePixelChannel = 2,
00085   YellowPixelChannel = 2,
00086   CrPixelChannel = 2,
00087   BlackPixelChannel = 3,
00088   AlphaPixelChannel = 4,
00089   IndexPixelChannel = 5,
00090   ReadMaskPixelChannel = 6,
00091   WriteMaskPixelChannel = 7,
00092   MetaPixelChannel = 8,
00093   CompositeMaskPixelChannel = 9,
00094   IntensityPixelChannel = MaxPixelChannels,  /* ???? */
00095   CompositePixelChannel = MaxPixelChannels,  /* ???? */
00096   SyncPixelChannel = MaxPixelChannels+1      /* not a real channel */
00097 } PixelChannel;  /* must correspond to ChannelType */
00098 
00099 typedef enum
00100 {
00101   UndefinedPixelIntensityMethod = 0,
00102   AveragePixelIntensityMethod,
00103   BrightnessPixelIntensityMethod,
00104   LightnessPixelIntensityMethod,
00105   MSPixelIntensityMethod,
00106   Rec601LumaPixelIntensityMethod,
00107   Rec601LuminancePixelIntensityMethod,
00108   Rec709LumaPixelIntensityMethod,
00109   Rec709LuminancePixelIntensityMethod,
00110   RMSPixelIntensityMethod
00111 } PixelIntensityMethod;
00112 
00113 typedef enum
00114 {
00115   UndefinedInterpolatePixel,
00116   AverageInterpolatePixel,    /* Average 4 nearest neighbours */
00117   Average9InterpolatePixel,   /* Average 9 nearest neighbours */
00118   Average16InterpolatePixel,  /* Average 16 nearest neighbours */
00119   BackgroundInterpolatePixel, /* Just return background color */
00120   BilinearInterpolatePixel,   /* Triangular filter interpolation */
00121   BlendInterpolatePixel,      /* blend of nearest 1, 2 or 4 pixels */
00122   CatromInterpolatePixel,     /* Catmull-Rom interpolation */
00123   IntegerInterpolatePixel,    /* Integer (floor) interpolation */
00124   MeshInterpolatePixel,       /* Triangular Mesh interpolation */
00125   NearestInterpolatePixel,    /* Nearest Neighbour Only */
00126   SplineInterpolatePixel      /* Cubic Spline (blurred) interpolation */
00127 } PixelInterpolateMethod;
00128 
00129 typedef enum
00130 {
00131   UndefinedPixelMask = 0x000000,
00132   ReadPixelMask = 0x000001,
00133   WritePixelMask = 0x000002,
00134   CompositePixelMask = 0x000004
00135 } PixelMask;
00136 
00137 typedef enum
00138 {
00139   UndefinedPixelTrait = 0x000000,
00140   CopyPixelTrait = 0x000001,
00141   UpdatePixelTrait = 0x000002,
00142   BlendPixelTrait = 0x000004
00143 } PixelTrait;
00144 
00145 typedef enum
00146 {
00147   UndefinedPixel,
00148   CharPixel,
00149   DoublePixel,
00150   FloatPixel,
00151   LongPixel,
00152   LongLongPixel,
00153   QuantumPixel,
00154   ShortPixel
00155 } StorageType;
00156 
00157 /*
00158   Pixel typedef declarations.
00159 */
00160 typedef struct _PixelChannelMap
00161 {
00162   PixelChannel
00163     channel;
00164 
00165   PixelTrait
00166     traits;
00167 
00168   ssize_t
00169     offset;
00170 } PixelChannelMap;
00171 
00172 typedef struct _PixelInfo
00173 {
00174   ClassType
00175     storage_class;
00176 
00177   ColorspaceType
00178     colorspace;
00179 
00180   PixelTrait
00181     alpha_trait;
00182 
00183   double
00184     fuzz;
00185 
00186   size_t
00187     depth;
00188 
00189   MagickSizeType
00190     count;
00191 
00192   MagickRealType
00193     red,
00194     green,
00195     blue,
00196     black,
00197     alpha,
00198     index;
00199 } PixelInfo;
00200 
00201 typedef struct _PixelPacket
00202 {
00203   unsigned int
00204     red,
00205     green,
00206     blue,
00207     alpha,
00208     black;
00209 } PixelPacket;
00210 
00211 typedef struct _CacheView
00212   CacheView_;
00213 
00214 /*
00215   Pixel method declarations.
00216 */
00217 extern MagickExport ChannelType
00218   SetPixelChannelMask(Image *,const ChannelType);
00219 
00220 extern MagickExport MagickBooleanType
00221   ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
00222     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
00223   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
00224     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
00225   InterpolatePixelChannel(const Image *magick_restrict,const CacheView_ *,
00226     const PixelChannel,const PixelInterpolateMethod,const double,const double,
00227     double *,ExceptionInfo *),
00228   InterpolatePixelChannels(const Image *magick_restrict,const CacheView_ *,
00229     const Image * magick_restrict,const PixelInterpolateMethod,const double,
00230     const double,Quantum *,ExceptionInfo *),
00231   InterpolatePixelInfo(const Image *,const CacheView_ *,
00232     const PixelInterpolateMethod,const double,const double,PixelInfo *,
00233     ExceptionInfo *),
00234   IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
00235     const Quantum *) magick_attribute((__pure__)),
00236   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *)
00237     magick_attribute((__pure__)),
00238   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
00239 
00240 extern MagickExport MagickRealType
00241   GetPixelInfoIntensity(const Image *magick_restrict,
00242     const PixelInfo *magick_restrict) magick_hot_spot,
00243   GetPixelIntensity(const Image *magick_restrict,
00244     const Quantum *magick_restrict) magick_hot_spot;
00245 
00246 extern MagickExport PixelChannelMap
00247   *AcquirePixelChannelMap(void),
00248   *ClonePixelChannelMap(PixelChannelMap *),
00249   *DestroyPixelChannelMap(PixelChannelMap *);
00250 
00251 extern MagickExport PixelInfo
00252   *ClonePixelInfo(const PixelInfo *);
00253 
00254 extern MagickExport MagickRealType
00255   DecodePixelGamma(const MagickRealType) magick_hot_spot,
00256   EncodePixelGamma(const MagickRealType) magick_hot_spot;
00257 
00258 extern MagickExport void
00259   ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
00260   GetPixelInfo(const Image *,PixelInfo *),
00261   InitializePixelChannelMap(Image *);
00262 
00263 #if defined(__cplusplus) || defined(c_plusplus)
00264 }
00265 #endif
00266 
00267 #endif

Generated on 21 Sep 2020 for MagickCore by  doxygen 1.6.1