]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/pixel.h
(no commit message)
[imagemagick] / MagickCore / pixel.h
index 6a314cec172b111053da98456470d82ac2ae8fee..ed19bbcaa4621d7ee911823775d70f2764fc6391 100644 (file)
@@ -13,7 +13,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 
-  MagickCore image constitute methods.
+  MagickCore image pixel methods.
 */
 #ifndef _MAGICKCORE_PIXEL_H
 #define _MAGICKCORE_PIXEL_H
@@ -23,22 +23,56 @@ extern "C" {
 #endif
 
 #include <MagickCore/colorspace.h>
-#include <MagickCore/constitute.h>
 
 #define MaxPixelChannels  32
 #undef index
 
+typedef enum
+{
+  UndefinedChannel = 0x0000,
+  RedChannel = 0x0001,
+  GrayChannel = 0x0001,
+  CyanChannel = 0x0001,
+  GreenChannel = 0x0002,
+  MagentaChannel = 0x0002,
+  BlueChannel = 0x0004,
+  YellowChannel = 0x0004,
+  BlackChannel = 0x0008,
+  AlphaChannel = 0x0010,
+  OpacityChannel = 0x0010,
+  IndexChannel = 0x0020,
+  MaskChannel = 0x0040,
+  MetaChannel = 0x0080,
+  CompositeChannels = 0x002F,
+  AllChannels = 0x7ffffff,
+  /*
+    Special purpose channel types.
+    FUTURE: are these needed any more - they are more like hacks
+    SyncChannels for example is NOT a real channel but a 'flag'
+    It really says -- "User has not defined channels"
+  */
+  TrueAlphaChannel = 0x0100, /* extract actual alpha channel from opacity */
+  RGBChannels = 0x0200,      /* set alpha from grayscale mask in RGB */
+  GrayChannels = 0x0400,
+  SyncChannels = 0x20000,    /* channels modified as a single unit */
+  DefaultChannels = ((AllChannels | SyncChannels) &~ AlphaChannel)
+} ChannelType;  /* must correspond to PixelChannel */
+
 typedef enum
 {
   UndefinedInterpolatePixel,
-  AverageInterpolatePixel,
-  BicubicInterpolatePixel,
-  BilinearInterpolatePixel,
-  FilterInterpolatePixel,
-  IntegerInterpolatePixel,
-  MeshInterpolatePixel,
-  NearestNeighborInterpolatePixel,
-  SplineInterpolatePixel
+  AverageInterpolatePixel,    /* Average 4 nearest neighbours */
+  Average9InterpolatePixel,   /* Average 9 nearest neighbours */
+  Average16InterpolatePixel,  /* Average 16 nearest neighbours */
+  BackgroundInterpolatePixel, /* Just return background color */
+  BilinearInterpolatePixel,   /* Triangular filter interpolation */
+  BlendInterpolatePixel,      /* blend of nearest 1, 2 or 4 pixels */
+  CatromInterpolatePixel,     /* Catmull-Rom interpolation */
+  IntegerInterpolatePixel,    /* Integer (floor) interpolation */
+  MeshInterpolatePixel,       /* Triangular Mesh interpolation */
+  NearestInterpolatePixel,    /* Nearest Neighbour Only */
+  SplineInterpolatePixel     /* Cubic Spline (blurred) interpolation */
+  /* FilterInterpolatePixel,  ** Use resize filter - (very slow) */
 } PixelInterpolateMethod;
 
 typedef enum
@@ -47,22 +81,25 @@ typedef enum
   RedPixelChannel = 0,
   CyanPixelChannel = 0,
   GrayPixelChannel = 0,
+  LPixelChannel = 0,
   YPixelChannel = 0,
+  aPixelChannel = 1,
   GreenPixelChannel = 1,
   MagentaPixelChannel = 1,
   CbPixelChannel = 1,
+  bPixelChannel = 2,
   BluePixelChannel = 2,
   YellowPixelChannel = 2,
   CrPixelChannel = 2,
   BlackPixelChannel = 3,
   AlphaPixelChannel = 4,
   IndexPixelChannel = 5,
-  MaskPixelChannel = 6,
-  MetaPixelChannel = 7,
-  IntensityPixelChannel = MaxPixelChannels,
+  MaskPixelChannel = 6,                 /* Image Write Mask */
+  MetaPixelChannel = 7,                 /* ??? */
+  IntensityPixelChannel = MaxPixelChannels,  /* what are these ??? */
   CompositePixelChannel = MaxPixelChannels,
   SyncPixelChannel = MaxPixelChannels+1
-} PixelChannel;
+} PixelChannel;  /* must correspond to ChannelType */
 
 typedef enum
 {
@@ -92,8 +129,8 @@ typedef struct _PixelInfo
   ColorspaceType
     colorspace;
 
-  MagickBooleanType
-    matte;
+  PixelTrait
+    alpha_trait;
 
   double
     fuzz;
@@ -104,7 +141,7 @@ typedef struct _PixelInfo
   MagickSizeType
     count;
 
-  double
+  MagickRealType
     red,
     green,
     blue,
@@ -123,14 +160,23 @@ typedef struct _PixelPacket
     black;
 } PixelPacket;
 
+typedef enum
+{
+  UndefinedPixel,
+  CharPixel,
+  DoublePixel,
+  FloatPixel,
+  LongPixel,
+  LongLongPixel,
+  QuantumPixel,
+  ShortPixel
+} StorageType;
+
 typedef struct _CacheView
   CacheView_;
 
-extern MagickExport ChannelType
-  SetPixelChannelMask(Image *,const ChannelType);
-
 extern MagickExport MagickBooleanType
-  ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t,
+  ExportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
   ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
     const size_t,const char *,const StorageType,const void *,ExceptionInfo *),
@@ -145,7 +191,8 @@ extern MagickExport MagickBooleanType
     ExceptionInfo *),
   IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *,
     const Quantum *),
-  IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *);
+  IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
+  SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
 
 extern MagickExport PixelChannelMap
   *AcquirePixelChannelMap(void),
@@ -158,7 +205,7 @@ extern MagickExport PixelInfo
 extern MagickExport void
   InitializePixelChannelMap(Image *),
   GetPixelInfo(const Image *,PixelInfo *),
-  SetPixelChannelMapMask(Image *,const ChannelType);
+  SetPixelChannelMask(Image *,const ChannelType);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }