]> granicus.if.org Git - imagemagick/blob - magick/image.h
(no commit message)
[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   size_t
341     channels;
342 };
343
344 struct _ImageInfo
345 {
346   CompressionType
347     compression;
348
349   OrientationType
350     orientation;
351
352   MagickBooleanType
353     temporary,
354     adjoin,
355     affirm,
356     antialias;
357
358   char
359     *size,
360     *extract,
361     *page,
362     *scenes;
363
364   size_t
365     scene,
366     number_scenes,
367     depth;
368
369   InterlaceType
370     interlace;
371
372   EndianType
373     endian;
374
375   ResolutionType
376     units;
377
378   size_t
379     quality;
380
381   char
382     *sampling_factor,
383     *server_name,
384     *font,
385     *texture,
386     *density;
387
388   double
389     pointsize,
390     fuzz;
391
392   PixelPacket
393     background_color,
394     border_color,
395     matte_color;
396
397   MagickBooleanType
398     dither,
399     monochrome;
400
401   size_t
402     colors;
403
404   ColorspaceType
405     colorspace;
406
407   ImageType
408     type;
409
410   PreviewType
411     preview_type;
412
413   ssize_t
414     group;
415
416   MagickBooleanType
417     ping,
418     verbose;
419
420   char
421     *view,
422     *authenticate;
423
424   ChannelType
425     channel;
426
427   Image
428     *attributes;  /* deprecated */
429
430   void
431     *options;
432
433   MagickProgressMonitor
434     progress_monitor;
435
436   void
437     *client_data,
438     *cache;
439
440   StreamHandler
441     stream;
442
443   FILE
444     *file;
445
446   void
447     *blob;
448
449   size_t
450     length;
451
452   char
453     magick[MaxTextExtent],
454     unique[MaxTextExtent],
455     zero[MaxTextExtent],
456     filename[MaxTextExtent];
457
458   MagickBooleanType
459     debug;
460
461   char
462     *tile;  /* deprecated */
463
464   size_t
465     subimage,  /* deprecated */
466     subrange;  /* deprecated */
467
468   PixelPacket
469     pen;  /* deprecated */
470
471   size_t
472     signature;
473
474   VirtualPixelMethod
475     virtual_pixel_method;
476
477   PixelPacket
478     transparent_color;
479
480   void
481     *profile;
482
483   MagickBooleanType
484     synchronize;
485 };
486
487 extern MagickExport ExceptionType
488   CatchImageException(Image *);
489
490 extern MagickExport FILE
491   *GetImageInfoFile(const ImageInfo *);
492
493 extern MagickExport Image
494   *AcquireImage(const ImageInfo *),
495   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
496   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
497     ExceptionInfo *),
498   *CombineImages(const Image *,const ChannelType,ExceptionInfo *),
499   *DestroyImage(Image *),
500   *GetImageClipMask(const Image *,ExceptionInfo *),
501   *GetImageMask(const Image *,ExceptionInfo *),
502   *NewMagickImage(const ImageInfo *,const size_t,const size_t,
503     const MagickPixelPacket *),
504   *ReferenceImage(Image *),
505   *SeparateImages(const Image *,const ChannelType,ExceptionInfo *),
506   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
507     ExceptionInfo *);
508
509 extern MagickExport ImageInfo
510   *AcquireImageInfo(void),
511   *CloneImageInfo(const ImageInfo *),
512   *DestroyImageInfo(ImageInfo *);
513
514 extern MagickExport MagickBooleanType
515   ClipImage(Image *),
516   ClipImagePath(Image *,const char *,const MagickBooleanType),
517   GetImageAlphaChannel(const Image *),
518   IsTaintImage(const Image *),
519   IsMagickConflict(const char *),
520   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
521   IsImageObject(const Image *),
522   ListMagickInfo(FILE *,ExceptionInfo *),
523   ModifyImage(Image **,ExceptionInfo *),
524   ResetImagePage(Image *,const char *),
525   SeparateImageChannel(Image *,const ChannelType),
526   SetImageAlphaChannel(Image *,const AlphaChannelType),
527   SetImageBackgroundColor(Image *),
528   SetImageClipMask(Image *,const Image *),
529   SetImageColor(Image *,const MagickPixelPacket *),
530   SetImageExtent(Image *,const size_t,const size_t),
531   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
532   SetImageMask(Image *,const Image *),
533   SetImageOpacity(Image *,const Quantum),
534   SetImageChannels(Image *,const size_t),
535   SetImageStorageClass(Image *,const ClassType),
536   SetImageType(Image *,const ImageType),
537   StripImage(Image *),
538   SyncImage(Image *),
539   SyncImageSettings(const ImageInfo *,Image *),
540   SyncImagesSettings(ImageInfo *,Image *);
541
542 extern MagickExport size_t
543   InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *);
544
545 extern MagickExport ssize_t
546   GetImageReferenceCount(Image *);
547
548 extern MagickExport size_t
549   GetImageChannels(Image *);
550
551 extern MagickExport VirtualPixelMethod
552   GetImageVirtualPixelMethod(const Image *),
553   SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod);
554
555 extern MagickExport void
556   AcquireNextImage(const ImageInfo *,Image *),
557   DestroyImagePixels(Image *),
558   DisassociateImageStream(Image *),
559   GetImageException(Image *,ExceptionInfo *),
560   GetImageInfo(ImageInfo *),
561   SetImageInfoBlob(ImageInfo *,const void *,const size_t),
562   SetImageInfoFile(ImageInfo *,FILE *);
563
564 #if defined(__cplusplus) || defined(c_plusplus)
565 }
566 #endif
567
568 #endif