]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/pixel.h
Update web pages
[imagemagick] / MagickCore / pixel.h
index 7e6c2c4e7fc5502ae8dc3a52560a4a675bf9c50c..14edf2266ae93ab3db4cd7d2091afe36afdd8f49 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
 
   You may not use this file except in compliance with the License.
 #ifndef _MAGICKCORE_PIXEL_H
 #define _MAGICKCORE_PIXEL_H
 
+#include "MagickCore/colorspace.h"
+
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
 #endif
 
-#include <MagickCore/colorspace.h>
-
 #define MaxPixelChannels  32
 #undef index
 
+/*
+  Pixel enum declarations.
+*/
 typedef enum
 {
   UndefinedChannel = 0x0000,
@@ -40,9 +43,10 @@ typedef enum
   BlackChannel = 0x0008,
   AlphaChannel = 0x0010,
   OpacityChannel = 0x0010,
-  IndexChannel = 0x0020,
-  MaskChannel = 0x0040,
-  MetaChannel = 0x0080,
+  IndexChannel = 0x0020,             /* Color Index Table? */
+  ReadMaskChannel = 0x0040,          /* Pixel is Not Readable? */
+  WriteMaskChannel = 0x0080,         /* Pixel is Write Protected? */
+  MetaChannel = 0x0100,              /* ???? */
   CompositeChannels = 0x002F,
   AllChannels = 0x7ffffff,
   /*
@@ -50,14 +54,56 @@ typedef enum
     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"
+    Though it does have extra meaning in the "-auto-level" operator
   */
   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)
+  DefaultChannels = AllChannels
 } ChannelType;  /* must correspond to PixelChannel */
 
+typedef enum
+{
+  UndefinedPixelChannel = 0,
+  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,
+  ReadMaskPixelChannel = 6,
+  WriteMaskPixelChannel = 7,
+  MetaPixelChannel = 8,
+  IntensityPixelChannel = MaxPixelChannels,  /* ???? */
+  CompositePixelChannel = MaxPixelChannels,  /* ???? */
+  SyncPixelChannel = MaxPixelChannels+1      /* not a real channel */
+} PixelChannel;  /* must correspond to ChannelType */
+
+typedef enum
+{
+  UndefinedPixelIntensityMethod = 0,
+  AveragePixelIntensityMethod,
+  BrightnessPixelIntensityMethod,
+  LightnessPixelIntensityMethod,
+  MSPixelIntensityMethod,
+  Rec601LumaPixelIntensityMethod,
+  Rec601LuminancePixelIntensityMethod,
+  Rec709LumaPixelIntensityMethod,
+  Rec709LuminancePixelIntensityMethod,
+  RMSPixelIntensityMethod
+} PixelIntensityMethod;
+
 typedef enum
 {
   UndefinedInterpolatePixel,
@@ -71,32 +117,16 @@ typedef enum
   IntegerInterpolatePixel,    /* Integer (floor) interpolation */
   MeshInterpolatePixel,       /* Triangular Mesh interpolation */
   NearestInterpolatePixel,    /* Nearest Neighbour Only */
-  SplineInterpolatePixel     /* Cubic Spline (blurred) interpolation */
+  SplineInterpolatePixel      /* Cubic Spline (blurred) interpolation */
   /* FilterInterpolatePixel,  ** Use resize filter - (very slow) */
 } PixelInterpolateMethod;
 
 typedef enum
 {
-  UndefinedPixelChannel = 0,
-  RedPixelChannel = 0,
-  CyanPixelChannel = 0,
-  GrayPixelChannel = 0,
-  YPixelChannel = 0,
-  GreenPixelChannel = 1,
-  MagentaPixelChannel = 1,
-  CbPixelChannel = 1,
-  BluePixelChannel = 2,
-  YellowPixelChannel = 2,
-  CrPixelChannel = 2,
-  BlackPixelChannel = 3,
-  AlphaPixelChannel = 4,
-  IndexPixelChannel = 5,
-  MaskPixelChannel = 6,                 /* Image Write Mask */
-  MetaPixelChannel = 7,                 /* ??? */
-  IntensityPixelChannel = MaxPixelChannels,  /* what are these ??? */
-  CompositePixelChannel = MaxPixelChannels,
-  SyncPixelChannel = MaxPixelChannels+1
-} PixelChannel;  /* must correspond to ChannelType */
+  UndefinedPixelMask = 0x000000,
+  ReadPixelMask = 0x000001,
+  WritePixelMask = 0x000002
+} PixelMask;
 
 typedef enum
 {
@@ -106,6 +136,21 @@ typedef enum
   BlendPixelTrait = 0x000004
 } PixelTrait;
 
+typedef enum
+{
+  UndefinedPixel,
+  CharPixel,
+  DoublePixel,
+  FloatPixel,
+  LongPixel,
+  LongLongPixel,
+  QuantumPixel,
+  ShortPixel
+} StorageType;
+
+/*
+  Pixel typedef declarations.
+*/
 typedef struct _PixelChannelMap
 {
   PixelChannel
@@ -126,8 +171,8 @@ typedef struct _PixelInfo
   ColorspaceType
     colorspace;
 
-  MagickBooleanType
-    matte;
+  PixelTrait
+    alpha_trait;
 
   double
     fuzz;
@@ -138,7 +183,7 @@ typedef struct _PixelInfo
   MagickSizeType
     count;
 
-  double
+  MagickRealType
     red,
     green,
     blue,
@@ -157,26 +202,17 @@ typedef struct _PixelPacket
     black;
 } PixelPacket;
 
-typedef enum
-{
-  UndefinedPixel,
-  CharPixel,
-  DoublePixel,
-  FloatPixel,
-  LongPixel,
-  LongLongPixel,
-  QuantumPixel,
-  ShortPixel
-} StorageType;
-
 typedef struct _CacheView
   CacheView_;
 
+/*
+  Pixel method declarations.
+*/
 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 *),
@@ -194,6 +230,12 @@ extern MagickExport MagickBooleanType
   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
 
+extern MagickExport MagickRealType
+  GetPixelInfoIntensity(const Image *restrict,const PixelInfo *restrict)
+    magick_hot_spot,
+  GetPixelIntensity(const Image *restrict,const Quantum *restrict)
+    magick_hot_spot;
+
 extern MagickExport PixelChannelMap
   *AcquirePixelChannelMap(void),
   *ClonePixelChannelMap(PixelChannelMap *),
@@ -202,10 +244,14 @@ extern MagickExport PixelChannelMap
 extern MagickExport PixelInfo
   *ClonePixelInfo(const PixelInfo *);
 
+extern MagickExport MagickRealType
+  DecodePixelGamma(const MagickRealType) magick_hot_spot,
+  EncodePixelGamma(const MagickRealType) magick_hot_spot;
+
 extern MagickExport void
-  InitializePixelChannelMap(Image *),
+  ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
   GetPixelInfo(const Image *,PixelInfo *),
-  SetPixelChannelMapMask(Image *,const ChannelType);
+  InitializePixelChannelMap(Image *);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }