2 Copyright 1999-2014 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 BackgroundAlphaChannel,
37 DeactivateAlphaChannel,
43 TransparentAlphaChannel
57 ColorSeparationMatteType,
59 PaletteBilevelMatteType
79 BottomRightOrientation,
80 BottomLeftOrientation,
83 RightBottomOrientation,
90 PixelsPerInchResolution,
91 PixelsPerCentimeterResolution
94 typedef struct _PrimaryInfo
102 typedef struct _SegmentInfo
113 UndefinedTransmitType,
120 typedef struct _ChromaticityInfo
129 #include "MagickCore/blob.h"
130 #include "MagickCore/colorspace.h"
131 #include "MagickCore/cache-view.h"
132 #include "MagickCore/color.h"
133 #include "MagickCore/composite.h"
134 #include "MagickCore/compress.h"
135 #include "MagickCore/effect.h"
136 #include "MagickCore/geometry.h"
137 #include "MagickCore/layer.h"
138 #include "MagickCore/locale_.h"
139 #include "MagickCore/monitor.h"
140 #include "MagickCore/pixel.h"
141 #include "MagickCore/profile.h"
142 #include "MagickCore/quantum.h"
143 #include "MagickCore/resample.h"
144 #include "MagickCore/resize.h"
145 #include "MagickCore/semaphore.h"
146 #include "MagickCore/stream.h"
147 #include "MagickCore/timer.h"
155 colorspace; /* colorspace of image data */
158 compression; /* compression of image when read/write */
161 quality; /* compression quality setting, meaning varies */
164 orientation; /* photo orientation of image */
167 taint; /* has image been modified since reading */
170 columns, /* physical size of image */
172 depth, /* depth of image on read/write */
173 colors; /* Size of color table, or actual color count */
174 /* Only valid if image is not DirectClass */
178 background_color, /* current background color attribute */
179 border_color, /* current bordercolor attribute */
180 matte_color, /* current mattecolor attribute */
181 transparent_color; /* color for 'transparent' color index in GIF */
196 units; /* resolution/density ppi or ppc */
207 resolution; /* image resolution/density */
210 page, /* virtual canvas size and offset of image */
214 fuzz; /* current color fuzz attribute - move to image_info */
217 filter; /* resize/distort filter to apply */
220 intensity; /* method to generate an intensity value from a pixel */
226 endian; /* raw data integer ordering on read/write */
229 gravity; /* Gravity attribute for positioning in image */
232 compose; /* alpha composition method for layered images */
235 dispose; /* GIF animation disposal method */
238 scene, /* index of image in multi-image file */
239 delay, /* Animation delay time */
240 duration; /* Total animation duration sum(delay*iterations) */
243 ticks_per_second; /* units for delay time, default 100 for GIF */
246 iterations, /* number of interations for GIF animations */
250 start_loop; /* ??? */
252 PixelInterpolateMethod
253 interpolate; /* Interpolation of color for between pixel lookups */
256 black_point_compensation;
265 dither; /* dithering on/off */
268 extent; /* Size of image read from disk */
271 ping; /* no image data read, just attributes */
278 alpha_trait; /* is transparency channel defined and active */
282 number_meta_channels,
300 MagickProgressMonitor
313 *properties, /* general settings, to save with image */
314 *artifacts; /* general operational/coder settings, not saved */
317 filename[MaxTextExtent], /* images input filename */
318 magick_filename[MaxTextExtent], /* given image filename (with read mods) */
319 magick[MaxTextExtent]; /* images file format (file magic) */
322 magick_columns, /* size of image when read/created */
326 *blob; /* image file as in-memory string of 'extent' */
332 debug; /* debug output attribute */
335 reference_count; /* image data sharing memory management */
340 const struct _ImageInfo
341 *image_info; /* (Optional) Image belongs to this ImageInfo 'list'
342 * For access to 'global options' when no per-image
343 * attribute, properity, or artifact has been set.
344 * It may be set or unset as needed, but never freed.
348 *list, /* Undo/Redo image processing list (for display) */
349 *previous, /* Image list links */
356 /* ImageInfo structure
357 * Stores an image list, as well as all global settings used by
358 * all images held, -- unless overridden for that specific image.
359 * See SyncImagesettings() which maps any global setting that always
360 * overrides specific image settings.
365 compression; /* compression method when reading/saving image */
368 orientation; /* orientation setting */
371 temporary, /* image file to be deleted after read "empemeral:" */
372 adjoin, /* save images to seperate scene files */
377 *size, /* image generation size */
378 *extract, /* crop/resize string on image read */
380 *scenes; /* scene numbers that is to be read in */
383 scene, /* starting value for image save numbering */
384 number_scenes, /* total number of images in list - for escapes */
385 depth; /* current read/save depth of images */
388 interlace; /* interlace for image write */
391 endian; /* integer endian order for raw image data */
394 units; /* denisty pixels/inch or pixel/cm */
397 quality; /* compression quality */
400 *sampling_factor, /* JPEG write sampling factor */
401 *server_name, /* X windows server name - display/animate */
402 *font, /* DUP for draw_info */
403 *texture, /* montage/display background tile */
404 *density; /* DUP for image and draw_info */
408 fuzz; /* current color fuzz attribute */
411 background_color, /* user set background color */
412 border_color, /* user set border color */
413 matte_color, /* matte (frame) color */
414 transparent_color; /* color for transparent index in color tables */
415 /* NB: fill color is only needed in draw_info! */
416 /* the same for undercolor (for font drawing) */
419 dither, /* dither enable-disable */
420 monochrome; /* read/write pcl,pdf,ps,xps as monocrome image */
438 ping, /* fast read image attributes, not image data */
439 verbose; /* verbose output enable/disable */
448 *options; /* splay tree of global options */
456 MagickProgressMonitor
476 magick[MaxTextExtent], /* image file format (file magick) */
477 unique[MaxTextExtent], /* unique tempory filename - delegates */
478 zero[MaxTextExtent], /* unique filename ? - delegates */
479 filename[MaxTextExtent]; /* filename when reading/writing image */
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 *GetImageClipMask(const Image *,ExceptionInfo *),
517 *GetImageMask(const Image *,ExceptionInfo *),
518 *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *,
520 *ReferenceImage(Image *),
521 *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
524 extern MagickExport ImageInfo
525 *AcquireImageInfo(void),
526 *CloneImageInfo(const ImageInfo *),
527 *DestroyImageInfo(ImageInfo *);
529 extern MagickExport MagickBooleanType
530 ClipImage(Image *,ExceptionInfo *),
531 ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *),
532 IsTaintImage(const Image *),
533 IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
534 IsImageObject(const Image *),
535 ListMagickInfo(FILE *,ExceptionInfo *),
536 ModifyImage(Image **,ExceptionInfo *),
537 ResetImagePage(Image *,const char *),
538 SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
539 SetImageBackgroundColor(Image *,ExceptionInfo *),
540 SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
541 SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
542 SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
543 SetImageMask(Image *,const Image *,ExceptionInfo *),
544 SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
545 StripImage(Image *,ExceptionInfo *),
546 SyncImage(Image *,ExceptionInfo *),
547 SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *),
548 SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *);
550 extern MagickExport size_t
551 InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *,
554 extern MagickExport ssize_t
555 GetImageReferenceCount(Image *);
557 extern MagickExport VirtualPixelMethod
558 GetImageVirtualPixelMethod(const Image *),
559 SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
561 extern MagickExport void
562 AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *),
563 DestroyImagePixels(Image *),
564 DisassociateImageStream(Image *),
565 GetImageInfo(ImageInfo *),
566 SetImageInfoBlob(ImageInfo *,const void *,const size_t),
567 SetImageInfoFile(ImageInfo *,FILE *);
569 #if defined(__cplusplus) || defined(c_plusplus)