]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/image.h
(no commit message)
[imagemagick] / MagickCore / image.h
index 6e505d0025d9d5acc1ba805cca734d8eeb4620f9..693dbd1ef7f698cdd4c8652647d93c04b9d92de8 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.
   dedicated to making software imaging solutions freely available.
 
   You may not use this file except in compliance with the License.
 #ifndef _MAGICKCORE_IMAGE_H
 #define _MAGICKCORE_IMAGE_H
 
 #ifndef _MAGICKCORE_IMAGE_H
 #define _MAGICKCORE_IMAGE_H
 
+#include "MagickCore/color.h"
+#include "MagickCore/pixel.h"
+
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
 #endif
 
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
 #endif
 
-#include <MagickCore/color.h>
-
 #define OpaqueAlpha  ((Quantum) QuantumRange)
 #define OpaqueAlpha  ((Quantum) QuantumRange)
-#define TransparentAlpha  ((Quantum) 0UL)
+#define TransparentAlpha  ((Quantum) 0)
 
 typedef enum
 {
   UndefinedAlphaChannel,
   ActivateAlphaChannel,
 
 typedef enum
 {
   UndefinedAlphaChannel,
   ActivateAlphaChannel,
+  AssociateAlphaChannel,
   BackgroundAlphaChannel,
   CopyAlphaChannel,
   DeactivateAlphaChannel,
   BackgroundAlphaChannel,
   CopyAlphaChannel,
   DeactivateAlphaChannel,
+  DiscreteAlphaChannel,
+  DisassociateAlphaChannel,
   ExtractAlphaChannel,
   OpaqueAlphaChannel,
   RemoveAlphaChannel,
   SetAlphaChannel,
   ShapeAlphaChannel,
   TransparentAlphaChannel
   ExtractAlphaChannel,
   OpaqueAlphaChannel,
   RemoveAlphaChannel,
   SetAlphaChannel,
   ShapeAlphaChannel,
   TransparentAlphaChannel
-} AlphaChannelType;
+} AlphaChannelOption;
 
 typedef enum
 {
 
 typedef enum
 {
@@ -163,8 +167,7 @@ struct _Image
     orientation;        /* photo orientation of image */
 
   MagickBooleanType
     orientation;        /* photo orientation of image */
 
   MagickBooleanType
-    taint,              /* has image been modified since reading */
-    matte;              /* is transparency channel defined and active */
+    taint;              /* has image been modified since reading */
 
   size_t
     columns,            /* physical size of image */
 
   size_t
     columns,            /* physical size of image */
@@ -201,7 +204,7 @@ struct _Image
     *geometry;
 
   ssize_t
     *geometry;
 
   ssize_t
-    offset;
+    offset;         /* ??? */
 
   PointInfo
     resolution;     /* image resolution/density */
 
   PointInfo
     resolution;     /* image resolution/density */
@@ -211,13 +214,14 @@ struct _Image
     extract_info;
 
   double
     extract_info;
 
   double
-    bias,           /* FUTURE: depreciated -- convolve bias */
-    blur,           /* FUTURE: depreciated -- resize file blur */
-    fuzz;           /* current color fuzz attribute - make image_info */
+    fuzz;           /* current color fuzz attribute - move to image_info */
 
   FilterTypes
     filter;         /* resize/distort filter to apply */
 
 
   FilterTypes
     filter;         /* resize/distort filter to apply */
 
+  PixelIntensityMethod
+    intensity;      /* method to generate an intensity value from a pixel */
+
   InterlaceType
     interlace;
 
   InterlaceType
     interlace;
 
@@ -235,17 +239,18 @@ struct _Image
 
   size_t
     scene,          /* index of image in multi-image file */
 
   size_t
     scene,          /* index of image in multi-image file */
-    delay;          /* Animation delay time */
+    delay,          /* Animation delay time */
+    duration;       /* Total animation duration sum(delay*iterations) */
 
   ssize_t
     ticks_per_second;  /* units for delay time, default 100 for GIF */
 
   size_t
 
   ssize_t
     ticks_per_second;  /* units for delay time, default 100 for GIF */
 
   size_t
-    iterations,
+    iterations,        /* number of interations for GIF animations */
     total_colors;
 
   ssize_t
     total_colors;
 
   ssize_t
-    start_loop;
+    start_loop;        /* ??? */
 
   PixelInterpolateMethod
     interpolate;       /* Interpolation of color for between pixel lookups */
 
   PixelInterpolateMethod
     interpolate;       /* Interpolation of color for between pixel lookups */
@@ -256,10 +261,6 @@ struct _Image
   RectangleInfo
     tile_offset;
 
   RectangleInfo
     tile_offset;
 
-  void
-    *properties,       /* per image properities */
-    *artifacts;        /* per image sequence image artifacts */
-
   ImageType
     type;
 
   ImageType
     type;
 
@@ -270,10 +271,14 @@ struct _Image
     extent;            /* Size of image read from disk */
 
   MagickBooleanType
     extent;            /* Size of image read from disk */
 
   MagickBooleanType
-    ping;
+    ping;              /* no image data read, just attributes */
 
   MagickBooleanType
 
   MagickBooleanType
-    mask;
+    read_mask,
+    write_mask;
+
+  PixelTrait
+    alpha_trait;       /* is transparency channel defined and active */
 
   size_t
     number_channels,
 
   size_t
     number_channels,
@@ -307,18 +312,25 @@ struct _Image
   ProfileInfo
     *generic_profile;
 
   ProfileInfo
     *generic_profile;
 
+  void
+    *properties,       /* general settings, to save with image */
+    *artifacts;        /* general operational/coder settings, not saved */
+
   char
     filename[MaxTextExtent],        /* images input filename */
     magick_filename[MaxTextExtent], /* given image filename (with read mods) */
     magick[MaxTextExtent];          /* images file format (file magic) */
 
   size_t
   char
     filename[MaxTextExtent],        /* images input filename */
     magick_filename[MaxTextExtent], /* given image filename (with read mods) */
     magick[MaxTextExtent];          /* images file format (file magic) */
 
   size_t
-    magick_columns,
+    magick_columns,     /* size of image when read/created */
     magick_rows;
 
   BlobInfo
     *blob;             /* image file as in-memory string of 'extent' */
 
     magick_rows;
 
   BlobInfo
     *blob;             /* image file as in-memory string of 'extent' */
 
+  time_t
+    timestamp;
+
   MagickBooleanType
     debug;             /* debug output attribute */
 
   MagickBooleanType
     debug;             /* debug output attribute */
 
@@ -328,15 +340,28 @@ struct _Image
   SemaphoreInfo
     *semaphore;
 
   SemaphoreInfo
     *semaphore;
 
+  const struct _ImageInfo
+    *image_info;       /* (Optional) Image belongs to this ImageInfo 'list'
+                        * For access to 'global options' when no per-image
+                        * attribute, properity, or artifact has been set.
+                        * It may be set or unset as needed, but never freed.
+                        */
+
   struct _Image
   struct _Image
-    *previous,         /* Image sequence list links */
-    *list,
+    *list,             /* Undo/Redo image processing list (for display) */
+    *previous,         /* Image list links */
     *next;
 
   size_t
     signature;
 };
 
     *next;
 
   size_t
     signature;
 };
 
