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,
48 TransparentAlphaChannel
62 ColorSeparationMatteType,
64 PaletteBilevelMatteType
84 BottomRightOrientation,
85 BottomLeftOrientation,
88 RightBottomOrientation,
95 PixelsPerInchResolution,
96 PixelsPerCentimeterResolution
99 typedef struct _PrimaryInfo
107 typedef struct _SegmentInfo
118 UndefinedTransmitType,
125 typedef struct _ChromaticityInfo
134 #include "MagickCore/blob.h"
135 #include "MagickCore/colorspace.h"
136 #include "MagickCore/cache-view.h"
137 #include "MagickCore/color.h"
138 #include "MagickCore/composite.h"
139 #include "MagickCore/compress.h"
140 #include "MagickCore/effect.h"
141 #include "MagickCore/geometry.h"
142 #include "MagickCore/layer.h"
143 #include "MagickCore/locale_.h"
144 #include "MagickCore/monitor.h"
145 #include "MagickCore/pixel.h"
146 #include "MagickCore/profile.h"
147 #include "MagickCore/quantum.h"
148 #include "MagickCore/resample.h"
149 #include "MagickCore/resize.h"
150 #include "MagickCore/semaphore.h"
151 #include "MagickCore/stream.h"
152 #include "MagickCore/timer.h"
160 colorspace; /* colorspace of image data */
163 compression; /* compression of image when read/write */
166 quality; /* compression quality setting, meaning varies */
169 orientation; /* photo orientation of image */
172 taint; /* has image been modified since reading */
175 columns, /* physical size of image */
177 depth, /* depth of image on read/write */
178 colors; /* Size of color table, or actual color count */
179 /* Only valid if image is not DirectClass */
183 background_color, /* current background color attribute */
184 border_color, /* current bordercolor attribute */
185 matte_color, /* current mattecolor attribute */
186 transparent_color; /* color for 'transparent' color index in GIF */
201 units; /* resolution/density ppi or ppc */
212 resolution; /* image resolution/density */
215 page, /* virtual canvas size and offset of image */
219 fuzz; /* current color fuzz attribute - move to image_info */
222 filter; /* resize/distort filter to apply */
225 intensity; /* method to generate an intensity value from a pixel */
231 endian; /* raw data integer ordering on read/write */
234 gravity; /* Gravity attribute for positioning in image */
237 compose; /* alpha composition method for layered images */
240 dispose; /* GIF animation disposal method */
243 scene, /* index of image in multi-image file */
244 delay, /* Animation delay time */
245 duration; /* Total animation duration sum(delay*iterations) */
248 ticks_per_second; /* units for delay time, default 100 for GIF */
251 iterations, /* number of interations for GIF animations */
255 start_loop; /* ??? */
257 PixelInterpolateMethod
258 interpolate; /* Interpolation of color for between pixel lookups */
261 black_point_compensation;
270 dither; /* dithering on/off */
273 extent; /* Size of image read from disk */
276 ping; /* no image data read, just attributes */
283 alpha_trait; /* is transparency channel defined and active */
287 number_meta_channels,
305 MagickProgressMonitor
318 *properties, /* general settings, to save with image */
319 *artifacts; /* general operational/coder settings, not saved */
322 filename[MaxTextExtent], /* images input filename */
323 magick_filename[MaxTextExtent], /* given image filename (with read mods) */
324 magick[MaxTextExtent]; /* images file format (file magic) */
327 magick_columns, /* size of image when read/created */
331 *blob; /* image file as in-memory string of 'extent' */
337 debug; /* debug output attribute */
340 reference_count; /* image data sharing memory management */
345 const struct _ImageInfo
346 *image_info; /* (Optional) Image belongs to this ImageInfo 'list'
347 * For access to 'global options' when no per-image
348 * attribute, properity, or artifact has been set.
349 * It may be set or unset as needed, but never freed.
353 *list, /* Undo/Redo image processing list (for display) */
354 *previous, /* Image list links */
361 /* ImageInfo structure
362 * Stores an image list, as well as all global settings used by
363 * all images held, -- unless overridden for that specific image.
364 * See SyncImagesettings() which maps any global setting that always
365 * overrides specific image settings.
370 compression; /* compression method when reading/saving image */
373 orientation; /* orientation setting */
376 temporary, /* image file to be deleted after read "empemeral:" */
377 adjoin, /* save images to seperate scene files */
382 *size, /* image generation size */
383 *extract, /* crop/resize string on image read */
385 *scenes; /* scene numbers that is to be read in */
388 scene, /* starting value for image save numbering */
389 number_scenes, /* total number of images in list - for escapes */
390 depth; /* current read/save depth of images */
393 interlace; /* interlace for image write */
396 endian; /* integer endian order for raw image data */
399 units; /* denisty pixels/inch or pixel/cm */
402 quality; /* compression quality */
405 *sampling_factor, /* JPEG write sampling factor */
406 *server_name, /* X windows server name - display/animate */
407 *font, /* DUP for draw_info */
408 *texture, /* montage/display background tile */
409 *density; /* DUP for image and draw_info */
413 fuzz; /* current color fuzz attribute */
416 background_color, /* user set background color */
417 border_color, /* user set border color */
418 matte_color, /* matte (frame) color */
419 transparent_color; /* color for transparent index in color tables */
420 /* NB: fill color is only needed in draw_info! */
421 /* the same for undercolor (for font drawing) */
424 dither, /* dither enable-disable */
425 monochrome; /* read/write pcl,pdf,ps,xps as monocrome image */
443 ping, /* fast read image attributes, not image data */
444 verbose; /* verbose output enable/disable */
453 *options; /* splay tree of global options */
461 MagickProgressMonitor
481 magick[MaxTextExtent], /* image file format (file magick) */
482 unique[MaxTextExtent], /* unique tempory filename - delegates */
483 zero[MaxTextExtent], /* unique filename ? - delegates */
484 filename[MaxTextExtent]; /* filename when reading/writing image */
493 extern MagickExport ChannelType
494 SetImageChannelMask(Image *,const ChannelType);
496 extern MagickExport const char
497 DefaultTileGeometry[],
506 extern MagickExport const double
509 extern MagickExport ExceptionType
510 CatchImageException(Image *);
512 extern MagickExport FILE
513 *GetImageInfoFile(const ImageInfo *);
515 extern MagickExport Image
516 *AcquireImage(const ImageInfo *,ExceptionInfo *),
517 *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
518 *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
520 *DestroyImage(Image *),
521 *GetImageMask(const Image *,ExceptionInfo *),
522 *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
524 *ReferenceImage(Image *),
525 *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
528 extern MagickExport ImageInfo
529 *AcquireImageInfo(void),
530 *CloneImageInfo(const ImageInfo *),
531 *DestroyImageInfo(ImageInfo *);
533 extern MagickExport MagickBooleanType
534 ClipImage(Image *,ExceptionInfo *),
535 ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
536 IsTaintImage(const Image *),
537 IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
538 IsImageObject(const Image *),
539 ListMagickInfo(FILE *,ExceptionInfo *),
540 ModifyImage(Image **,ExceptionInfo *),
541 ResetImagePage(Image *,const char *),
542 SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
543 SetImageBackgroundColor(Image *,ExceptionInfo *),
544 SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
545 SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
546 SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
547 SetImageMask(Image *,const Image *,ExceptionInfo *),
548 SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
549 StripImage(Image *,ExceptionInfo *),
550 SyncImage(Image *,ExceptionInfo *),
551 SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
552 SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
554 extern MagickExport size_t
555 InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
558 extern MagickExport ssize_t
559 GetImageReferenceCount(Image *);
561 extern MagickExport VirtualPixelMethod
562 GetImageVirtualPixelMethod(const Image *),
563 SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
565 extern MagickExport void
566 AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
567 DestroyImagePixels(Image *),
568 DisassociateImageStream(Image *),
569 GetImageInfo(ImageInfo *),
570 SetImageInfoBlob(ImageInfo *,const void *,const size_t),
571 SetImageInfoFile(ImageInfo *,FILE *);
573 #if defined(__cplusplus) || defined(c_plusplus)