Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-04 10:15: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 #if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT)
0034 typedef enum : MagickOffsetType
0035 #else
0036 typedef enum
0037 #endif
0038 {
0039   UndefinedChannel = 0x0000,
0040   RedChannel = 0x0001,
0041   GrayChannel = 0x0001,
0042   CyanChannel = 0x0001,
0043   LChannel = 0x0001,
0044   GreenChannel = 0x0002,
0045   MagentaChannel = 0x0002,
0046   aChannel = 0x0002,
0047   BlueChannel = 0x0004,
0048   bChannel = 0x0002,
0049   YellowChannel = 0x0004,
0050   BlackChannel = 0x0008,
0051   AlphaChannel = 0x0010,
0052   OpacityChannel = 0x0010,
0053   IndexChannel = 0x0020,             /* Color Index Table? */
0054   ReadMaskChannel = 0x0040,          /* Pixel is Not Readable? */
0055   WriteMaskChannel = 0x0080,         /* Pixel is Write Protected? */
0056   MetaChannel = 0x0100,              /* not used */
0057   CompositeMaskChannel = 0x0200,     /* SVG mask */
0058   CompositeChannels = 0x001F,
0059 #if defined(MAGICKCORE_64BIT_CHANNEL_MASK_SUPPORT)
0060   AllChannels = MagickLLConstant(0x7FFFFFFFFFFFFFFF),
0061 #else
0062   AllChannels = 0X7FFFFFF,
0063 #endif
0064   /*
0065     Special purpose channel types.
0066     FUTURE: are these needed any more - they are more like hacks
0067     SyncChannels for example is NOT a real channel but a 'flag'
0068     It really says -- "User has not defined channels"
0069     Though it does have extra meaning in the "-auto-level" operator
0070   */
0071   TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
0072   RGBChannels = 0x0200,      /* set alpha from grayscale mask in RGB */
0073   GrayChannels = 0x0400,
0074   SyncChannels = 0x20000,    /* channels modified as a single unit */
0075   DefaultChannels = AllChannels
0076 } ChannelType;  /* must correspond to PixelChannel */
0077 
0078 typedef enum
0079 {
0080   UndefinedPixelChannel = 0,
0081   RedPixelChannel = 0,
0082   CyanPixelChannel = 0,
0083   GrayPixelChannel = 0,
0084   LPixelChannel = 0,
0085   LabelPixelChannel = 0,
0086   YPixelChannel = 0,
0087   aPixelChannel = 1,
0088   GreenPixelChannel = 1,
0089   MagentaPixelChannel = 1,
0090   CbPixelChannel = 1,
0091   bPixelChannel = 2,
0092   BluePixelChannel = 2,
0093   YellowPixelChannel = 2,
0094   CrPixelChannel = 2,
0095   BlackPixelChannel = 3,
0096   AlphaPixelChannel = 4,
0097   IndexPixelChannel = 5,
0098   ReadMaskPixelChannel = 6,
0099   WriteMaskPixelChannel = 7,
0100   MetaPixelChannel = 8, /* deprecated */
0101   CompositeMaskPixelChannel = 9,
0102   MetaPixelChannels = 10,
0103   IntensityPixelChannel = MaxPixelChannels,  /* ???? */
0104   CompositePixelChannel = MaxPixelChannels,  /* ???? */
0105   SyncPixelChannel = MaxPixelChannels+1      /* not a real channel */
0106 } PixelChannel;  /* must correspond to ChannelType */
0107 
0108 typedef enum
0109 {
0110   UndefinedPixelIntensityMethod = 0,
0111   AveragePixelIntensityMethod,
0112   BrightnessPixelIntensityMethod,
0113   LightnessPixelIntensityMethod,
0114   MSPixelIntensityMethod,
0115   Rec601LumaPixelIntensityMethod,
0116   Rec601LuminancePixelIntensityMethod,
0117   Rec709LumaPixelIntensityMethod,
0118   Rec709LuminancePixelIntensityMethod,
0119   RMSPixelIntensityMethod
0120 } PixelIntensityMethod;
0121 
0122 typedef enum
0123 {
0124   UndefinedInterpolatePixel,
0125   AverageInterpolatePixel,    /* Average 4 nearest neighbours */
0126   Average9InterpolatePixel,   /* Average 9 nearest neighbours */
0127   Average16InterpolatePixel,  /* Average 16 nearest neighbours */
0128   BackgroundInterpolatePixel, /* Just return background color */
0129   BilinearInterpolatePixel,   /* Triangular filter interpolation */
0130   BlendInterpolatePixel,      /* blend of nearest 1, 2 or 4 pixels */
0131   CatromInterpolatePixel,     /* Catmull-Rom interpolation */
0132   IntegerInterpolatePixel,    /* Integer (floor) interpolation */
0133   MeshInterpolatePixel,       /* Triangular Mesh interpolation */
0134   NearestInterpolatePixel,    /* Nearest Neighbour Only */
0135   SplineInterpolatePixel      /* Cubic Spline (blurred) interpolation */
0136 } PixelInterpolateMethod;
0137 
0138 typedef enum
0139 {
0140   UndefinedPixelMask = 0x000000,
0141   ReadPixelMask = 0x000001,
0142   WritePixelMask = 0x000002,
0143   CompositePixelMask = 0x000004
0144 } PixelMask;
0145 
0146 typedef enum
0147 {
0148   UndefinedPixelTrait = 0x000000,
0149   CopyPixelTrait = 0x000001,
0150   UpdatePixelTrait = 0x000002,
0151   BlendPixelTrait = 0x000004
0152 } PixelTrait;
0153 
0154 typedef enum
0155 {
0156   UndefinedPixel,
0157   CharPixel,
0158   DoublePixel,
0159   FloatPixel,
0160   LongPixel,
0161   LongLongPixel,
0162   QuantumPixel,
0163   ShortPixel
0164 } StorageType;
0165 
0166 /*
0167   Pixel typedef declarations.
0168 */
0169 typedef struct _PixelChannelMap
0170 {
0171   PixelChannel
0172     channel;
0173 
0174   PixelTrait
0175     traits;
0176 
0177   ssize_t
0178     offset;
0179 } PixelChannelMap;
0180 
0181 typedef struct _PixelInfo
0182 {
0183   ClassType
0184     storage_class;
0185 
0186   ColorspaceType
0187     colorspace;
0188 
0189   PixelTrait
0190     alpha_trait;
0191 
0192   double
0193     fuzz;
0194 
0195   size_t
0196     depth;
0197 
0198   MagickSizeType
0199     count;
0200 
0201   MagickRealType
0202     red,
0203     green,
0204     blue,
0205     black,
0206     alpha,
0207     index;
0208 } PixelInfo;
0209 
0210 typedef struct _PixelPacket
0211 {
0212   unsigned int
0213     red,
0214     green,
0215     blue,
0216     alpha,
0217     black;
0218 } PixelPacket;
0219 
0220 typedef struct _CacheView
0221   CacheView_;
0222 
0223 /*
0224   Pixel method declarations.
0225 */
0226 extern MagickExport ChannelType
0227   SetPixelChannelMask(Image *,const ChannelType);
0228 
0229 extern MagickExport MagickBooleanType
0230   ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
0231     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
0232   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
0233     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
0234   InterpolatePixelChannel(const Image *magick_restrict,const CacheView_ *,
0235     const PixelChannel,const PixelInterpolateMethod,const double,const double,
0236     double *,ExceptionInfo *),
0237   InterpolatePixelChannels(const Image *magick_restrict,const CacheView_ *,
0238     const Image * magick_restrict,const PixelInterpolateMethod,const double,
0239     const double,Quantum *,ExceptionInfo *),
0240   InterpolatePixelInfo(const Image *,const CacheView_ *,
0241     const PixelInterpolateMethod,const double,const double,PixelInfo *,
0242     ExceptionInfo *),
0243   IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
0244     const Quantum *) magick_attribute((__pure__)),
0245   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *)
0246     magick_attribute((__pure__)),
0247   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *),
0248   SortImagePixels(Image *,ExceptionInfo *);
0249 
0250 extern MagickExport MagickRealType
0251   GetPixelInfoIntensity(const Image *magick_restrict,
0252     const PixelInfo *magick_restrict) magick_hot_spot,
0253   GetPixelIntensity(const Image *magick_restrict,
0254     const Quantum *magick_restrict) magick_hot_spot;
0255 
0256 extern MagickExport PixelChannelMap
0257   *AcquirePixelChannelMap(void),
0258   *ClonePixelChannelMap(PixelChannelMap *),
0259   *DestroyPixelChannelMap(PixelChannelMap *);
0260 
0261 extern MagickExport PixelInfo
0262   *ClonePixelInfo(const PixelInfo *);
0263 
0264 extern MagickExport MagickRealType
0265   DecodePixelGamma(const MagickRealType) magick_hot_spot,
0266   EncodePixelGamma(const MagickRealType) magick_hot_spot;
0267 
0268 extern MagickExport void
0269   ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
0270   GetPixelInfo(const Image *,PixelInfo *);
0271 
0272 #if defined(__cplusplus) || defined(c_plusplus)
0273 }
0274 #endif
0275 
0276 #endif