Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:44

0001 /*
0002   Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
0003   dedicated to making software imaging solutions freely available.
0004 
0005   You may not use this file except in compliance with the License.  You may
0006   obtain a copy of the License at
0007 
0008     https://imagemagick.org/script/license.php
0009 
0010   Unless required by applicable law or agreed to in writing, software
0011   distributed under the License is distributed on an "AS IS" BASIS,
0012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013   See the License for the specific language governing permissions and
0014   limitations under the License.
0015 
0016   MagickCore image pixel methods.
0017 */
0018 #ifndef MAGICKCORE_PIXEL_H
0019 #define MAGICKCORE_PIXEL_H
0020 
0021 #include "MagickCore/colorspace.h"
0022 
0023 #if defined(__cplusplus) || defined(c_plusplus)
0024 extern "C" {
0025 #endif
0026 
0027 #define MaxPixelChannels  64
0028 #undef index
0029 
0030 /*
0031   Pixel enum declarations.
0032 */
0033 typedef enum
0034 {
0035   UndefinedChannel = 0x0000,
0036   RedChannel = 0x0001,
0037   GrayChannel = 0x0001,
0038   CyanChannel = 0x0001,
0039   LChannel = 0x0001,
0040   GreenChannel = 0x0002,
0041   MagentaChannel = 0x0002,
0042   aChannel = 0x0002,
0043   BlueChannel = 0x0004,
0044   bChannel = 0x0002,
0045   YellowChannel = 0x0004,
0046   BlackChannel = 0x0008,
0047   AlphaChannel = 0x0010,
0048   OpacityChannel = 0x0010,
0049   IndexChannel = 0x0020,             /* Color Index Table? */
0050   ReadMaskChannel = 0x0040,          /* Pixel is Not Readable? */
0051   WriteMaskChannel = 0x0080,         /* Pixel is Write Protected? */
0052   MetaChannel = 0x0100,              /* not used */
0053   CompositeMaskChannel = 0x0200,     /* SVG mask */
0054   CompositeChannels = 0x001F,
0055   AllChannels = 0x7ffffff,
0056   /*
0057     Special purpose channel types.
0058     FUTURE: are these needed any more - they are more like hacks
0059     SyncChannels for example is NOT a real channel but a 'flag'
0060     It really says -- "User has not defined channels"
0061     Though it does have extra meaning in the "-auto-level" operator
0062   */
0063   TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
0064   RGBChannels = 0x0200,      /* set alpha from grayscale mask in RGB */
0065   GrayChannels = 0x0400,
0066   SyncChannels = 0x20000,    /* channels modified as a single unit */
0067   DefaultChannels = AllChannels
0068 } ChannelType;  /* must correspond to PixelChannel */
0069 
0070 typedef enum
0071 {
0072   UndefinedPixelChannel = 0,
0073   RedPixelChannel = 0,
0074   CyanPixelChannel = 0,
0075   GrayPixelChannel = 0,
0076   LPixelChannel = 0,
0077   LabelPixelChannel = 0,
0078   YPixelChannel = 0,
0079   aPixelChannel = 1,
0080   GreenPixelChannel = 1,
0081   MagentaPixelChannel = 1,
0082   CbPixelChannel = 1,
0083   bPixelChannel = 2,
0084   BluePixelChannel = 2,
0085   YellowPixelChannel = 2,
0086   CrPixelChannel = 2,
0087   BlackPixelChannel = 3,
0088   AlphaPixelChannel = 4,
0089   IndexPixelChannel = 5,
0090   ReadMaskPixelChannel = 6,
0091   WriteMaskPixelChannel = 7,
0092   MetaPixelChannel = 8,
0093   CompositeMaskPixelChannel = 9,
0094   MetaPixelChannels = 10,
0095   IntensityPixelChannel = MaxPixelChannels,  /* ???? */
0096   CompositePixelChannel = MaxPixelChannels,  /* ???? */
0097   SyncPixelChannel = MaxPixelChannels+1      /* not a real channel */
0098 } PixelChannel;  /* must correspond to ChannelType */
0099 
0100 typedef enum
0101 {
0102   UndefinedPixelIntensityMethod = 0,
0103   AveragePixelIntensityMethod,
0104   BrightnessPixelIntensityMethod,
0105   LightnessPixelIntensityMethod,
0106   MSPixelIntensityMethod,
0107   Rec601LumaPixelIntensityMethod,
0108   Rec601LuminancePixelIntensityMethod,
0109   Rec709LumaPixelIntensityMethod,
0110   Rec709LuminancePixelIntensityMethod,
0111   RMSPixelIntensityMethod
0112 } PixelIntensityMethod;
0113 
0114 typedef enum
0115 {
0116   UndefinedInterpolatePixel,
0117   AverageInterpolatePixel,    /* Average 4 nearest neighbours */
0118   Average9InterpolatePixel,   /* Average 9 nearest neighbours */
0119   Average16InterpolatePixel,  /* Average 16 nearest neighbours */
0120   BackgroundInterpolatePixel, /* Just return background color */
0121   BilinearInterpolatePixel,   /* Triangular filter interpolation */
0122   BlendInterpolatePixel,      /* blend of nearest 1, 2 or 4 pixels */
0123   CatromInterpolatePixel,     /* Catmull-Rom interpolation */
0124   IntegerInterpolatePixel,    /* Integer (floor) interpolation */
0125   MeshInterpolatePixel,       /* Triangular Mesh interpolation */
0126   NearestInterpolatePixel,    /* Nearest Neighbour Only */
0127   SplineInterpolatePixel      /* Cubic Spline (blurred) interpolation */
0128 } PixelInterpolateMethod;
0129 
0130 typedef enum
0131 {
0132   UndefinedPixelMask = 0x000000,
0133   ReadPixelMask = 0x000001,
0134   WritePixelMask = 0x000002,
0135   CompositePixelMask = 0x000004
0136 } PixelMask;
0137 
0138 typedef enum
0139 {
0140   UndefinedPixelTrait = 0x000000,
0141   CopyPixelTrait = 0x000001,
0142   UpdatePixelTrait = 0x000002,
0143   BlendPixelTrait = 0x000004
0144 } PixelTrait;
0145 
0146 typedef enum
0147 {
0148   UndefinedPixel,
0149   CharPixel,
0150   DoublePixel,
0151   FloatPixel,
0152   LongPixel,
0153   LongLongPixel,
0154   QuantumPixel,
0155   ShortPixel
0156 } StorageType;
0157 
0158 /*
0159   Pixel typedef declarations.
0160 */
0161 typedef struct _PixelChannelMap
0162 {
0163   PixelChannel
0164     channel;
0165 
0166   PixelTrait
0167     traits;
0168 
0169   ssize_t
0170     offset;
0171 } PixelChannelMap;
0172 
0173 typedef struct _PixelInfo
0174 {
0175   ClassType
0176     storage_class;
0177 
0178   ColorspaceType
0179     colorspace;
0180 
0181   PixelTrait
0182     alpha_trait;
0183 
0184   double
0185     fuzz;
0186 
0187   size_t
0188     depth;
0189 
0190   MagickSizeType
0191     count;
0192 
0193   MagickRealType
0194     red,
0195     green,
0196     blue,
0197     black,
0198     alpha,
0199     index;
0200 } PixelInfo;
0201 
0202 typedef struct _PixelPacket
0203 {
0204   unsigned int
0205     red,
0206     green,
0207     blue,
0208     alpha,
0209     black;
0210 } PixelPacket;
0211 
0212 typedef struct _CacheView
0213   CacheView_;
0214 
0215 /*
0216   Pixel method declarations.
0217 */
0218 extern MagickExport ChannelType
0219   SetPixelChannelMask(Image *,const ChannelType);
0220 
0221 extern MagickExport MagickBooleanType
0222   ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
0223     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
0224   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
0225     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
0226   InterpolatePixelChannel(const Image *magick_restrict,const CacheView_ *,
0227     const PixelChannel,const PixelInterpolateMethod,const double,const double,
0228     double *,ExceptionInfo *),
0229   InterpolatePixelChannels(const Image *magick_restrict,const CacheView_ *,
0230     const Image * magick_restrict,const PixelInterpolateMethod,const double,
0231     const double,Quantum *,ExceptionInfo *),
0232   InterpolatePixelInfo(const Image *,const CacheView_ *,
0233     const PixelInterpolateMethod,const double,const double,PixelInfo *,
0234     ExceptionInfo *),
0235   IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
0236     const Quantum *) magick_attribute((__pure__)),
0237   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *)
0238     magick_attribute((__pure__)),
0239   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *),
0240   SortImagePixels(Image *,ExceptionInfo *);
0241 
0242 extern MagickExport MagickRealType
0243   GetPixelInfoIntensity(const Image *magick_restrict,
0244     const PixelInfo *magick_restrict) magick_hot_spot,
0245   GetPixelIntensity(const Image *magick_restrict,
0246     const Quantum *magick_restrict) magick_hot_spot;
0247 
0248 extern MagickExport PixelChannelMap
0249   *AcquirePixelChannelMap(void),
0250   *ClonePixelChannelMap(PixelChannelMap *),
0251   *DestroyPixelChannelMap(PixelChannelMap *);
0252 
0253 extern MagickExport PixelInfo
0254   *ClonePixelInfo(const PixelInfo *);
0255 
0256 extern MagickExport MagickRealType
0257   DecodePixelGamma(const MagickRealType) magick_hot_spot,
0258   EncodePixelGamma(const MagickRealType) magick_hot_spot;
0259 
0260 extern MagickExport void
0261   ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
0262   GetPixelInfo(const Image *,PixelInfo *),
0263   InitializePixelChannelMap(Image *);
0264 
0265 #if defined(__cplusplus) || defined(c_plusplus)
0266 }
0267 #endif
0268 
0269 #endif