pixel.h

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

Generated on 12 Jun 2019 for MagickCore by  doxygen 1.6.1