Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:41

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