2 Copyright 1999-2015 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 http://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 #include "MagickCore/color.h"
22 #include "MagickCore/pixel.h"
24 #if defined(__cplusplus) || defined(c_plusplus)
28 #define OpaqueAlpha ((Quantum) QuantumRange)
29 #define TransparentAlpha ((Quantum) 0)
33 UndefinedAlphaChannel,
35 AssociateAlphaChannel,
36 BackgroundAlphaChannel,
38 DeactivateAlphaChannel,
40 DisassociateAlphaChannel,
46 TransparentAlphaChannel
60 ColorSeparationMatteType,
62 PaletteBilevelMatteType
82 BottomRightOrientation,
83 BottomLeftOrientation,
86 RightBottomOrientation,
93 PixelsPerInchResolution,
94 PixelsPerCentimeterResolution
97 typedef struct _PrimaryInfo
105 typedef struct _SegmentInfo
116 UndefinedTransmitType,
123 typedef struct _ChromaticityInfo
132 #include "MagickCore/blob.h"
133 #include "MagickCore/colorspace.h"
134 #include "MagickCore/cache-view.h"
135 #include "MagickCore/color.h"
136 #include "MagickCore/composite.h"
137 #include "MagickCore/compress.h"
138 #include "MagickCore/effect.h"
139 #include "MagickCore/geometry.h"
140 #include "MagickCore/layer.h"
141 #include "MagickCore/locale_.h"
142 #include "MagickCore/monitor.h"
143 #include "MagickCore/pixel.h"
144 #include "MagickCore/profile.h"
145 #include "MagickCore/quantum.h"
146 #include "MagickCore/resample.h"
147 #include "MagickCore/resize.h"
148 #include "MagickCore/semaphore.h"
149 #include "MagickCore/stream.h"
150 #include "MagickCore/timer.h"
158 colorspace; /* colorspace of image data */
161 compression; /* compression of image when read/write */
164 quality; /* compression quality setting, meaning varies */
167 orientation; /* photo orientation of image */
170 taint; /* has image been modified since reading */
173 columns, /* physical size of image */
175 depth, /* depth of image on read/write */
176 colors; /* Size of color table, or actual color count */
177 /* Only valid if image is not DirectClass */
181 background_color, /* current background color attribute */
182 border_color, /* current bordercolor attribute */
183 matte_color, /* current mattecolor attribute */
184 transparent_color; /* color for 'transparent' color index in GIF */
199 units; /* resolution/density ppi or ppc */
210 resolution; /* image resolution/density */
213 page, /* virtual canvas size and offset of image */
217 fuzz; /* current color fuzz attribute - move to image_info */
220 filter; /* resize/distort filter to apply */
223 intensity; /* method to generate an intensity value from a pixel */
229 endian; /* raw data integer ordering on read/write */
232 gravity; /* Gravity attribute for positioning in image */
235 compose; /* alpha composition method for layered images */
238 dispose; /* GIF animation disposal method */
241 scene, /* index of image in multi-image file */
242 delay, /* Animation delay time */
243 duration; /* Total animation duration sum(delay*iterations) */
246 ticks_per_second; /* units for delay time, default 100 for GIF */
249 iterations, /* number of interations for GIF animations */
253 start_loop; /* ??? */
255 PixelInterpolateMethod
256 interpolate; /* Interpolation of color for between pixel lookups */
259 black_point_compensation;
268 dither; /* dithering on/off */
271 extent; /* Size of image read from disk */
274 ping; /* no image data read, just attributes */
281 alpha_trait; /* is transparency channel defined and active */
285 number_meta_channels,
303 MagickProgressMonitor
316 *properties, /* general settings, to save with image */
317 *artifacts; /* general operational/coder settings, not saved */
320 filename[MaxTextExtent], /* images input filename */
321 magick_filename[MaxTextExtent], /* given image filename (with read mods) */
322 magick[MaxTextExtent]; /* images file format (file magic) */
325 magick_columns, /* size of image when read/created */
329 *blob; /* image file as in-memory string of 'extent' */
335 debug; /* debug output attribute */
338 reference_count; /* image data sharing memory management */
343 const struct _ImageInfo
344 *image_info; /* (Optional) Image belongs to this ImageInfo 'list'
345 * For access to 'global options' when no per-image
346 * attribute, properity, or artifact has been set.
347 * It may be set or unset as needed, but never freed.
351 *list, /* Undo/Redo image processing list (for display) */
352 *previous, /* Image list links */
359 /* ImageInfo structure
360 * Stores an image list, as well as all global settings used by
361 * all images held, -- unless overridden for that specific image.
362 * See SyncImagesettings() which maps any global setting that always
363 * overrides specific image settings.
368 compression; /* compression method when reading/saving image */
371 orientation; /* orientation setting */
374 temporary, /* image file to be deleted after read "empemeral:" */
375 adjoin, /* save images to seperate scene files */
380 *size, /* image generation size */
381 *extract, /* crop/resize string on image read */
383 *scenes; /* scene numbers that is to be read in */
386 scene, /* starting value for image save numbering */
387 number_scenes, /* total number of images in list - for escapes */
388 depth; /* current read/save depth of images */
391 interlace; /* interlace for image write */
394 endian; /* integer endian order for raw image data */
397 units; /* denisty pixels/inch or pixel/cm */
400 quality; /* compression quality */
403 *sampling_factor, /* JPEG write sampling factor */
404 *server_name, /* X windows server name - display/animate */
405 *font, /* DUP for draw_info */
406 *texture, /* montage/display background tile */
407 *density; /* DUP for image and draw_info */
411 fuzz; /* current color fuzz attribute */
414 background_color, /* user set background color */
415 border_color, /* user set border color */
416 matte_color, /* matte (frame) color */
417 transparent_color; /* color for transparent index in color tables */
418 /* NB: fill color is only needed in draw_info! */
419 /* the same for undercolor (for font drawing) */
422 dither, /* dither enable-disable */
423 monochrome; /* read/write pcl,pdf,ps,xps as monocrome image */
441 ping, /* fast read image attributes, not image data */
442 verbose; /* verbose output enable/disable */
451 *options; /* splay tree of global options */
459 MagickProgressMonitor
479 magick[MaxTextExtent], /* image file format (file magick) */
480 unique[MaxTextExtent], /* unique tempory filename - delegates */
481 zero[MaxTextExtent], /* unique filename ? - delegates */
482 filename[MaxTextExtent]; /* filename when reading/writing image */
491 extern MagickExport ChannelType
492 SetImageChannelMask(Image *,const ChannelType);
494 extern MagickExport const char
495 DefaultTileGeometry[],
504 extern MagickExport const double
507 extern MagickExport ExceptionType
508 CatchImageException(Image *);
510 extern MagickExport FILE
511 *GetImageInfoFile(const ImageInfo *);
513 extern MagickExport Image
514 *AcquireImage(const ImageInfo *,ExceptionInfo *),
515 *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
516 *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
518 *DestroyImage(Image *),
519 *GetImageMask(const Image *,ExceptionInfo *),
520 *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
522 *ReferenceImage(Image *),
523 *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
526 extern MagickExport ImageInfo
527 *AcquireImageInfo(void),
528 *CloneImageInfo(const ImageInfo *),
529 *DestroyImageInfo(ImageInfo *);
531 extern MagickExport MagickBooleanType
532 ClipImage(Image *,ExceptionInfo *),
533 ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
534 IsTaintImage(const Image *),
535 IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
536 IsImageObject(const Image *),
537 ListMagickInfo(FILE *,ExceptionInfo *),
538 ModifyImage(Image **,ExceptionInfo *),
539 ResetImagePage(Image *,const char *),
540 SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
541 SetImageBackgroundColor(Image *,ExceptionInfo *),
542 SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
543 SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
544 SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
545 SetImageMask(Image *,const Image *,ExceptionInfo *),
546 SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
547 StripImage(Image *,ExceptionInfo *),
548 SyncImage(Image *,ExceptionInfo *),
549 SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
550 SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
552 extern MagickExport size_t
553 InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
556 extern MagickExport ssize_t
557 GetImageReferenceCount(Image *);
559 extern MagickExport VirtualPixelMethod
560 GetImageVirtualPixelMethod(const Image *),
561 SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
563 extern MagickExport void
564 AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
565 DestroyImagePixels(Image *),
566 DisassociateImageStream(Image *),
567 GetImageInfo(ImageInfo *),
568 SetImageInfoBlob(ImageInfo *,const void *,const size_t),
569 SetImageInfoFile(ImageInfo *,FILE *);
571 #if defined(__cplusplus) || defined(c_plusplus)