]> granicus.if.org Git - imagemagick/blob - magick/image.h
minor note
[imagemagick] / magick / image.h
1 /*
2   Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
3   dedicated to making software imaging solutions freely available.
4   
5   You may not use this file except in compliance with the License.
6   obtain a copy of the License at
7   
8     http://www.imagemagick.org/script/license.php
9   
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.
15
16   MagickCore image methods.
17 */
18 #ifndef _MAGICKCORE_IMAGE_H
19 #define _MAGICKCORE_IMAGE_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 #include <magick/color.h>
26
27 #define OpaqueOpacity  ((Quantum) 0UL)
28 #define TransparentOpacity  ((Quantum) QuantumRange)
29
30 typedef enum
31 {
32   UndefinedAlphaChannel,
33   ActivateAlphaChannel,
34   BackgroundAlphaChannel,
35   CopyAlphaChannel,
36   DeactivateAlphaChannel,
37   ExtractAlphaChannel,
38   OpaqueAlphaChannel,
39   ResetAlphaChannel,  /* deprecated */
40   SetAlphaChannel,
41   ShapeAlphaChannel,
42   TransparentAlphaChannel
43 } AlphaChannelType;
44
45 typedef enum
46 {
47   UndefinedType,
48   BilevelType,
49   GrayscaleType,
50   GrayscaleMatteType,
51   PaletteType,
52   PaletteMatteType,
53   TrueColorType,
54   TrueColorMatteType,
55   ColorSeparationType,
56   ColorSeparationMatteType,
57   OptimizeType,
58   PaletteBilevelMatteType
59 } ImageType;
60
61 typedef enum
62 {
63   UndefinedInterlace,
64   NoInterlace,
65   LineInterlace,
66   PlaneInterlace,
67   PartitionInterlace,
68   GIFInterlace,
69   JPEGInterlace,
70   PNGInterlace
71 } InterlaceType;
72
73 typedef enum
74 {
75   UndefinedOrientation,
76   TopLeftOrientation,
77   TopRightOrientation,
78   BottomRightOrientation,
79   BottomLeftOrientation,
80   LeftTopOrientation,
81   RightTopOrientation,
82   RightBottomOrientation,
83   LeftBottomOrientation
84 } OrientationType;
85
86 typedef enum
87 {
88   UndefinedResolution,
89   PixelsPerInchResolution,
90   PixelsPerCentimeterResolution
91 } ResolutionType;
92
93 typedef struct _PrimaryInfo
94 {
95   double
96     x,
97     y,
98     z;
99 } PrimaryInfo;
100
101 typedef struct _SegmentInfo
102 {
103   double
104     x1,
105     y1,
106     x2,
107     y2;
108 } SegmentInfo;
109
110 typedef enum
111 {
112   UndefinedTransmitType,
113   FileTransmitType,
114   BlobTransmitType,
115   StreamTransmitType,
116   ImageTransmitType
117 } TransmitType;
118
119 typedef struct _ChromaticityInfo
120 {
121   PrimaryInfo
122     red_primary,
123     green_primary,
124     blue_primary,
125     white_point;
126 } ChromaticityInfo;
127
128 #include "magick/blob.h"
129 #include "magick/colorspace.h"
130 #include "magick/cache-view.h"
131 #include "magick/color.h"
132 #include "magick/composite.h"
133 #include "magick/compress.h"
134 #include "magick/effect.h"
135 #include "magick/geometry.h"
136 #include "magick/layer.h"
137 #include "magick/monitor.h"
138 #include "magick/pixel.h"
139 #include "magick/profile.h"
140 #include "magick/quantum.h"
141 #include "magick/resample.h"
142 #include "magick/resize.h"
143 #include "magick/semaphore.h"
144 #include "magick/stream.h"
145 #include "magick/timer.h"
146
147 struct _Image
148 {
149   ClassType
150     storage_class;
151
152   ColorspaceType
153     colorspace;      /* colorspace of image data */
154
155   CompressionType
156     compression;     /* compression of image when read/write */
157
158   size_t
159     quality;         /* compression quality setting, meaning varies */
160
161   OrientationType
162     orientation;     /* photo orientation of image */
163
164   MagickBooleanType
165     taint,           /* has image been modified since reading */
166     matte;           /* is transparency channel defined and active */
167
168   size_t
169     columns,         /* physical size of image */
170     rows,
171     depth,           /* depth of image on read/write */
172     colors;          /* size of color table on read */
173
174   PixelPacket
175     *colormap,
176     background_color, /* current background color attribute */
177     border_color,     /* current bordercolor attribute */
178     matte_color;      /* current mattecolor attribute */
179
180   double
181     gamma;
182
183   ChromaticityInfo
184     chromaticity;
185
186   RenderingIntent
187     rendering_intent;
188
189   void
190     *profiles;
191
192   ResolutionType
193     units;          /* resolution/density  ppi or ppc */
194
195   char
196     *montage,
197     *directory,
198     *geometry;
199
200   ssize_t
201     offset;
202
203   double
204     x_resolution,   /* image resolution/density */
205     y_resolution;
206
207   RectangleInfo
208     page,           /* virtual canvas size and offset of image */
209     extract_info,
210     tile_info;      /* deprecated */
211
212   double
213     bias,
214     blur,           /* deprecated */
215     fuzz;           /* current color fuzz attribute */
216
217   FilterTypes
218     filter;         /* resize/distort filter to apply */
219
220   InterlaceType
221     interlace;
222
223   EndianType
224     endian;         /* raw data integer ordering on read/write */
225
226   GravityType
227     gravity;        /* Gravity attribute for positioning in image */
228
229   CompositeOperator
230     compose;        /* alpha composition method for layered images */
231
232   DisposeType
233     dispose;        /* GIF animation disposal method */
234
235   struct _Image
236     *clip_mask;
237
238   size_t
239     scene,          /* index of image in multi-image file */
240     delay;          /* Animation delay time */
241
242   ssize_t
243     ticks_per_second;  /* units for delay time, default 100 for GIF */
244
245   size_t
246     iterations,
247     total_colors;
248
249   ssize_t
250     start_loop;
251
252   ErrorInfo
253     error;
254
255   TimerInfo
256     timer;
257
258   MagickProgressMonitor
259     progress_monitor;
260
261   void
262     *client_data,
263     *cache,
264     *attributes;      /* deprecated */
265
266   Ascii85Info
267     *ascii85;
268
269   BlobInfo
270     *blob;
271
272   char
273     filename[MaxTextExtent],   /* images input filename */
274     magick_filename[MaxTextExtent],
275     magick[MaxTextExtent];
276
277   size_t
278     magick_columns,
279     magick_rows;
280
281   ExceptionInfo
282     exception;        /* Error handling report */
283
284   MagickBooleanType
285     debug;            /* debug output attribute */
286
287   volatile ssize_t
288     reference_count;
289
290   SemaphoreInfo
291     *semaphore;
292
293   ProfileInfo
294     color_profile,
295     iptc_profile,
296     *generic_profile;
297
298   size_t
299     generic_profiles;  /* this & ProfileInfo is deprecated */
300
301   size_t
302     signature;
303
304   struct _Image
305     *previous,         /* Image sequence list links */
306     *list,
307     *next;
308
309   InterpolatePixelMethod
310     interpolate;       /* Interpolation of color for between pixel lookups */
311
312   MagickBooleanType
313     black_point_compensation;
314
315   PixelPacket
316     transparent_color; /* color for 'transparent' color index in GIF */
317
318   struct _Image
319     *mask;
320
321   RectangleInfo
322     tile_offset;
323
324   void
325     *properties,       /* per image properities */
326     *artifacts;        /* per image sequence image artifacts */
327
328   ImageType
329     type;
330
331   MagickBooleanType
332     dither;            /* dithering method during color reduction */
333
334   MagickSizeType
335     extent;
336
337   MagickBooleanType
338     ping;
339 };
340
341
342 struct _ImageInfo
343 {
344   CompressionType
345     compression;
346
347   OrientationType
348     orientation;
349
350   MagickBooleanType
351     temporary,
352     adjoin,
353     affirm,
354     antialias;
355
356   char
357     *size,
358     *extract,
359     *page,
360     *scenes;
361
362   size_t
363     scene,
364     number_scenes,
365     depth;
366
367   InterlaceType
368     interlace;
369
370   EndianType
371     endian;
372
373   ResolutionType
374     units;
375
376   size_t
377     quality;
378
379   char
380     *sampling_factor,
381     *server_name,
382     *font,
383     *texture,
384     *density;
385
386   double
387     pointsize,
388     fuzz;
389
390   PixelPacket
391     background_color,
392     border_color,
393     matte_color;
394
395   MagickBooleanType
396     dither,
397     monochrome;
398
399   size_t
400     colors;
401
402   ColorspaceType
403     colorspace;
404
405   ImageType
406     type;
407
408   PreviewType
409     preview_type;
410
411   ssize_t
412     group;
413
414   MagickBooleanType
415     ping,
416     verbose;
417
418   char
419     *view,
420     *authenticate;
421
422   ChannelType
423     channel;
424
425   Image
426     *attributes;  /* deprecated */
427
428   void
429     *options;
430
431   MagickProgressMonitor
432     progress_monitor;
433
434   void
435     *client_data,
436     *cache;
437
438   StreamHandler
439     stream;
440
441   FILE
442     *file;
443
444   void
445     *blob;
446
447   size_t
448     length;
449
450   char
451     magick[MaxTextExtent],
452     unique[MaxTextExtent],
453     zero[MaxTextExtent],
454     filename[MaxTextExtent];
455
456   MagickBooleanType
457     debug;
458
459   char
460     *tile;  /* deprecated */
461
462   size_t
463     subimage,  /* deprecated */
464     subrange;  /* deprecated */
465
466   PixelPacket
467     pen;  /* deprecated */
468
469   size_t
470     signature;
471
472   VirtualPixelMethod
473     virtual_pixel_method;
474
475   PixelPacket
476     transparent_color;
477
478   void
479     *profile;
480
481   MagickBooleanType
482     synchronize;
483 };
484
485 extern MagickExport ExceptionType
486   CatchImageException(Image *);
487
488 extern MagickExport FILE
489   *GetImageInfoFile(const ImageInfo *);
490
491 extern MagickExport Image
492   *AcquireImage(const ImageInfo *),
493   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
494   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
495     ExceptionInfo *),
496   *CombineImages(const Image *,const ChannelType,ExceptionInfo *),
497   *DestroyImage(Image *),
498   *GetImageClipMask(const Image *,ExceptionInfo *),
499   *GetImageMask(const Image *,ExceptionInfo *),
500   *NewMagickImage(const ImageInfo *,const size_t,const size_t,
501     const MagickPixelPacket *),
502   *ReferenceImage(Image *),
503   *SeparateImages(const Image *,const ChannelType,ExceptionInfo *),
504   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
505     ExceptionInfo *);
506
507 extern MagickExport ImageInfo
508   *AcquireImageInfo(void),
509   *CloneImageInfo(const ImageInfo *),
510   *DestroyImageInfo(ImageInfo *);
511
512 extern MagickExport MagickBooleanType
513   ClipImage(Image *),
514   ClipImagePath(Image *,const char *,const MagickBooleanType),
515   GetImageAlphaChannel(const Image *),
516   IsTaintImage(const Image *),
517   IsMagickConflict(const char *),
518   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
519   IsImageObject(const Image *),
520   ListMagickInfo(FILE *,ExceptionInfo *),
521   ModifyImage(Image **,ExceptionInfo *),
522   ResetImagePage(Image *,const char *),
523   SeparateImageChannel(Image *,const ChannelType),
524   SetImageAlphaChannel(Image *,const AlphaChannelType),
525   SetImageBackgroundColor(Image *),
526   SetImageClipMask(Image *,const Image *),
527   SetImageColor(Image *,const MagickPixelPacket *),
528   SetImageExtent(Image *,const size_t,const size_t),
529   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
530   SetImageMask(Image *,const Image *),
531   SetImageOpacity(Image *,const Quantum),
532   SetImageStorageClass(Image *,const ClassType),
533   SetImageType(Image *,const ImageType),
534   StripImage(Image *),
535   SyncImage(Image *),
536   SyncImageSettings(const ImageInfo *,Image *),
537   SyncImagesSettings(ImageInfo *,Image *);
538
539 extern MagickExport size_t
540   InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *);
541
542 extern MagickExport ssize_t
543   GetImageReferenceCount(Image *);
544
545 extern MagickExport VirtualPixelMethod
546   GetImageVirtualPixelMethod(const Image *),
547   SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod);
548
549 extern MagickExport void
550   AcquireNextImage(const ImageInfo *,Image *),
551   DestroyImagePixels(Image *),
552   DisassociateImageStream(Image *),
553   GetImageException(Image *,ExceptionInfo *),
554   GetImageInfo(ImageInfo *),
555   SetImageInfoBlob(ImageInfo *,const void *,const size_t),
556   SetImageInfoFile(ImageInfo *,FILE *);
557
558 #if defined(__cplusplus) || defined(c_plusplus)
559 }
560 #endif
561
562 #endif