Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:58:52

0001 /*
0002   Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
0003   dedicated to making software imaging solutions freely available.
0004 
0005   You may not use this file except in compliance with the License.  You may
0006   obtain a copy of the License at
0007 
0008     https://imagemagick.org/script/license.php
0009 
0010   Unless required by applicable law or agreed to in writing, software
0011   distributed under the License is distributed on an "AS IS" BASIS,
0012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013   See the License for the specific language governing permissions and
0014   limitations under the License.
0015 
0016   MagickCore image methods.
0017 */
0018 #ifndef MAGICKCORE_IMAGE_H
0019 #define MAGICKCORE_IMAGE_H
0020 
0021 #if defined(__cplusplus) || defined(c_plusplus)
0022 extern "C" {
0023 #endif
0024 
0025 #define OpaqueAlpha  ((Quantum) QuantumRange)
0026 #define TransparentAlpha  ((Quantum) 0)
0027 
0028 typedef enum
0029 {
0030   UndefinedType,
0031   BilevelType,
0032   GrayscaleType,
0033   GrayscaleAlphaType,
0034   PaletteType,
0035   PaletteAlphaType,
0036   TrueColorType,
0037   TrueColorAlphaType,
0038   ColorSeparationType,
0039   ColorSeparationAlphaType,
0040   OptimizeType,
0041   PaletteBilevelAlphaType
0042 } ImageType;
0043 
0044 typedef enum
0045 {
0046   UndefinedInterlace,
0047   NoInterlace,
0048   LineInterlace,
0049   PlaneInterlace,
0050   PartitionInterlace,
0051   GIFInterlace,
0052   JPEGInterlace,
0053   PNGInterlace
0054 } InterlaceType;
0055 
0056 typedef enum
0057 {
0058   UndefinedOrientation,
0059   TopLeftOrientation,
0060   TopRightOrientation,
0061   BottomRightOrientation,
0062   BottomLeftOrientation,
0063   LeftTopOrientation,
0064   RightTopOrientation,
0065   RightBottomOrientation,
0066   LeftBottomOrientation
0067 } OrientationType;
0068 
0069 typedef enum
0070 {
0071   UndefinedResolution,
0072   PixelsPerInchResolution,
0073   PixelsPerCentimeterResolution
0074 } ResolutionType;
0075 
0076 typedef struct _PrimaryInfo
0077 {
0078   double
0079     x,
0080     y,
0081     z;
0082 } PrimaryInfo;
0083 
0084 typedef struct _SegmentInfo
0085 {
0086   double
0087     x1,
0088     y1,
0089     x2,
0090     y2;
0091 } SegmentInfo;
0092 
0093 typedef enum
0094 {
0095   UndefinedTransmitType,
0096   FileTransmitType,
0097   BlobTransmitType,
0098   StreamTransmitType,
0099   ImageTransmitType
0100 } TransmitType;
0101 
0102 typedef struct _ChromaticityInfo
0103 {
0104   PrimaryInfo
0105     red_primary,
0106     green_primary,
0107     blue_primary,
0108     white_point;
0109 } ChromaticityInfo;
0110 
0111 #include "MagickCore/blob.h"
0112 #include "MagickCore/colorspace.h"
0113 #include "MagickCore/cache-view.h"
0114 #include "MagickCore/color.h"
0115 #include "MagickCore/composite.h"
0116 #include "MagickCore/compress.h"
0117 #include "MagickCore/effect.h"
0118 #include "MagickCore/geometry.h"
0119 #include "MagickCore/layer.h"
0120 #include "MagickCore/locale_.h"
0121 #include "MagickCore/monitor.h"
0122 #include "MagickCore/pixel.h"
0123 #include "MagickCore/profile.h"
0124 #include "MagickCore/quantum.h"
0125 #include "MagickCore/resample.h"
0126 #include "MagickCore/resize.h"
0127 #include "MagickCore/semaphore.h"
0128 #include "MagickCore/stream.h"
0129 #include "MagickCore/timer.h"
0130 
0131 struct _Image
0132 {
0133   ClassType
0134     storage_class;
0135 
0136   ColorspaceType
0137     colorspace;         /* colorspace of image data */
0138 
0139   CompressionType
0140     compression;        /* compression of image when read/write */
0141 
0142   size_t
0143     quality;            /* compression quality setting, meaning varies */
0144 
0145   OrientationType
0146     orientation;        /* photo orientation of image */
0147 
0148   MagickBooleanType
0149     taint;              /* has image been modified since reading */
0150 
0151   size_t
0152     columns,            /* physical size of image */
0153     rows,
0154     depth,              /* depth of image on read/write */
0155     colors;             /* Size of color table, or actual color count */
0156                         /* Only valid if image is not DirectClass */
0157 
0158   PixelInfo
0159     *colormap,
0160     alpha_color,        /* deprecated */
0161     background_color,   /* current background color attribute */
0162     border_color,       /* current bordercolor attribute */
0163     transparent_color;  /* color for 'transparent' color index in GIF */
0164 
0165   double
0166     gamma;
0167 
0168   ChromaticityInfo
0169     chromaticity;
0170 
0171   RenderingIntent
0172     rendering_intent;
0173 
0174   void
0175     *profiles;
0176 
0177   ResolutionType
0178     units;          /* resolution/density  ppi or ppc */
0179 
0180   char
0181     *montage,
0182     *directory,
0183     *geometry;
0184 
0185   ssize_t
0186     offset;         /* ??? */
0187 
0188   PointInfo
0189     resolution;     /* image resolution/density */
0190 
0191   RectangleInfo
0192     page,           /* virtual canvas size and offset of image */
0193     extract_info;
0194 
0195   double
0196     fuzz;           /* current color fuzz attribute - move to image_info */
0197 
0198   FilterType
0199     filter;         /* resize/distort filter to apply */
0200 
0201   PixelIntensityMethod
0202     intensity;      /* method to generate an intensity value from a pixel */
0203 
0204   InterlaceType
0205     interlace;
0206 
0207   EndianType
0208     endian;         /* raw data integer ordering on read/write */
0209 
0210   GravityType
0211     gravity;        /* Gravity attribute for positioning in image */
0212 
0213   CompositeOperator
0214     compose;        /* alpha composition method for layered images */
0215 
0216   DisposeType
0217     dispose;        /* GIF animation disposal method */
0218 
0219   size_t
0220     scene,          /* index of image in multi-image file */
0221     delay,          /* Animation delay time */
0222     duration;       /* Total animation duration sum(delay*iterations) */
0223 
0224   ssize_t
0225     ticks_per_second;  /* units for delay time, default 100 for GIF */
0226 
0227   size_t
0228     iterations,        /* number of interactions for GIF animations */
0229     total_colors;
0230 
0231   ssize_t
0232     start_loop;        /* ??? */
0233 
0234   PixelInterpolateMethod
0235     interpolate;       /* Interpolation of color for between pixel lookups */
0236 
0237   MagickBooleanType
0238     black_point_compensation;
0239 
0240   RectangleInfo
0241     tile_offset;
0242 
0243   ImageType
0244     type;
0245 
0246   MagickBooleanType
0247     dither;            /* dithering on/off */
0248 
0249   MagickSizeType
0250     extent;            /* Size of image read from disk */
0251 
0252   MagickBooleanType
0253     ping;              /* no image data read, just attributes */
0254 
0255   MagickBooleanType
0256     read_mask,
0257     write_mask;
0258 
0259   PixelTrait
0260     alpha_trait;       /* is transparency channel defined and active */
0261 
0262   size_t
0263     number_channels,
0264     number_meta_channels,
0265     metacontent_extent;
0266 
0267   ChannelType
0268     channel_mask;
0269 
0270   PixelChannelMap
0271     *channel_map;
0272 
0273   void
0274     *cache;
0275 
0276   ErrorInfo
0277     error;
0278 
0279   TimerInfo
0280     timer;
0281 
0282   MagickProgressMonitor
0283     progress_monitor;
0284 
0285   void
0286     *client_data;
0287 
0288   Ascii85Info
0289     *ascii85;
0290 
0291   ProfileInfo
0292     *generic_profile;
0293 
0294   void
0295     *properties,       /* general settings, to save with image */
0296     *artifacts;        /* general operational/coder settings, not saved */
0297 
0298   char
0299     filename[MagickPathExtent],        /* images input filename */
0300     magick_filename[MagickPathExtent], /* given image filename (with read mods) */
0301     magick[MagickPathExtent];          /* images file format (file magic) */
0302 
0303   size_t
0304     magick_columns,     /* size of image when read/created */
0305     magick_rows;
0306 
0307   BlobInfo
0308     *blob;             /* image file as in-memory string of 'extent' */
0309 
0310   time_t
0311     timestamp;
0312 
0313   MagickBooleanType
0314     debug;             /* debug output attribute */
0315 
0316   ssize_t
0317     reference_count;   /* image data sharing memory management */
0318 
0319   SemaphoreInfo
0320     *semaphore;
0321 
0322   struct _ImageInfo
0323     *image_info;       /* (Optional) Image belongs to this ImageInfo 'list'
0324                         * For access to 'global options' when no per-image
0325                         * attribute, prosperity, or artifact has been set.
0326                         */
0327 
0328   struct _Image
0329     *list,             /* Undo/Redo image processing list (for display) */
0330     *previous,         /* Image list links */
0331     *next;
0332 
0333   size_t
0334     signature;
0335 
0336   PixelInfo
0337     matte_color;        /* current mattecolor attribute */
0338 
0339   MagickBooleanType
0340     composite_mask;
0341 
0342   PixelTrait
0343     mask_trait;       /* apply the clip or composite mask */
0344 
0345   ChannelType
0346     channels;
0347 
0348   time_t
0349     ttl;
0350 };
0351 
0352 /*
0353   ImageInfo structure:
0354     Stores an image list, as well as all global settings used by all images
0355     held, -- unless overridden for that specific image.  See SyncImagesettings()
0356     which maps any global setting that always overrides specific image settings.
0357 */
0358 struct _ImageInfo
0359 {
0360   CompressionType
0361     compression;        /* compression method when reading/saving image */
0362 
0363   OrientationType
0364     orientation;        /* orientation setting */
0365 
0366   MagickBooleanType
0367     temporary,          /* image file to be deleted after read "ephemeral:" */
0368     adjoin,             /* save images to separate scene files */
0369     affirm,
0370     antialias;
0371 
0372   char
0373     *size,              /* image generation size */
0374     *extract,           /* crop/resize string on image read */
0375     *page,
0376     *scenes;            /* scene numbers that is to be read in */
0377 
0378   size_t
0379     scene,              /* starting value for image save numbering */
0380     number_scenes,      /* total number of images in list - for escapes */
0381     depth;              /* current read/save depth of images */
0382 
0383   InterlaceType
0384     interlace;          /* interlace for image write */
0385 
0386   EndianType
0387     endian;             /* integer endian order for raw image data */
0388 
0389   ResolutionType
0390     units;              /* density pixels/inch or pixel/cm */
0391 
0392   size_t
0393     quality;            /* compression quality */
0394 
0395   char
0396     *sampling_factor,   /* Chroma subsampling ratio string */
0397     *server_name,       /* X windows server name - display/animate */
0398     *font,              /* DUP for draw_info */
0399     *texture,           /* montage/display background tile */
0400     *density;           /* DUP for image and draw_info */
0401 
0402   double
0403     pointsize,
0404     fuzz;               /* current color fuzz attribute */
0405 
0406   PixelInfo
0407     alpha_color,        /* deprecated */
0408     background_color,   /* user set background color */
0409     border_color,       /* user set border color */
0410     transparent_color;  /* color for transparent index in color tables */
0411                         /* NB: fill color is only needed in draw_info! */
0412                         /* the same for undercolor (for font drawing) */
0413 
0414   MagickBooleanType
0415     dither,             /* dither enable-disable */
0416     monochrome;         /* read/write pcl,pdf,ps,xps as monochrome image */
0417 
0418   ColorspaceType
0419     colorspace;
0420 
0421   CompositeOperator
0422     compose;
0423 
0424   ImageType
0425     type;
0426 
0427   MagickBooleanType
0428     ping,                    /* fast read image attributes, not image data */
0429     verbose;                 /* verbose output enable/disable */
0430 
0431   ChannelType
0432     channel;
0433 
0434   void
0435     *options;                /* splay tree of global options */
0436 
0437   void
0438     *profile;
0439 
0440   MagickBooleanType
0441     synchronize;
0442 
0443   MagickProgressMonitor
0444     progress_monitor;
0445 
0446   void
0447     *client_data,
0448     *cache;
0449 
0450   StreamHandler
0451     stream;
0452 
0453   FILE
0454     *file;
0455 
0456   void
0457     *blob;
0458 
0459   size_t
0460     length;
0461 
0462   char
0463     magick[MagickPathExtent],    /* image file format (file magick) */
0464     unique[MagickPathExtent],    /* unique temporary filename - delegates */
0465     filename[MagickPathExtent];  /* filename when reading/writing image */
0466 
0467   MagickBooleanType
0468     debug;
0469 
0470   size_t
0471     signature;
0472 
0473   CustomStreamInfo
0474     *custom_stream;
0475 
0476   PixelInfo
0477     matte_color;        /* matte (frame) color */
0478 };
0479 
0480 extern MagickExport ChannelType
0481   SetImageChannelMask(Image *,const ChannelType);
0482 
0483 extern MagickExport ExceptionType
0484   CatchImageException(Image *);
0485 
0486 extern MagickExport FILE
0487   *GetImageInfoFile(const ImageInfo *);
0488 
0489 extern MagickExport Image
0490   *AcquireImage(const ImageInfo *,ExceptionInfo *),
0491   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
0492   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
0493     ExceptionInfo *),
0494   *DestroyImage(Image *),
0495   *GetImageMask(const Image *,const PixelMask,ExceptionInfo *),
0496   *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
0497     ExceptionInfo *),
0498   *ReferenceImage(Image *),
0499   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
0500     ExceptionInfo *);
0501 
0502 extern MagickExport ImageInfo
0503   *AcquireImageInfo(void),
0504   *CloneImageInfo(const ImageInfo *),
0505   *DestroyImageInfo(ImageInfo *);
0506 
0507 extern MagickExport MagickBooleanType
0508   ClipImage(Image *,ExceptionInfo *),
0509   ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
0510   CopyImagePixels(Image *,const Image *,const RectangleInfo *,
0511     const OffsetInfo *,ExceptionInfo *),
0512   IsTaintImage(const Image *),
0513   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
0514   IsImageObject(const Image *),
0515   ListMagickInfo(FILE *,ExceptionInfo *),
0516   ModifyImage(Image **,ExceptionInfo *),
0517   ResetImagePage(Image *,const char *),
0518   ResetImagePixels(Image *,ExceptionInfo *),
0519   SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
0520   SetImageBackgroundColor(Image *,ExceptionInfo *),
0521   SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
0522   SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
0523   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
0524   SetImageMask(Image *,const PixelMask type,const Image *,ExceptionInfo *),
0525   SetImageRegionMask(Image *,const PixelMask type,const RectangleInfo *,
0526     ExceptionInfo *),
0527   SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
0528   StripImage(Image *,ExceptionInfo *),
0529   SyncImage(Image *,ExceptionInfo *),
0530   SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
0531   SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
0532 
0533 extern MagickExport size_t
0534   InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
0535     ExceptionInfo *);
0536 
0537 extern MagickExport ssize_t
0538   GetImageReferenceCount(Image *);
0539 
0540 extern MagickExport VirtualPixelMethod
0541   GetImageVirtualPixelMethod(const Image *),
0542   SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
0543 
0544 extern MagickExport void
0545   AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
0546   DestroyImagePixels(Image *),
0547   DisassociateImageStream(Image *),
0548   GetImageInfo(ImageInfo *),
0549   SetImageInfoBlob(ImageInfo *,const void *,const size_t),
0550   SetImageInfoFile(ImageInfo *,FILE *),
0551   SetImageInfoCustomStream(ImageInfo *,CustomStreamInfo *);
0552 
0553 #if defined(__cplusplus) || defined(c_plusplus)
0554 }
0555 #endif
0556 
0557 #endif