image.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /*
  2. Copyright 1999 ImageMagick Studio LLC, a non-profit organization
  3. dedicated to making software imaging solutions freely available.
  4. You may not use this file except in compliance with the License. You may
  5. obtain a copy of the License at
  6. https://imagemagick.org/script/license.php
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. MagickCore image methods.
  13. */
  14. #ifndef MAGICKCORE_IMAGE_H
  15. #define MAGICKCORE_IMAGE_H
  16. #include "magick/color.h"
  17. #if defined(__cplusplus) || defined(c_plusplus)
  18. extern "C" {
  19. #endif
  20. #define OpaqueOpacity ((Quantum) 0UL)
  21. #define TransparentOpacity (QuantumRange)
  22. typedef enum
  23. {
  24. UndefinedType,
  25. BilevelType,
  26. GrayscaleType,
  27. GrayscaleMatteType,
  28. PaletteType,
  29. PaletteMatteType,
  30. TrueColorType,
  31. TrueColorMatteType,
  32. ColorSeparationType,
  33. ColorSeparationMatteType,
  34. OptimizeType,
  35. PaletteBilevelMatteType
  36. } ImageType;
  37. typedef enum
  38. {
  39. UndefinedInterlace,
  40. NoInterlace,
  41. LineInterlace,
  42. PlaneInterlace,
  43. PartitionInterlace,
  44. GIFInterlace,
  45. JPEGInterlace,
  46. PNGInterlace
  47. } InterlaceType;
  48. typedef enum
  49. {
  50. UndefinedOrientation,
  51. TopLeftOrientation,
  52. TopRightOrientation,
  53. BottomRightOrientation,
  54. BottomLeftOrientation,
  55. LeftTopOrientation,
  56. RightTopOrientation,
  57. RightBottomOrientation,
  58. LeftBottomOrientation
  59. } OrientationType;
  60. typedef enum
  61. {
  62. UndefinedResolution,
  63. PixelsPerInchResolution,
  64. PixelsPerCentimeterResolution
  65. } ResolutionType;
  66. typedef struct _PrimaryInfo
  67. {
  68. double
  69. x,
  70. y,
  71. z;
  72. } PrimaryInfo;
  73. typedef struct _SegmentInfo
  74. {
  75. double
  76. x1,
  77. y1,
  78. x2,
  79. y2;
  80. } SegmentInfo;
  81. typedef enum
  82. {
  83. UndefinedTransmitType,
  84. FileTransmitType,
  85. BlobTransmitType,
  86. StreamTransmitType,
  87. ImageTransmitType
  88. } TransmitType;
  89. typedef struct _ChromaticityInfo
  90. {
  91. PrimaryInfo
  92. red_primary,
  93. green_primary,
  94. blue_primary,
  95. white_point;
  96. } ChromaticityInfo;
  97. #include "magick/blob.h"
  98. #include "magick/colorspace.h"
  99. #include "magick/cache-view.h"
  100. #include "magick/color.h"
  101. #include "magick/composite.h"
  102. #include "magick/compress.h"
  103. #include "magick/effect.h"
  104. #include "magick/geometry.h"
  105. #include "magick/layer.h"
  106. #include "magick/locale_.h"
  107. #include "magick/monitor.h"
  108. #include "magick/pixel.h"
  109. #include "magick/profile.h"
  110. #include "magick/quantum.h"
  111. #include "magick/resample.h"
  112. #include "magick/resize.h"
  113. #include "magick/semaphore.h"
  114. #include "magick/stream.h"
  115. #include "magick/timer.h"
  116. struct _Image
  117. {
  118. ClassType
  119. storage_class;
  120. ColorspaceType
  121. colorspace; /* colorspace of image data */
  122. CompressionType
  123. compression; /* compression of image when read/write */
  124. size_t
  125. quality; /* compression quality setting, meaning varies */
  126. OrientationType
  127. orientation; /* photo orientation of image */
  128. MagickBooleanType
  129. taint, /* has image been modified since reading */
  130. matte; /* is transparency channel defined and active */
  131. size_t
  132. columns, /* physical size of image */
  133. rows,
  134. depth, /* depth of image on read/write */
  135. colors; /* size of color table on read */
  136. PixelPacket
  137. *colormap,
  138. background_color, /* current background color attribute */
  139. border_color, /* current bordercolor attribute */
  140. matte_color; /* current mattecolor attribute */
  141. double
  142. gamma;
  143. ChromaticityInfo
  144. chromaticity;
  145. RenderingIntent
  146. rendering_intent;
  147. void
  148. *profiles;
  149. ResolutionType
  150. units; /* resolution/density ppi or ppc */
  151. char
  152. *montage,
  153. *directory,
  154. *geometry;
  155. ssize_t
  156. offset;
  157. double
  158. x_resolution, /* image resolution/density */
  159. y_resolution;
  160. RectangleInfo
  161. page, /* virtual canvas size and offset of image */
  162. extract_info,
  163. tile_info; /* deprecated */
  164. double
  165. bias,
  166. blur, /* deprecated */
  167. fuzz; /* current color fuzz attribute */
  168. FilterTypes
  169. filter; /* resize/distort filter to apply */
  170. InterlaceType
  171. interlace;
  172. EndianType
  173. endian; /* raw data integer ordering on read/write */
  174. GravityType
  175. gravity; /* Gravity attribute for positioning in image */
  176. CompositeOperator
  177. compose; /* alpha composition method for layered images */
  178. DisposeType
  179. dispose; /* GIF animation disposal method */
  180. struct _Image
  181. *clip_mask;
  182. size_t
  183. scene, /* index of image in multi-image file */
  184. delay; /* Animation delay time */
  185. ssize_t
  186. ticks_per_second; /* units for delay time, default 100 for GIF */
  187. size_t
  188. iterations,
  189. total_colors;
  190. ssize_t
  191. start_loop;
  192. ErrorInfo
  193. error;
  194. TimerInfo
  195. timer;
  196. MagickProgressMonitor
  197. progress_monitor;
  198. void
  199. *client_data,
  200. *cache,
  201. *attributes; /* deprecated */
  202. Ascii85Info
  203. *ascii85;
  204. BlobInfo
  205. *blob;
  206. char
  207. filename[MaxTextExtent], /* images input filename */
  208. magick_filename[MaxTextExtent], /* ditto with coders, and read_mods */
  209. magick[MaxTextExtent]; /* Coder used to decode image */
  210. size_t
  211. magick_columns,
  212. magick_rows;
  213. ExceptionInfo
  214. exception; /* Error handling report */
  215. MagickBooleanType
  216. debug; /* debug output attribute */
  217. ssize_t
  218. reference_count;
  219. SemaphoreInfo
  220. *semaphore;
  221. ProfileInfo
  222. color_profile,
  223. iptc_profile,
  224. *generic_profile;
  225. size_t
  226. generic_profiles; /* this & ProfileInfo is deprecated */
  227. size_t
  228. signature;
  229. struct _Image
  230. *previous, /* Image list links */
  231. *list, /* Undo/Redo image processing list (for display) */
  232. *next; /* Image list links */
  233. InterpolatePixelMethod
  234. interpolate; /* Interpolation of color for between pixel lookups */
  235. MagickBooleanType
  236. black_point_compensation;
  237. PixelPacket
  238. transparent_color; /* color for 'transparent' color index in GIF */
  239. struct _Image
  240. *mask;
  241. RectangleInfo
  242. tile_offset;
  243. void
  244. *properties, /* per image properities */
  245. *artifacts; /* per image sequence image artifacts */
  246. ImageType
  247. type;
  248. MagickBooleanType
  249. dither; /* dithering method during color reduction */
  250. MagickSizeType
  251. extent;
  252. MagickBooleanType
  253. ping;
  254. size_t
  255. channels;
  256. time_t
  257. timestamp;
  258. PixelIntensityMethod
  259. intensity; /* method to generate an intensity value from a pixel */
  260. size_t
  261. duration; /* Total animation duration sum(delay*iterations) */
  262. long
  263. tietz_offset;
  264. time_t
  265. ttl;
  266. };
  267. struct _ImageInfo
  268. {
  269. CompressionType
  270. compression;
  271. OrientationType
  272. orientation;
  273. MagickBooleanType
  274. temporary,
  275. adjoin,
  276. affirm,
  277. antialias;
  278. char
  279. *size,
  280. *extract,
  281. *page,
  282. *scenes;
  283. size_t
  284. scene,
  285. number_scenes,
  286. depth;
  287. InterlaceType
  288. interlace;
  289. EndianType
  290. endian;
  291. ResolutionType
  292. units;
  293. size_t
  294. quality;
  295. char
  296. *sampling_factor, /* Chroma subsampling ratio string */
  297. *server_name,
  298. *font,
  299. *texture,
  300. *density;
  301. double
  302. pointsize,
  303. fuzz;
  304. PixelPacket
  305. background_color,
  306. border_color,
  307. matte_color;
  308. MagickBooleanType
  309. dither,
  310. monochrome;
  311. size_t
  312. colors;
  313. ColorspaceType
  314. colorspace;
  315. ImageType
  316. type;
  317. PreviewType
  318. preview_type;
  319. ssize_t
  320. group;
  321. MagickBooleanType
  322. ping,
  323. verbose;
  324. char
  325. *view,
  326. *authenticate;
  327. ChannelType
  328. channel;
  329. Image
  330. *attributes; /* deprecated */
  331. void
  332. *options;
  333. MagickProgressMonitor
  334. progress_monitor;
  335. void
  336. *client_data,
  337. *cache;
  338. StreamHandler
  339. stream;
  340. FILE
  341. *file;
  342. void
  343. *blob;
  344. size_t
  345. length;
  346. char
  347. magick[MaxTextExtent],
  348. unique[MaxTextExtent],
  349. zero[MaxTextExtent],
  350. filename[MaxTextExtent];
  351. MagickBooleanType
  352. debug;
  353. char
  354. *tile; /* deprecated */
  355. size_t
  356. subimage, /* deprecated */
  357. subrange; /* deprecated */
  358. PixelPacket
  359. pen; /* deprecated */
  360. size_t
  361. signature;
  362. VirtualPixelMethod
  363. virtual_pixel_method;
  364. PixelPacket
  365. transparent_color;
  366. void
  367. *profile;
  368. MagickBooleanType
  369. synchronize;
  370. };
  371. extern MagickExport ExceptionType
  372. CatchImageException(Image *);
  373. extern MagickExport FILE
  374. *GetImageInfoFile(const ImageInfo *);
  375. extern MagickExport Image
  376. *AcquireImage(const ImageInfo *),
  377. *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *),
  378. *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType,
  379. ExceptionInfo *),
  380. *DestroyImage(Image *),
  381. *GetImageClipMask(const Image *,ExceptionInfo *) magick_attribute((__pure__)),
  382. *GetImageMask(const Image *,ExceptionInfo *) magick_attribute((__pure__)),
  383. *NewMagickImage(const ImageInfo *,const size_t,const size_t,
  384. const MagickPixelPacket *),
  385. *ReferenceImage(Image *),
  386. *SmushImages(const Image *,const MagickBooleanType,const ssize_t,
  387. ExceptionInfo *);
  388. extern MagickExport ImageInfo
  389. *AcquireImageInfo(void),
  390. *CloneImageInfo(const ImageInfo *),
  391. *DestroyImageInfo(ImageInfo *);
  392. extern MagickExport MagickBooleanType
  393. ClipImage(Image *),
  394. ClipImagePath(Image *,const char *,const MagickBooleanType),
  395. CopyImagePixels(Image *,const Image *,const RectangleInfo *,
  396. const OffsetInfo *,ExceptionInfo *),
  397. IsTaintImage(const Image *),
  398. IsMagickConflict(const char *) magick_attribute((__pure__)),
  399. IsHighDynamicRangeImage(const Image *,ExceptionInfo *),
  400. IsImageObject(const Image *),
  401. ListMagickInfo(FILE *,ExceptionInfo *),
  402. ModifyImage(Image **,ExceptionInfo *),
  403. ResetImagePage(Image *,const char *),
  404. ResetImagePixels(Image *,ExceptionInfo *),
  405. SetImageBackgroundColor(Image *),
  406. SetImageClipMask(Image *,const Image *),
  407. SetImageColor(Image *,const MagickPixelPacket *),
  408. SetImageExtent(Image *,const size_t,const size_t),
  409. SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
  410. SetImageMask(Image *,const Image *),
  411. SetImageOpacity(Image *,const Quantum),
  412. SetImageChannels(Image *,const size_t),
  413. SetImageStorageClass(Image *,const ClassType),
  414. StripImage(Image *),
  415. SyncImage(Image *),
  416. SyncImageSettings(const ImageInfo *,Image *),
  417. SyncImagesSettings(ImageInfo *,Image *);
  418. extern MagickExport size_t
  419. InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *);
  420. extern MagickExport ssize_t
  421. GetImageReferenceCount(Image *);
  422. extern MagickExport size_t
  423. GetImageChannels(Image *);
  424. extern MagickExport VirtualPixelMethod
  425. GetImageVirtualPixelMethod(const Image *),
  426. SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod);
  427. extern MagickExport void
  428. AcquireNextImage(const ImageInfo *,Image *),
  429. DestroyImagePixels(Image *),
  430. DisassociateImageStream(Image *),
  431. GetImageException(Image *,ExceptionInfo *),
  432. GetImageInfo(ImageInfo *),
  433. SetImageInfoBlob(ImageInfo *,const void *,const size_t),
  434. SetImageInfoFile(ImageInfo *,FILE *);
  435. #if defined(__cplusplus) || defined(c_plusplus)
  436. }
  437. #endif
  438. #endif