+/* ImageInfo structure
+ * Stores an image list, as well as all global settings used by
+ * all images held, -- unless overridden for that specific image.
+ * See SyncImagesettings() which maps any global setting that always
+ * overrides specific image settings.
+ */
 struct _ImageInfo
 {
   CompressionType
 struct _ImageInfo
 {
   CompressionType
@@ -346,7 +371,7 @@ struct _ImageInfo
     orientation;        /* orientation setting */
 
   MagickBooleanType
     orientation;        /* orientation setting */
 
   MagickBooleanType
-    temporary,
+    temporary,          /* image file to be deleted after read "empemeral:" */
     adjoin,             /* save images to seperate scene files */
     affirm,
     antialias;
     adjoin,             /* save images to seperate scene files */
     affirm,
     antialias;
@@ -423,7 +448,7 @@ struct _ImageInfo
     channel;
 
   void
     channel;
 
   void
-    *options;                /* splay tree of use options */
+    *options;                /* splay tree of global options */
 
   void
     *profile;
 
   void
     *profile;
@@ -463,6 +488,9 @@ struct _ImageInfo
     signature;
 };
 
     signature;
 };
 
+extern MagickExport ChannelType
+  SetImageChannelMask(Image *,const ChannelType);
+
 extern MagickExport const char
   DefaultTileGeometry[],
   DefaultTileLabel[],
 extern MagickExport const char
   DefaultTileGeometry[],
   DefaultTileLabel[],
@@ -487,15 +515,11 @@ extern MagickExport Image
   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
     ExceptionInfo *),
   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
     ExceptionInfo *),
-  *CombineImages(const Image *,ExceptionInfo *),
   *DestroyImage(Image *),
   *DestroyImage(Image *),
-  *GetImageClipMask(const Image *,ExceptionInfo *),
   *GetImageMask(const Image *,ExceptionInfo *),
   *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
     ExceptionInfo *),
   *ReferenceImage(Image *),
   *GetImageMask(const Image *,ExceptionInfo *),
   *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
     ExceptionInfo *),
   *ReferenceImage(Image *),
-  *SeparateImage(const Image *,const ChannelType,ExceptionInfo *),
-  *SeparateImages(const Image *,ExceptionInfo *),
   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
     ExceptionInfo *);
 
   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
     ExceptionInfo *);
 
@@ -507,7 +531,6 @@ extern MagickExport ImageInfo
 extern MagickExport MagickBooleanType
   ClipImage(Image *,ExceptionInfo *),
   ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
 extern MagickExport MagickBooleanType
   ClipImage(Image *,ExceptionInfo *),
   ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
-  GetImageAlphaChannel(const Image *),
   IsTaintImage(const Image *),
   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
   IsImageObject(const Image *),
   IsTaintImage(const Image *),
   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
   IsImageObject(const Image *),
@@ -515,14 +538,12 @@ extern MagickExport MagickBooleanType
   ModifyImage(Image **,ExceptionInfo *),
   ResetImagePage(Image *,const char *),
   SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
   ModifyImage(Image **,ExceptionInfo *),
   ResetImagePage(Image *,const char *),
   SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
-  SetImageAlphaChannel(Image *,const AlphaChannelType,ExceptionInfo *),
   SetImageBackgroundColor(Image *,ExceptionInfo *),
   SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
   SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
   SetImageMask(Image *,const Image *,ExceptionInfo *),
   SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
   SetImageBackgroundColor(Image *,ExceptionInfo *),
   SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
   SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
   SetImageMask(Image *,const Image *,ExceptionInfo *),
   SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
-  SetImageType(Image *,const ImageType,ExceptionInfo *),
   StripImage(Image *,ExceptionInfo *),
   SyncImage(Image *,ExceptionInfo *),
   SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
   StripImage(Image *,ExceptionInfo *),
   SyncImage(Image *,ExceptionInfo *),
   SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
@@ -537,7 +558,7 @@ extern MagickExport ssize_t
 
 extern MagickExport VirtualPixelMethod
   GetImageVirtualPixelMethod(const Image *),
 
 extern MagickExport VirtualPixelMethod
   GetImageVirtualPixelMethod(const Image *),
-  SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod);
+  SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
 
 extern MagickExport void
   AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
 
 extern MagickExport void
   AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),