2 Copyright 1999-2017 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 */
362 Stores an image list, as well as all global settings used by all images
363 held, -- unless overridden for that specific image. See SyncImagesettings()
364 which maps any global setting that always overrides specific image settings.
369 compression; /* compression method when reading/saving image */
372 orientation; /* orientation setting */
375 temporary, /* image file to be deleted after read "empemeral:" */
376 adjoin, /* save images to separate scene files */
381 *size, /* image generation size */
382 *extract, /* crop/resize string on image read */
384 *scenes; /* scene numbers that is to be read in */
387 scene, /* starting value for image save numbering */
388 number_scenes, /* total number of images in list - for escapes */
389 depth; /* current read/save depth of images */
392 interlace; /* interlace for image write */
395 endian; /* integer endian order for raw image data */
398 units; /* denisty pixels/inch or pixel/cm */
401 quality; /* compression quality */
404 *sampling_factor, /* JPEG write sampling factor */
405 *server_name, /* X windows server name - display/animate */
406 *font, /* DUP for draw_info */
407 *texture, /* montage/display background tile */
408 *density; /* DUP for image and draw_info */
412 fuzz; /* current color fuzz attribute */
415 alpha_color, /* deprecated */
416 background_color, /* user set background color */
417 border_color, /* user set border color */
418 transparent_color; /* color for transparent index in color tables */
419 /* NB: fill color is only needed in draw_info! */
420 /* the same for undercolor (for font drawing) */
423 dither, /* dither enable-disable */
424 monochrome; /* read/write pcl,pdf,ps,xps as monocrome image */
436 ping, /* fast read image attributes, not image data */
437 verbose; /* verbose output enable/disable */
443 *options; /* splay tree of global options */
451 MagickProgressMonitor
471 magick[MagickPathExtent], /* image file format (file magick) */
472 unique[MagickPathExtent], /* unique tempory filename - delegates */
473 filename[MagickPathExtent]; /* filename when reading/writing image */
485 matte_color; /* matte (frame) color */
488 extern MagickExport ChannelType
489 SetImageChannelMask(Image *,const ChannelType);
491 extern MagickExport const char
492 DefaultTileGeometry[],
501 extern MagickExport const double
504 extern MagickExport ExceptionType
505 CatchImageException(Image *);
507 extern MagickExport FILE
508 *GetImageInfoFile(const ImageInfo *);
510 extern MagickExport Image
511 *AcquireImage(const ImageInfo *,ExceptionInfo *),
512 *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
513 *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
515 *DestroyImage(Image *),
516 *GetImageMask(const Image *,const PixelMask,ExceptionInfo *),
517 *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
519 *ReferenceImage(Image *),
520 *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
523 extern MagickExport ImageInfo
524 *AcquireImageInfo(void),
525 *CloneImageInfo(const ImageInfo *),
526 *DestroyImageInfo(ImageInfo *);
528 extern MagickExport MagickBooleanType
529 ClipImage(Image *,ExceptionInfo *),
530 ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
531 CopyImagePixels(Image *,const Image *,const RectangleInfo *,
532 const OffsetInfo *,ExceptionInfo *),
533 IsTaintImage(const Image *),
534 IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
535 IsImageObject(const Image *),
536 ListMagickInfo(FILE *,ExceptionInfo *),
537 ModifyImage(Image **,ExceptionInfo *),
538 ResetImagePage(Image *,const char *),
539 SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
540 SetImageBackgroundColor(Image *,ExceptionInfo *),
541 SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
542 SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
543 SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
544 SetImageMask(Image *,const PixelMask type,const Image *,ExceptionInfo *),
545 SetImageRegionMask(Image *,const PixelMask type,const RectangleInfo *,
547 SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
548 StripImage(Image *,ExceptionInfo *),
549 SyncImage(Image *,ExceptionInfo *),
550 SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
551 SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
553 extern MagickExport size_t
554 InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
557 extern MagickExport ssize_t
558 GetImageReferenceCount(Image *);
560 extern MagickExport VirtualPixelMethod
561 GetImageVirtualPixelMethod(const Image *),
562 SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
564 extern MagickExport void
565 AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
566 DestroyImagePixels(Image *),
567 DisassociateImageStream(Image *),
568 GetImageInfo(ImageInfo *),
569 SetImageInfoBlob(ImageInfo *,const void *,const size_t),
570 SetImageInfoFile(ImageInfo *,FILE *),
571 SetImageInfoCustomStream(ImageInfo *,CustomStreamInfo *);
573 #if defined(__cplusplus) || defined(c_plusplus)