]> granicus.if.org Git - imagemagick/blob - magick/image.h
Horizon validity (anti-aliased) added to Plane2Cylinder
[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/locale_.h"
138 #include "magick/monitor.h"
139 #include "magick/pixel.h"
140 #include "magick/profile.h"
141 #include "magick/quantum.h"
142 #include "magick/resample.h"
143 #include "magick/resize.h"
144 #include "magick/semaphore.h"
145 #include "magick/stream.h"
146 #include "magick/timer.h"
147
148 struct _Image
149 {
150   ClassType
151     storage_class;
152
153   ColorspaceType
154     colorspace;      /* colorspace of image data */
155
156   CompressionType
157     compression;     /* compression of image when read/write */
158
159   size_t
160     quality;         /* compression quality setting, meaning varies */
161
162   OrientationType
163     orientation;     /* photo orientation of image */
164
165   MagickBooleanType
166     taint,           /* has image been modified since reading */
167     matte;           /* is transparency channel defined and active */
168
169   size_t
170     columns,         /* physical size of image */
171     rows,
172     depth,           /* depth of image on read/write */
173     colors;          /* size of color table on read */
174
175   PixelPacket
176     *colormap,
177     background_color, /* current background color attribute */
178     border_color,     /* current bordercolor attribute */
179     matte_color;      /* current mattecolor attribute */
180
181   double
182     gamma;
183
184   ChromaticityInfo
185     chromaticity;
186
187   RenderingIntent
188     rendering_intent;
189
190   void
191     *profiles;
192
193   ResolutionType
194     units;          /* resolution/density  ppi or ppc */
195
196   char
197     *montage,
198     *directory,
199     *geometry;
200
201   ssize_t
202     offset;
203
204   double
205     x_resolution,   /* image resolution/density */
206     y_resolution;
207
208   RectangleInfo
209     page,           /* virtual canvas size and offset of image */
210     extract_info,
211     tile_info;      /* deprecated */
212
213   double
214     bias,
215     blur,           /* deprecated */
216     fuzz;           /* current color fuzz attribute */
217
218   FilterTypes
219     filter;         /* resize/distort filter to apply */
220
221   InterlaceType
222     interlace;
223
224   EndianType
225     endian;         /* raw data integer ordering on read/write */
226
227   GravityType
228     gravity;        /* Gravity attribute for positioning in image */
229
230   CompositeOperator
231     compose;        /* alpha composition method for layered images */
232
233   DisposeType
234     dispose;        /* GIF animation disposal method */
235
236   struct _Image
237     *clip_mask;
238
239   size_t
240     scene,          /* index of image in multi-image file */
241     delay;          /* Animation delay time */
242
243   ssize_t
244     ticks_per_second;  /* units for delay time, default 100 for GIF */
245
246   size_t
247     iterations,
248     total_colors;
249
250   ssize_t
251     start_loop;
252
253   ErrorInfo
254     error;
255
256   TimerInfo
257     timer;
258
259   MagickProgressMonitor
260     progress_monitor;
261
262   void
263     *client_data,
264     *cache,
265     *attributes;      /* deprecated */
266
267   Ascii85Info
268     *ascii85;
269
270   BlobInfo
271     *blob;
272
273   char
274     filename[MaxTextExtent],   /* images input filename */
275     magick_filename[MaxTextExtent],
276     magick[MaxTextExtent];
277
278   size_t
279     magick_columns,
280     magick_rows;
281
282   ExceptionInfo
283     exception;        /* Error handling report */
284
285   MagickBooleanType
286     debug;            /* debug output attribute */
287
288   volatile ssize_t
289     reference_count;
290
291   SemaphoreInfo
292     *semaphore;
293
294   ProfileInfo
295     color_profile,
296     iptc_profile,
297     *generic_profile;
298
299   size_t
300     generic_profiles;  /* this & ProfileInfo is deprecated */
301
302   size_t
303     signature;
304
305   struct _Image
306     *previous,         /* Image sequence list links */
307     *list,
308     *next;
309
310   InterpolatePixelMethod
311     interpolate;       /* Interpolation of color for between pixel lookups */
312
313   MagickBooleanType
314     black_point_compensation;
315
316   PixelPacket
317     transparent_color; /* color for 'transparent' color index in GIF */
318
319   struct _Image
320     *mask;
321
322   RectangleInfo
323     tile_offset;
324
325   void
326     *properties,       /* per image properities */
327     *artifacts;        /* per image sequence image artifacts */
328
329   ImageType
330     type;
331
332   MagickBooleanType
333     dither;            /* dithering method during color reduction */
334
335   MagickSizeType
336     extent;
337
338   MagickBooleanType
339     ping;
340
341   size_t
342     channels;
343 };
344
345 struct _ImageInfo
346 {
347   CompressionType
348     compression;
349
350   OrientationType
351     orientation;
352
353   MagickBooleanType
354     temporary,
355     adjoin,
356     affirm,
357     antialias;
358
359   char
360     *size,
361     *extract,
362     *page,
363     *scenes;
364
365   size_t
366     scene,
367     number_scenes,
368     depth;
369
370   InterlaceType
371     interlace;
372
373   EndianType
374     endian;
375
376   ResolutionType
377     units;
378
379   size_t
380     quality;
381
382   char
383     *sampling_factor,
384     *server_name,
385     *font,
386     *texture,
387     *density;
388
389   double
390     pointsize,
391     fuzz;
392
393   PixelPacket
394     background_color,
395     border_color,
396     matte_color;
397
398   MagickBooleanType
399     dither,
400     monochrome;
401
402   size_t
403     colors;
404
405   ColorspaceType
406     colorspace;
407
408   ImageType
409     type;
410
411   PreviewType
412     preview_type;
413
414   ssize_t
415     group;
416
417   MagickBooleanType
418     ping,
419     verbose;
420
421   char
422     *view,
423     *authenticate;
424
425   ChannelType
426     channel;
427
428   Image
429     *attributes;  /* deprecated */
430
431   void
432     *options;
433
434   MagickProgressMonitor
435     progress_monitor;
436
437   void
438     *client_data,
439     *cache;
440
441   StreamHandler
442     stream;
443
444   FILE
445     *file;
446
447   void
448     *blob;
449
450   size_t
451     length;
452
453   char
454     magick[MaxTextExtent],
455     unique[MaxTextExtent],
456     zero[MaxTextExtent],
457     filename[MaxTextExtent];
458
459   MagickBooleanType
460     debug;
461
462   char
463     *tile;  /* deprecated */
464
465   size_t
466     subimage,  /* deprecated */
467     subrange;  /* deprecated */
468
469   PixelPacket
470     pen;  /* deprecated */
471
472   size_t
473     signature;
474
475   VirtualPixelMethod
476     virtual_pixel_method;
477
478   PixelPacket
479     transparent_color;
480
481   void
482     *profile;
483
484   MagickBooleanType
485     synchronize;
486 };
487
488 extern MagickExport ExceptionType
489   CatchImageException(Image *);
490
491 extern MagickExport FILE
492   *GetImageInfoFile(const ImageInfo *);
493
494 extern MagickExport Image
495   *AcquireImage(const ImageInfo *),
496   *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
497   *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
498     ExceptionInfo *),
499   *CombineImages(const Image *,const ChannelType,ExceptionInfo *),
500   *DestroyImage(Image *),
501   *GetImageClipMask(const Image *,ExceptionInfo *),
502   *GetImageMask(const Image *,ExceptionInfo *),
503   *NewMagickImage(const ImageInfo *,const size_t,const size_t,
504     const MagickPixelPacket *),
505   *ReferenceImage(Image *),
506   *SeparateImages(const Image *,const ChannelType,ExceptionInfo *),
507   *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
508     ExceptionInfo *);
509
510 extern MagickExport ImageInfo
511   *AcquireImageInfo(void),
512   *CloneImageInfo(const ImageInfo *),
513   *DestroyImageInfo(ImageInfo *);
514
515 extern MagickExport MagickBooleanType
516   ClipImage(Image *),
517   ClipImagePath(Image *,const char *,const MagickBooleanType),
518   GetImageAlphaChannel(const Image *),
519   IsTaintImage(const Image *),
520   IsMagickConflict(const char *),
521   IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
522   IsImageObject(const Image *),
523   ListMagickInfo(FILE *,ExceptionInfo *),
524   ModifyImage(Image **,ExceptionInfo *),
525   ResetImagePage(Image *,const char *),
526   SeparateImageChannel(Image *,const ChannelType),
527   SetImageAlphaChannel(Image *,const AlphaChannelType),
528   SetImageBackgroundColor(Image *),
529   SetImageClipMask(Image *,const Image *),
530   SetImageColor(Image *,const MagickPixelPacket *),
531   SetImageExtent(Image *,const size_t,const size_t),
532   SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
533   SetImageMask(Image *,const Image *),
534   SetImageOpacity(Image *,const Quantum),
535   SetImageChannels(Image *,const size_t),
536   SetImageStorageClass(Image *,const ClassType),
537   SetImageType(Image *,const ImageType),
538   StripImage(Image *),
539   SyncImage(Image *),
540   SyncImageSettings(const ImageInfo *,Image *),
541   SyncImagesSettings(ImageInfo *,Image *);
542
543 extern MagickExport size_t
544   InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *);
545
546 extern MagickExport ssize_t
547   GetImageReferenceCount(Image *);
548
549 extern MagickExport size_t
550   GetImageChannels(Image *);
551
552 extern MagickExport VirtualPixelMethod
553   GetImageVirtualPixelMethod(const Image *),
554   SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod);
555
556 extern MagickExport void
557   AcquireNextImage(const ImageInfo *,Image *),
558   DestroyImagePixels(Image *),
559   DisassociateImageStream(Image *),
560   GetImageException(Image *,ExceptionInfo *),
561   GetImageInfo(ImageInfo *),
562   SetImageInfoBlob(ImageInfo *,const void *,const size_t),
563   SetImageInfoFile(ImageInfo *,FILE *);
564
565 #if defined(__cplusplus) || defined(c_plusplus)
566 }
567 #endif
568
569 #endif