2 Copyright 1999-2018 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 https://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore image methods.
18 #ifndef MAGICKCORE_IMAGE_H
19 #define MAGICKCORE_IMAGE_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #define OpaqueAlpha ((Quantum) QuantumRange)
26 #define TransparentAlpha ((Quantum) 0)
30 UndefinedAlphaChannel,
32 AssociateAlphaChannel,
33 BackgroundAlphaChannel,
35 DeactivateAlphaChannel,
37 DisassociateAlphaChannel,
45 TransparentAlphaChannel
59 ColorSeparationAlphaType,
61 PaletteBilevelAlphaType
81 BottomRightOrientation,
82 BottomLeftOrientation,
85 RightBottomOrientation,
92 PixelsPerInchResolution,
93 PixelsPerCentimeterResolution
96 typedef struct _PrimaryInfo
104 typedef struct _SegmentInfo
115 UndefinedTransmitType,
122 typedef struct _ChromaticityInfo
131 #include "MagickCore/blob.h"
132 #include "MagickCore/colorspace.h"
133 #include "MagickCore/cache-view.h"
134 #include "MagickCore/color.h"
135 #include "MagickCore/composite.h"
136 #include "MagickCore/compress.h"
137 #include "MagickCore/effect.h"
138 #include "MagickCore/geometry.h"
139 #include "MagickCore/layer.h"
140 #include "MagickCore/locale_.h"
141 #include "MagickCore/monitor.h"
142 #include "MagickCore/pixel.h"
143 #include "MagickCore/profile.h"
144 #include "MagickCore/quantum.h"
145 #include "MagickCore/resample.h"
146 #include "MagickCore/resize.h"
147 #include "MagickCore/semaphore.h"
148 #include "MagickCore/stream.h"
149 #include "MagickCore/timer.h"
157 colorspace; /* colorspace of image data */
160 compression; /* compression of image when read/write */
163 quality; /* compression quality setting, meaning varies */
166 orientation; /* photo orientation of image */
169 taint; /* has image been modified since reading */
172 columns, /* physical size of image */
174 depth, /* depth of image on read/write */
175 colors; /* Size of color table, or actual color count */
176 /* Only valid if image is not DirectClass */
180 alpha_color, /* deprecated */
181 background_color, /* current background color attribute */
182 border_color, /* current bordercolor attribute */
183 transparent_color; /* color for 'transparent' color index in GIF */
198 units; /* resolution/density ppi or ppc */
209 resolution; /* image resolution/density */
212 page, /* virtual canvas size and offset of image */
216 fuzz; /* current color fuzz attribute - move to image_info */
219 filter; /* resize/distort filter to apply */
222 intensity; /* method to generate an intensity value from a pixel */
228 endian; /* raw data integer ordering on read/write */
231 gravity; /* Gravity attribute for positioning in image */
234 compose; /* alpha composition method for layered images */
237 dispose; /* GIF animation disposal method */
240 scene, /* index of image in multi-image file */
241 delay, /* Animation delay time */
242 duration; /* Total animation duration sum(delay*iterations) */
245 ticks_per_second; /* units for delay time, default 100 for GIF */
248 iterations, /* number of interations for GIF animations */
252 start_loop; /* ??? */
254 PixelInterpolateMethod
255 interpolate; /* Interpolation of color for between pixel lookups */
258 black_point_compensation;
267 dither; /* dithering on/off */
270 extent; /* Size of image read from disk */
273 ping; /* no image data read, just attributes */
280 alpha_trait; /* is transparency channel defined and active */
284 number_meta_channels,
302 MagickProgressMonitor
315 *properties, /* general settings, to save with image */
316 *artifacts; /* general operational/coder settings, not saved */
319 filename[MagickPathExtent], /* images input filename */
320 magick_filename[MagickPathExtent], /* given image filename (with read mods) */
321 magick[MagickPathExtent]; /* images file format (file magic) */
324 magick_columns, /* size of image when read/created */
328 *blob; /* image file as in-memory string of 'extent' */
334 debug; /* debug output attribute */
337 reference_count; /* image data sharing memory management */
343 *image_info; /* (Optional) Image belongs to this ImageInfo 'list'
344 * For access to 'global options' when no per-image
345 * attribute, properity, or artifact has been set.
349 *list, /* Undo/Redo image processing list (for display) */
350 *previous, /* Image list links */
357 matte_color; /* current mattecolor attribute */
363 mask_trait; /* apply the clip or composite mask */
371 Stores an image list, as well as all global settings used by all images
372 held, -- unless overridden for that specific image. See SyncImagesettings()
373 which maps any global setting that always overrides specific image settings.
378 compression; /* compression method when reading/saving image */
381 orientation; /* orientation setting */
384 temporary, /* image file to be deleted after read "empemeral:" */
385 adjoin, /* save images to separate scene files */
390 *size, /* image generation size */
391 *extract, /* crop/resize string on image read */
393 *scenes; /* scene numbers that is to be read in */
396 scene, /* starting value for image save numbering */
397 number_scenes, /* total number of images in list - for escapes */
398 depth; /* current read/save depth of images */
401 interlace; /* interlace for image write */
404 endian; /* integer endian order for raw image data */
407 units; /* denisty pixels/inch or pixel/cm */
410 quality; /* compression quality */
413 *sampling_factor, /* JPEG write sampling factor */
414 *server_name, /* X windows server name - display/animate */
415 *font, /* DUP for draw_info */
416 *texture, /* montage/display background tile */
417 *density; /* DUP for image and draw_info */
421 fuzz; /* current color fuzz attribute */
424 alpha_color, /* deprecated */
425 background_color, /* user set background color */
426 border_color, /* user set border color */
427 transparent_color; /* color for transparent index in color tables */
428 /* NB: fill color is only needed in draw_info! */
429 /* the same for undercolor (for font drawing) */
432 dither, /* dither enable-disable */
433 monochrome; /* read/write pcl,pdf,ps,xps as monocrome image */
445 ping, /* fast read image attributes, not image data */
446 verbose; /* verbose output enable/disable */
452 *options; /* splay tree of global options */
460 MagickProgressMonitor
480 magick[MagickPathExtent], /* image file format (file magick) */
481 unique[MagickPathExtent], /* unique tempory filename - delegates */
482 filename[MagickPathExtent]; /* filename when reading/writing image */
494 matte_color; /* matte (frame) color */
497 extern MagickExport ChannelType
498 SetImageChannelMask(Image *,const ChannelType);
500 extern MagickExport const char
501 DefaultTileGeometry[],
510 extern MagickExport const double
513 extern MagickExport ExceptionType
514 CatchImageException(Image *);
516 extern MagickExport FILE
517 *GetImageInfoFile(const ImageInfo *);
519 extern MagickExport Image
520 *AcquireImage(const ImageInfo *,ExceptionInfo *),
521 *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
522 *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
524 *DestroyImage(Image *),
525 *GetImageMask(const Image *,const PixelMask,ExceptionInfo *),
526 *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
528 *ReferenceImage(Image *),
529 *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
532 extern MagickExport ImageInfo
533 *AcquireImageInfo(void),
534 *CloneImageInfo(const ImageInfo *),
535 *DestroyImageInfo(ImageInfo *);
537 extern MagickExport MagickBooleanType
538 ClipImage(Image *,ExceptionInfo *),
539 ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
540 CopyImagePixels(Image *,const Image *,const RectangleInfo *,
541 const OffsetInfo *,ExceptionInfo *),
542 IsTaintImage(const Image *),
543 IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
544 IsImageObject(const Image *),
545 ListMagickInfo(FILE *,ExceptionInfo *),
546 ModifyImage(Image **,ExceptionInfo *),
547 ResetImagePage(Image *,const char *),
548 ResetImagePixels(Image *,ExceptionInfo *),
549 SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
550 SetImageBackgroundColor(Image *,ExceptionInfo *),
551 SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
552 SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
553 SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
554 SetImageMask(Image *,const PixelMask type,const Image *,ExceptionInfo *),
555 SetImageRegionMask(Image *,const PixelMask type,const RectangleInfo *,
557 SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
558 StripImage(Image *,ExceptionInfo *),
559 SyncImage(Image *,ExceptionInfo *),
560 SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
561 SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
563 extern MagickExport size_t
564 InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
567 extern MagickExport ssize_t
568 GetImageReferenceCount(Image *);
570 extern MagickExport VirtualPixelMethod
571 GetImageVirtualPixelMethod(const Image *),
572 SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
574 extern MagickExport void
575 AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
576 DestroyImagePixels(Image *),
577 DisassociateImageStream(Image *),
578 GetImageInfo(ImageInfo *),
579 SetImageInfoBlob(ImageInfo *,const void *,const size_t),
580 SetImageInfoFile(ImageInfo *,FILE *),
581 SetImageInfoCustomStream(ImageInfo *,CustomStreamInfo *);
583 #if defined(__cplusplus) || defined(c_plusplus)