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