MagickCore  6.9.13-25
Convert, Edit, Or Compose Bitmap Images
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  UndefinedType,
33  BilevelType,
34  GrayscaleType,
35  GrayscaleMatteType,
36  PaletteType,
37  PaletteMatteType,
38  TrueColorType,
39  TrueColorMatteType,
40  ColorSeparationType,
41  ColorSeparationMatteType,
42  OptimizeType,
43  PaletteBilevelMatteType
44 } ImageType;
45 
46 typedef enum
47 {
48  UndefinedInterlace,
49  NoInterlace,
50  LineInterlace,
51  PlaneInterlace,
52  PartitionInterlace,
53  GIFInterlace,
54  JPEGInterlace,
55  PNGInterlace
56 } InterlaceType;
57 
58 typedef enum
59 {
60  UndefinedOrientation,
61  TopLeftOrientation,
62  TopRightOrientation,
63  BottomRightOrientation,
64  BottomLeftOrientation,
65  LeftTopOrientation,
66  RightTopOrientation,
67  RightBottomOrientation,
68  LeftBottomOrientation
69 } OrientationType;
70 
71 typedef enum
72 {
73  UndefinedResolution,
74  PixelsPerInchResolution,
75  PixelsPerCentimeterResolution
76 } ResolutionType;
77 
78 typedef struct _PrimaryInfo
79 {
80  double
81  x,
82  y,
83  z;
84 } PrimaryInfo;
85 
86 typedef struct _SegmentInfo
87 {
88  double
89  x1,
90  y1,
91  x2,
92  y2;
93 } SegmentInfo;
94 
95 typedef enum
96 {
97  UndefinedTransmitType,
98  FileTransmitType,
99  BlobTransmitType,
100  StreamTransmitType,
101  ImageTransmitType
102 } TransmitType;
103 
104 typedef struct _ChromaticityInfo
105 {
107  red_primary,
108  green_primary,
109  blue_primary,
110  white_point;
112 
113 #include "magick/blob.h"
114 #include "magick/colorspace.h"
115 #include "magick/cache-view.h"
116 #include "magick/color.h"
117 #include "magick/composite.h"
118 #include "magick/compress.h"
119 #include "magick/effect.h"
120 #include "magick/geometry.h"
121 #include "magick/layer.h"
122 #include "magick/locale_.h"
123 #include "magick/monitor.h"
124 #include "magick/pixel.h"
125 #include "magick/profile.h"
126 #include "magick/quantum.h"
127 #include "magick/resample.h"
128 #include "magick/resize.h"
129 #include "magick/semaphore.h"
130 #include "magick/stream.h"
131 #include "magick/timer.h"
132 
133 struct _Image
134 {
135  ClassType
136  storage_class;
137 
138  ColorspaceType
139  colorspace; /* colorspace of image data */
140 
141  CompressionType
142  compression; /* compression of image when read/write */
143 
144  size_t
145  quality; /* compression quality setting, meaning varies */
146 
147  OrientationType
148  orientation; /* photo orientation of image */
149 
150  MagickBooleanType
151  taint, /* has image been modified since reading */
152  matte; /* is transparency channel defined and active */
153 
154  size_t
155  columns, /* physical size of image */
156  rows,
157  depth, /* depth of image on read/write */
158  colors; /* size of color table on read */
159 
161  *colormap,
162  background_color, /* current background color attribute */
163  border_color, /* current bordercolor attribute */
164  matte_color; /* current mattecolor attribute */
165 
166  double
167  gamma;
168 
170  chromaticity;
171 
172  RenderingIntent
173  rendering_intent;
174 
175  void
176  *profiles;
177 
178  ResolutionType
179  units; /* resolution/density ppi or ppc */
180 
181  char
182  *montage,
183  *directory,
184  *geometry;
185 
186  ssize_t
187  offset;
188 
189  double
190  x_resolution, /* image resolution/density */
191  y_resolution;
192 
194  page, /* virtual canvas size and offset of image */
195  extract_info,
196  tile_info; /* deprecated */
197 
198  double
199  bias,
200  blur, /* deprecated */
201  fuzz; /* current color fuzz attribute */
202 
203  FilterTypes
204  filter; /* resize/distort filter to apply */
205 
206  InterlaceType
207  interlace;
208 
209  EndianType
210  endian; /* raw data integer ordering on read/write */
211 
212  GravityType
213  gravity; /* Gravity attribute for positioning in image */
214 
215  CompositeOperator
216  compose; /* alpha composition method for layered images */
217 
218  DisposeType
219  dispose; /* GIF animation disposal method */
220 
221  struct _Image
222  *clip_mask;
223 
224  size_t
225  scene, /* index of image in multi-image file */
226  delay; /* Animation delay time */
227 
228  ssize_t
229  ticks_per_second; /* units for delay time, default 100 for GIF */
230 
231  size_t
232  iterations,
233  total_colors;
234 
235  ssize_t
236  start_loop;
237 
238  ErrorInfo
239  error;
240 
241  TimerInfo
242  timer;
243 
244  MagickProgressMonitor
245  progress_monitor;
246 
247  void
248  *client_data,
249  *cache,
250  *attributes; /* deprecated */
251 
253  *ascii85;
254 
255  BlobInfo
256  *blob;
257 
258  char
259  filename[MaxTextExtent], /* images input filename */
260  magick_filename[MaxTextExtent], /* ditto with coders, and read_mods */
261  magick[MaxTextExtent]; /* Coder used to decode image */
262 
263  size_t
264  magick_columns,
265  magick_rows;
266 
268  exception; /* Error handling report */
269 
270  MagickBooleanType
271  debug; /* debug output attribute */
272 
273  ssize_t
274  reference_count;
275 
277  *semaphore;
278 
280  color_profile,
281  iptc_profile,
282  *generic_profile;
283 
284  size_t
285  generic_profiles; /* this & ProfileInfo is deprecated */
286 
287  size_t
288  signature;
289 
290  struct _Image
291  *previous, /* Image list links */
292  *list, /* Undo/Redo image processing list (for display) */
293  *next; /* Image list links */
294 
295  InterpolatePixelMethod
296  interpolate; /* Interpolation of color for between pixel lookups */
297 
298  MagickBooleanType
299  black_point_compensation;
300 
302  transparent_color; /* color for 'transparent' color index in GIF */
303 
304  struct _Image
305  *mask;
306 
308  tile_offset;
309 
310  void
311  *properties, /* per image properities */
312  *artifacts; /* per image sequence image artifacts */
313 
314  ImageType
315  type;
316 
317  MagickBooleanType
318  dither; /* dithering method during color reduction */
319 
320  MagickSizeType
321  extent;
322 
323  MagickBooleanType
324  ping;
325 
326  size_t
327  channels;
328 
329  time_t
330  timestamp;
331 
332  PixelIntensityMethod
333  intensity; /* method to generate an intensity value from a pixel */
334 
335  size_t
336  duration; /* Total animation duration sum(delay*iterations) */
337 
338  long
339  tietz_offset;
340 
341  time_t
342  ttl;
343 };
344 
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, /* Chroma subsampling ratio string */
384  *server_name,
385  *font,
386  *texture,
387  *density;
388 
389  double
390  pointsize,
391  fuzz;
392 
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 
470  pen; /* deprecated */
471 
472  size_t
473  signature;
474 
475  VirtualPixelMethod
476  virtual_pixel_method;
477 
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  *DestroyImage(Image *),
500  *GetImageClipMask(const Image *,ExceptionInfo *) magick_attribute((__pure__)),
501  *GetImageMask(const Image *,ExceptionInfo *) magick_attribute((__pure__)),
502  *NewMagickImage(const ImageInfo *,const size_t,const size_t,
503  const MagickPixelPacket *),
504  *ReferenceImage(Image *),
505  *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
506  ExceptionInfo *);
507 
508 extern MagickExport ImageInfo
509  *AcquireImageInfo(void),
510  *CloneImageInfo(const ImageInfo *),
511  *DestroyImageInfo(ImageInfo *);
512 
513 extern MagickExport MagickBooleanType
514  ClipImage(Image *),
515  ClipImagePath(Image *,const char *,const MagickBooleanType),
516  CopyImagePixels(Image *,const Image *,const RectangleInfo *,
517  const OffsetInfo *,ExceptionInfo *),
518  IsTaintImage(const Image *),
519  IsMagickConflict(const char *) magick_attribute((__pure__)),
520  IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
521  IsImageObject(const Image *),
522  ListMagickInfo(FILE *,ExceptionInfo *),
523  ModifyImage(Image **,ExceptionInfo *),
524  ResetImagePage(Image *,const char *),
525  ResetImagePixels(Image *,ExceptionInfo *),
526  SetImageBackgroundColor(Image *),
527  SetImageClipMask(Image *,const Image *),
528  SetImageColor(Image *,const MagickPixelPacket *),
529  SetImageExtent(Image *,const size_t,const size_t),
530  SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
531  SetImageMask(Image *,const Image *),
532  SetImageOpacity(Image *,const Quantum),
533  SetImageChannels(Image *,const size_t),
534  SetImageStorageClass(Image *,const ClassType),
535  StripImage(Image *),
536  SyncImage(Image *),
537  SyncImageSettings(const ImageInfo *,Image *),
538  SyncImagesSettings(ImageInfo *,Image *);
539 
540 extern MagickExport size_t
541  InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *);
542 
543 extern MagickExport ssize_t
544  GetImageReferenceCount(Image *);
545 
546 extern MagickExport size_t
547  GetImageChannels(Image *);
548 
549 extern MagickExport VirtualPixelMethod
550  GetImageVirtualPixelMethod(const Image *),
551  SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod);
552 
553 extern MagickExport void
554  AcquireNextImage(const ImageInfo *,Image *),
555  DestroyImagePixels(Image *),
556  DisassociateImageStream(Image *),
557  GetImageException(Image *,ExceptionInfo *),
558  GetImageInfo(ImageInfo *),
559  SetImageInfoBlob(ImageInfo *,const void *,const size_t),
560  SetImageInfoFile(ImageInfo *,FILE *);
561 
562 #if defined(__cplusplus) || defined(c_plusplus)
563 }
564 #endif
565 
566 #endif
Definition: image.h:133