]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/pixel.h
https://github.com/ImageMagick/ImageMagick/issues/1336
[imagemagick] / MagickCore / pixel.h
index b935f4d44730fa03f6e63221a565fc92588e123f..d71b046ce1580917d1f14c430441fafb4ac71f23 100644 (file)
@@ -1,11 +1,11 @@
 /*
-  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2018 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.
   obtain a copy of the License at
 
-    http://www.imagemagick.org/script/license.php
+    https://imagemagick.org/script/license.php
 
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
 
   MagickCore image pixel methods.
 */
-#ifndef _MAGICKCORE_PIXEL_H
-#define _MAGICKCORE_PIXEL_H
+#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
 
@@ -43,23 +43,25 @@ typedef enum
   BlackChannel = 0x0008,
   AlphaChannel = 0x0010,
   OpacityChannel = 0x0010,
-  IndexChannel = 0x0020,
-  ReadMaskChannel = 0x0040,
-  WriteMaskChannel = 0x0080,
-  MetaChannel = 0x0100,
-  CompositeChannels = 0x002F,
+  IndexChannel = 0x0020,             /* Color Index Table? */
+  ReadMaskChannel = 0x0040,          /* Pixel is Not Readable? */
+  WriteMaskChannel = 0x0080,         /* Pixel is Write Protected? */
+  MetaChannel = 0x0100,              /* not used */
+  CompositeMaskChannel = 0x0200,     /* SVG mask */
+  CompositeChannels = 0x001F,
   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"
+    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
@@ -69,6 +71,7 @@ typedef enum
   CyanPixelChannel = 0,
   GrayPixelChannel = 0,
   LPixelChannel = 0,
+  LabelPixelChannel = 0,
   YPixelChannel = 0,
   aPixelChannel = 1,
   GreenPixelChannel = 1,
@@ -84,9 +87,10 @@ typedef enum
   ReadMaskPixelChannel = 6,
   WriteMaskPixelChannel = 7,
   MetaPixelChannel = 8,
-  IntensityPixelChannel = MaxPixelChannels,
-  CompositePixelChannel = MaxPixelChannels,
-  SyncPixelChannel = MaxPixelChannels+1
+  CompositeMaskPixelChannel = 9,
+  IntensityPixelChannel = MaxPixelChannels,  /* ???? */
+  CompositePixelChannel = MaxPixelChannels,  /* ???? */
+  SyncPixelChannel = MaxPixelChannels+1      /* not a real channel */
 } PixelChannel;  /* must correspond to ChannelType */
 
 typedef enum
@@ -95,6 +99,7 @@ typedef enum
   AveragePixelIntensityMethod,
   BrightnessPixelIntensityMethod,
   LightnessPixelIntensityMethod,
+  MSPixelIntensityMethod,
   Rec601LumaPixelIntensityMethod,
   Rec601LuminancePixelIntensityMethod,
   Rec709LumaPixelIntensityMethod,
@@ -115,7 +120,7 @@ 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;
 
@@ -123,7 +128,8 @@ typedef enum
 {
   UndefinedPixelMask = 0x000000,
   ReadPixelMask = 0x000001,
-  WritePixelMask = 0x000002
+  WritePixelMask = 0x000002,
+  CompositePixelMask = 0x000004
 } PixelMask;
 
 typedef enum
@@ -206,8 +212,11 @@ typedef struct _CacheView
 /*
   Pixel method declarations.
 */
+extern MagickExport ChannelType
+  SetPixelChannelMask(Image *,const ChannelType);
+
 extern MagickExport MagickBooleanType
-  ExportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
+  ExportImagePixels(const 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 *),
@@ -226,8 +235,10 @@ extern MagickExport MagickBooleanType
   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
 
 extern MagickExport MagickRealType
-  GetPixelIntensity(const Image *restrict,const Quantum *restrict)
-    magick_hot_spot;
+  GetPixelInfoIntensity(const Image *magick_restrict,
+    const PixelInfo *magick_restrict) magick_hot_spot,
+  GetPixelIntensity(const Image *magick_restrict,
+    const Quantum *magick_restrict) magick_hot_spot;
 
 extern MagickExport PixelChannelMap
   *AcquirePixelChannelMap(void),
@@ -242,9 +253,9 @@ extern MagickExport MagickRealType
   EncodePixelGamma(const MagickRealType) magick_hot_spot;
 
 extern MagickExport void
-  InitializePixelChannelMap(Image *),
+  ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
   GetPixelInfo(const Image *,PixelInfo *),
-  SetPixelChannelMask(Image *,const ChannelType);
+  InitializePixelChannelMap(Image *);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }