image.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004 
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007 
00008     https://imagemagick.org/script/license.php
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore image methods.
00017 */
00018 #ifndef MAGICKCORE_IMAGE_H
00019 #define MAGICKCORE_IMAGE_H
00020 
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #define OpaqueAlpha  ((Quantum) QuantumRange)
00026 #define TransparentAlpha  ((Quantum) 0)
00027 
00028 typedef enum
00029 {
00030   UndefinedAlphaChannel,
00031   ActivateAlphaChannel,
00032   AssociateAlphaChannel,
00033   BackgroundAlphaChannel,
00034   CopyAlphaChannel,
00035   DeactivateAlphaChannel,
00036   DiscreteAlphaChannel,
00037   DisassociateAlphaChannel,
00038   ExtractAlphaChannel,
00039   OffAlphaChannel,
00040   OnAlphaChannel,
00041   OpaqueAlphaChannel,
00042   RemoveAlphaChannel,
00043   SetAlphaChannel,
00044   ShapeAlphaChannel,
00045   TransparentAlphaChannel
00046 } AlphaChannelOption;
00047 
00048 typedef enum
00049 {
00050   UndefinedType,
00051   BilevelType,
00052   GrayscaleType,
00053   GrayscaleAlphaType,
00054   PaletteType,
00055   PaletteAlphaType,
00056   TrueColorType,
00057   TrueColorAlphaType,
00058   ColorSeparationType,
00059   ColorSeparationAlphaType,
00060   OptimizeType,
00061   PaletteBilevelAlphaType
00062 } ImageType;
00063 
00064 typedef enum
00065 {
00066   UndefinedInterlace,
00067   NoInterlace,
00068   LineInterlace,
00069   PlaneInterlace,
00070   PartitionInterlace,
00071   GIFInterlace,
00072   JPEGInterlace,
00073   PNGInterlace
00074 } InterlaceType;
00075 
00076 typedef enum
00077 {
00078   UndefinedOrientation,
00079   TopLeftOrientation,
00080   TopRightOrientation,
00081   BottomRightOrientation,
00082   BottomLeftOrientation,
00083   LeftTopOrientation,
00084   RightTopOrientation,
00085   RightBottomOrientation,
00086   LeftBottomOrientation
00087 } OrientationType;
00088 
00089 typedef enum
00090 {
00091   UndefinedResolution,
00092   PixelsPerInchResolution,
00093   PixelsPerCentimeterResolution
00094 } ResolutionType;
00095 
00096 typedef struct _PrimaryInfo
00097 {
00098   double
00099     x,
00100     y,
00101     z;
00102 } PrimaryInfo;
00103 
00104 typedef struct _SegmentInfo
00105 {
00106   double
00107     x1,
00108     y1,
00109     x2,
00110     y2;
00111 } SegmentInfo;
00112 
00113 typedef enum
00114 {
00115   UndefinedTransmitType,
00116   FileTransmitType,
00117   BlobTransmitType,
00118   StreamTransmitType,
00119   ImageTransmitType
00120 } TransmitType;
00121 
00122 typedef struct _ChromaticityInfo
00123 {
00124   PrimaryInfo
00125     red_primary,
00126     green_primary,
00127     blue_primary,
00128     white_point;
00129 } ChromaticityInfo;
00130 
00131 #include "MagickCore/blob.h"
00132 #include "MagickCore/colorspace.h"
00133 #include "MagickCore/cache-view.h"
00134 #include "MagickCore/color.h"
00135 #include "MagickCore/composite.h"
00136 #include "MagickCore/compress.h"
00137 #include "MagickCore/effect.h"
00138 #include "MagickCore/geometry.h"
00139 #include "MagickCore/layer.h"
00140 #include "MagickCore/locale_.h"
00141 #include "MagickCore/monitor.h"
00142 #include "MagickCore/pixel.h"
00143 #include "MagickCore/profile.h"
00144 #include "MagickCore/quantum.h"
00145 #include "MagickCore/resample.h"
00146 #include "MagickCore/resize.h"
00147 #include "MagickCore/semaphore.h"
00148 #include "MagickCore/stream.h"
00149 #include "MagickCore/timer.h"
00150 
00151 struct _Image
00152 {
00153   ClassType
00154     storage_class;
00155 
00156   ColorspaceType
00157     colorspace;         /* colorspace of image data */
00158 
00159   CompressionType
00160     compression;        /* compression of image when read/write */
00161 
00162   size_t
00163     quality;            /* compression quality setting, meaning varies */
00164 
00165   OrientationType
00166     orientation;        /* photo orientation of image */
00167 
00168   MagickBooleanType
00169     taint;              /* has image been modified since reading */
00170 
00171   size_t
00172     columns,            /* physical size of image */
00173     rows,
00174     depth,              /* depth of image on read/write */
00175     colors;             /* Size of color table, or actual color count */
00176                         /* Only valid if image is not DirectClass */
00177 
00178   PixelInfo
00179     *colormap,
00180     alpha_color,        /* deprecated */
00181     background_color,   /* current background color attribute */
00182     border_color,       /* current bordercolor attribute */
00183     transparent_color;  /* color for 'transparent' color index in GIF */
00184 
00185   double
00186     gamma;
00187 
00188   ChromaticityInfo
00189     chromaticity;
00190 
00191   RenderingIntent
00192     rendering_intent;
00193 
00194   void
00195     *profiles;
00196 
00197   ResolutionType
00198     units;          /* resolution/density  ppi or ppc */
00199 
00200   char
00201     *montage,
00202     *directory,
00203     *geometry;
00204 
00205   ssize_t
00206     offset;         /* ??? */
00207 
00208   PointInfo
00209     resolution;     /* image resolution/density */
00210 
00211   RectangleInfo
00212     page,           /* virtual canvas size and offset of image */
00213     extract_info;
00214 
00215   double
00216     fuzz;           /* current color fuzz attribute - move to image_info */
00217 
00218   FilterType
00219     filter;         /* resize/distort filter to apply */
00220 
00221   PixelIntensityMethod
00222     intensity;      /* method to generate an intensity value from a pixel */
00223 
00224   InterlaceType
00225     interlace;
00226 
00227   EndianType
00228     endian;         /* raw data integer ordering on read/write */
00229 
00230   GravityType
00231     gravity;        /* Gravity attribute for positioning in image */
00232 
00233   CompositeOperator
00234     compose;        /* alpha composition method for layered images */
00235 
00236   DisposeType
00237     dispose;        /* GIF animation disposal method */
00238 
00239   size_t
00240     scene,          /* index of image in multi-image file */
00241     delay,          /* Animation delay time */
00242     duration;       /* Total animation duration sum(delay*iterations) */
00243 
00244   ssize_t
00245     ticks_per_second;  /* units for delay time, default 100 for GIF */
00246 
00247   size_t
00248     iterations,        /* number of interations for GIF animations */
00249     total_colors;
00250 
00251   ssize_t
00252     start_loop;        /* ??? */
00253 
00254   PixelInterpolateMethod
00255     interpolate;       /* Interpolation of color for between pixel lookups */
00256 
00257   MagickBooleanType
00258     black_point_compensation;
00259 
00260   RectangleInfo
00261     tile_offset;
00262 
00263   ImageType
00264     type;
00265 
00266   MagickBooleanType
00267     dither;            /* dithering on/off */
00268 
00269   MagickSizeType
00270     extent;            /* Size of image read from disk */
00271 
00272   MagickBooleanType
00273     ping;              /* no image data read, just attributes */
00274 
00275   MagickBooleanType
00276     read_mask,
00277     write_mask;
00278 
00279   PixelTrait
00280     alpha_trait;       /* is transparency channel defined and active */
00281 
00282   size_t
00283     number_channels,
00284     number_meta_channels,
00285     metacontent_extent;
00286 
00287   ChannelType
00288     channel_mask;
00289 
00290   PixelChannelMap
00291     *channel_map;
00292 
00293   void
00294     *cache;
00295 
00296   ErrorInfo
00297     error;
00298 
00299   TimerInfo
00300     timer;
00301 
00302   MagickProgressMonitor
00303     progress_monitor;
00304 
00305   void
00306     *client_data;
00307 
00308   Ascii85Info
00309     *ascii85;
00310 
00311   ProfileInfo
00312     *generic_profile;
00313 
00314   void
00315     *properties,       /* general settings, to save with image */
00316     *artifacts;        /* general operational/coder settings, not saved */
00317 
00318   char
00319     filename[MagickPathExtent],        /* images input filename */
00320     magick_filename[MagickPathExtent], /* given image filename (with read mods) */
00321     magick[MagickPathExtent];          /* images file format (file magic) */
00322 
00323   size_t
00324     magick_columns,     /* size of image when read/created */
00325     magick_rows;
00326 
00327   BlobInfo
00328     *blob;             /* image file as in-memory string of 'extent' */
00329 
00330   time_t
00331     timestamp;
00332 
00333   MagickBooleanType
00334     debug;             /* debug output attribute */
00335 
00336   volatile ssize_t
00337     reference_count;   /* image data sharing memory management */
00338 
00339   SemaphoreInfo
00340     *semaphore;
00341 
00342   struct _ImageInfo
00343     *image_info;       /* (Optional) Image belongs to this ImageInfo 'list'
00344                         * For access to 'global options' when no per-image
00345                         * attribute, properity, or artifact has been set.
00346                         */
00347 
00348   struct _Image
00349     *list,             /* Undo/Redo image processing list (for display) */
00350     *previous,         /* Image list links */
00351     *next;
00352 
00353   size_t
00354     signature;
00355 
00356   PixelInfo
00357     matte_color;        /* current mattecolor attribute */
00358 
00359   MagickBooleanType
00360     composite_mask;
00361 
00362   PixelTrait
00363     mask_trait;       /* apply the clip or composite mask */
00364 
00365   ChannelType
00366     channels;
00367 };
00368 
00369 /*
00370   ImageInfo structure:
00371     Stores an image list, as well as all global settings used by all images
00372     held, -- unless overridden for that specific image.  See SyncImagesettings()
00373     which maps any global setting that always overrides specific image settings.
00374 */
00375 struct _ImageInfo
00376 {
00377   CompressionType
00378     compression;        /* compression method when reading/saving image */
00379 
00380   OrientationType
00381     orientation;        /* orientation setting */
00382 
00383   MagickBooleanType
00384     temporary,          /* image file to be deleted after read "empemeral:" */
00385     adjoin,             /* save images to separate scene files */
00386     affirm,
00387     antialias;
00388 
00389   char
00390     *size,              /* image generation size */
00391     *extract,           /* crop/resize string on image read */
00392     *page,
00393     *scenes;            /* scene numbers that is to be read in */
00394 
00395   size_t
00396     scene,              /* starting value for image save numbering */
00397     number_scenes,      /* total number of images in list - for escapes */
00398     depth;              /* current read/save depth of images */
00399 
00400   InterlaceType
00401     interlace;          /* interlace for image write */
00402 
00403   EndianType
00404     endian;             /* integer endian order for raw image data */
00405 
00406   ResolutionType
00407     units;              /* denisty pixels/inch or pixel/cm */
00408 
00409   size_t
00410     quality;            /* compression quality */
00411 
00412   char
00413     *sampling_factor,   /* JPEG write sampling factor */
00414     *server_name,       /* X windows server name - display/animate */
00415     *font,              /* DUP for draw_info */
00416     *texture,           /* montage/display background tile */
00417     *density;           /* DUP for image and draw_info */
00418 
00419   double
00420     pointsize,
00421     fuzz;               /* current color fuzz attribute */
00422 
00423   PixelInfo
00424     alpha_color,        /* deprecated */
00425     background_color,   /* user set background color */
00426     border_color,       /* user set border color */
00427     transparent_color;  /* color for transparent index in color tables */
00428                         /* NB: fill color is only needed in draw_info! */
00429                         /* the same for undercolor (for font drawing) */
00430 
00431   MagickBooleanType
00432     dither,             /* dither enable-disable */
00433     monochrome;         /* read/write pcl,pdf,ps,xps as monocrome image */
00434 
00435   ColorspaceType
00436     colorspace;
00437 
00438   CompositeOperator
00439     compose;
00440 
00441   ImageType
00442     type;
00443 
00444   MagickBooleanType
00445     ping,                    /* fast read image attributes, not image data */
00446     verbose;                 /* verbose output enable/disable */
00447 
00448   ChannelType
00449     channel;
00450 
00451   void
00452     *options;                /* splay tree of global options */
00453 
00454   void
00455     *profile;
00456 
00457   MagickBooleanType
00458     synchronize;
00459 
00460   MagickProgressMonitor
00461     progress_monitor;
00462 
00463   void
00464     *client_data,
00465     *cache;
00466 
00467   StreamHandler
00468     stream;
00469 
00470   FILE
00471     *file;
00472 
00473   void
00474     *blob;
00475 
00476   size_t
00477     length;
00478 
00479   char
00480     magick[MagickPathExtent],    /* image file format (file magick) */
00481     unique[MagickPathExtent],    /* unique tempory filename - delegates */
00482     filename[MagickPathExtent];  /* filename when reading/writing image */
00483 
00484   MagickBooleanType
00485     debug;
00486 
00487   size_t
00488     signature;
00489 
00490   CustomStreamInfo
00491     *custom_stream;
00492 
00493   PixelInfo
00494     matte_color;        /* matte (frame) color */
00495 };
00496 
00497 extern MagickExport ChannelType
00498   SetImageChannelMask(Image *,const ChannelType);
00499 
00500 extern MagickExport ExceptionType
00501   CatchImageException(Image *);
00502 
00503 extern MagickExport FILE
00504   *GetImageInfoFile(const ImageInfo *);
00505 
00506 extern MagickExport Image
00507   *AcquireImage(const ImageInfo *,ExceptionInfo *),
00508   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
00509   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
00510     ExceptionInfo *),
00511   *DestroyImage(Image *),
00512   *GetImageMask(const Image *,const PixelMask,ExceptionInfo *),
00513   *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
00514     ExceptionInfo *),
00515   *ReferenceImage(Image *),
00516   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
00517     ExceptionInfo *);
00518 
00519 extern MagickExport ImageInfo
00520   *AcquireImageInfo(void),
00521   *CloneImageInfo(const ImageInfo *),
00522   *DestroyImageInfo(ImageInfo *);
00523 
00524 extern MagickExport MagickBooleanType
00525   ClipImage(Image *,ExceptionInfo *),
00526   ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
00527   CopyImagePixels(Image *,const Image *,const RectangleInfo *,
00528     const OffsetInfo *,ExceptionInfo *),
00529   IsTaintImage(const Image *),
00530   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
00531   IsImageObject(const Image *),
00532   ListMagickInfo(FILE *,ExceptionInfo *),
00533   ModifyImage(Image **,ExceptionInfo *),
00534   ResetImagePage(Image *,const char *),
00535   ResetImagePixels(Image *,ExceptionInfo *),
00536   SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
00537   SetImageBackgroundColor(Image *,ExceptionInfo *),
00538   SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
00539   SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
00540   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
00541   SetImageMask(Image *,const PixelMask type,const Image *,ExceptionInfo *),
00542   SetImageRegionMask(Image *,const PixelMask type,const RectangleInfo *,
00543     ExceptionInfo *),
00544   SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
00545   StripImage(Image *,ExceptionInfo *),
00546   SyncImage(Image *,ExceptionInfo *),
00547   SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
00548   SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
00549 
00550 extern MagickExport size_t
00551   InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
00552     ExceptionInfo *);
00553 
00554 extern MagickExport ssize_t
00555   GetImageReferenceCount(Image *);
00556 
00557 extern MagickExport VirtualPixelMethod
00558   GetImageVirtualPixelMethod(const Image *),
00559   SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
00560 
00561 extern MagickExport void
00562   AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
00563   DestroyImagePixels(Image *),
00564   DisassociateImageStream(Image *),
00565   GetImageInfo(ImageInfo *),
00566   SetImageInfoBlob(ImageInfo *,const void *,const size_t),
00567   SetImageInfoFile(ImageInfo *,FILE *),
00568   SetImageInfoCustomStream(ImageInfo *,CustomStreamInfo *);
00569 
00570 #if defined(__cplusplus) || defined(c_plusplus)
00571 }
00572 #endif
00573 
00574 #endif

Generated on 9 Jun 2020 for MagickCore by  doxygen 1.6.1