1 /** \file 2 * \brief All the Internal File Formats. 3 * They are all automatically registered by the library. 4 * The signatures are in C, but the functions are C++. 5 * Header for internal use only. 6 * 7 * See Copyright Notice in im_lib.h 8 */ 9 module im.im_format_all; 10 11 version(IM) : 12 13 version(DigitalMars) version(Windows) { pragma(lib, "im.lib"); } 14 15 extern(C) @nogc nothrow : 16 17 /** \defgroup tiff TIFF - Tagged Image File Format 18 * \section Description 19 * 20 * \par 21 * Copyright (c) 1986-1988, 1992 by Adobe Systems Incorporated. \n 22 * Originally created by a group of companies, 23 * the Aldus Corporation keeped the copyright until Aldus was aquired by Adobe. \n 24 * TIFF Revision 6.0 Final June 3, 1992 \n 25 * http://www.adobe.com/Support/TechNotes.html 26 * \par 27 * Access to the TIFF file format uses libTIFF version 4.0.3 \n 28 * http://www.remotesensing.org/libtiff/ \n 29 * Copyright (c) 1988-1997 Sam Leffler \n 30 * Copyright (c) 1991-1997 Silicon Graphics, Inc. \n 31 * 32 * \section Features 33 * 34 \verbatim 35 Data Types: <all> 36 Color Spaces: Gray, RGB, CMYK, YCbCr, Lab, XYZ, Map and Binary. 37 Compressions: 38 NONE - no compression [default for IEEE Floating Point Data] 39 CCITTRLE - CCITT modified Huffman RLE (binary only) [default for Binary] 40 CCITTFAX3 - CCITT Group 3 fax (binary only) 41 CCITTFAX4 - CCITT Group 4 fax (binary only) 42 LZW - Lempel-Ziv & Welch [default] 43 JPEG - ISO JPEG [default for YCBCR] 44 NEXT - NeXT 2-bit RLE (2 bpp only) 45 CCITTRLEW - CCITT modified Huffman RLE with word alignment (binary only) 46 RLE - Packbits (Macintosh RLE) [default for MAP] 47 THUNDERSCAN - ThunderScan 4-bit RLE (only for 2 or 4 bpp) 48 PIXARLOG - Pixar companded 11-bit ZIP (only byte, ushort and float) 49 DEFLATE - LZ77 variation (ZIP) 50 ADOBE_DEFLATE - Adobe LZ77 variation 51 SGILOG - SGI Log Luminance RLE for L and Luv (only byte, ushort and float) [default for XYZ] 52 SGILOG24 - SGI Log 24-bit packed for Luv (only byte, ushort and float) 53 Can have more than one image. 54 Can have an alpha channel. 55 Components can be packed or not. 56 Lines arranged from top down to bottom or bottom up to top. 57 Handle(1) returns a TIFF* libTIFF structure. 58 59 Attributes: 60 Photometric IM_USHORT (1) (when writing this will complement the color_mode information, for Mask, MinIsWhite, ITULab and ICCLab) 61 ExtraSampleInfo IM_USHORT (1) (description of alpha channel: 0- uknown, 1- pre-multiplied, 2-normal) 62 JPEGQuality IM_INT (1) [0-100, default 75] (write only) 63 ZIPQuality IM_INT (1) [1-9, default 6] (write only) 64 ResolutionUnit (string) ["DPC", "DPI"] 65 XResolution, YResolution IM_FLOAT (1) 66 Description, Author, Copyright, DateTime, DocumentName, 67 PageName, TargetPrinter, Make, Model, Software, HostComputer (string) 68 InkNames (strings separated by '0's) 69 InkSet IM_USHORT (1) 70 NumberOfInks IM_USHORT (1) 71 DotRange IM_USHORT (2) 72 TransferFunction0, TransferFunction1, TransferFunction3 IM_USHORT [gray=0, rgb=012] 73 ReferenceBlackWhite IMFLOAT (6) 74 WhitePoint IMFLOAT (2) 75 PrimaryChromaticities IMFLOAT (6) 76 YCbCrCoefficients IM_FLOAT (3) 77 YCbCrSubSampling IM_USHORT (2) 78 YCbCrPositioning IM_USHORT (1) 79 PageNumber IM_USHORT (2) 80 StoNits IM_DOUBLE (1) 81 XPosition, YPosition IM_FLOAT (1) 82 SMinSampleValue, SMaxSampleValue IM_FLOAT (1) 83 HalftoneHints IM_USHORT (2) 84 SubfileType IM_INT (1) 85 ICCProfile IM_BYTE (N) 86 MultiBandCount IM_USHORT (1) [Number of bands in a multiband gray image.] 87 MultiBandSelect IM_USHORT (1) [Band number to read one band of a multiband gray image. Must be set before reading image info.] 88 and other TIFF tags as they are described in the TIFF documentation. 89 GeoTIFF tags: 90 GeoTiePoints, GeoTransformationMatrix, "Intergraph TransformationMatrix", GeoPixelScale, GeoDoubleParams IM_DOUBLE (N) 91 GeoASCIIParams (string) 92 Read-only support for EXIF tags as they are described in the EXIF 2.2 documentation. See http://www.exif.org/ 93 DNG tags as they are described in the DNG documentation. See http://www.adobe.com/br/products/dng/ 94 Tags BlackLevel, DefaultCropOrigin and DefaultCropSize are incorrectly interpreted by libTIFF so they are ignored. 95 Raw image is loaded in place of the thumbnail image in the main IFD. 96 SubIFDCount IM_USHORT (1) [Number of subifds of the current image.] 97 SubIFDSelect IM_USHORT (1) [Subifd number to be read. Must be set before reading image info.] 98 (other attributes can be obtained by using libTIFF directly using the Handle(1) function) 99 100 Comments: 101 LogLuv is in fact Y'+CIE(u,v), so we choose to always convert it to XYZ. 102 SubIFD is handled only for DNG. 103 Since LZW patent expired, LZW compression is enabled. LZW Copyright Unisys. 104 libGeoTIFF can be used without XTIFF initialization. Use Handle(1) to obtain a TIFF*. 105 106 Changes: 107 "tiff_jpeg.c" - commented "downsampled_output = TRUE" and downsampled_input = TRUE. 108 "tiff_fax3.c" - replaced "inline" by "INLINE" 109 "tif_strip.c" - fixed scanline_size 110 New files "tif_config.h" and "tifconf.h" to match our needs. 111 New file "tiff_binfile.c" that implement I/O rotines using imBinFile. 112 Search for "IMLIB" to see the changes. 113 \endverbatim 114 * \ingroup format */ 115 void imFormatRegisterTIFF(); 116 117 118 /** \defgroup jpeg JPEG - JPEG File Interchange Format 119 * \section Description 120 * 121 * \par 122 * ISO/IEC 10918 (1994, 1995, 1997, 1999)\n 123 * http://www.jpeg.org/ 124 * \par 125 * Access to the JPEG file format uses libjpeg version 8c. \n 126 * http://www.ijg.org \n 127 * Copyright (C) 1994-2011, Thomas G. Lane, Guido Vollbeding \n 128 * from the Independent JPEG Group. 129 * \par 130 * Access to the EXIF attributes uses libEXIF version 0.6.20. \n 131 * http://sourceforge.net/projects/libexif \n 132 * Copyright (C) 2001-2010, Lutz Müller 133 * 134 * \section Features 135 * 136 \verbatim 137 Data Types: Byte 138 Color Spaces: Gray, RGB, CMYK and YCbCr (Binary Saved as Gray) 139 Compressions: 140 JPEG - ISO JPEG [default] 141 Only one image. 142 No alpha channel. 143 Internally the components are always packed. 144 Internally the lines are arranged from top down to bottom. 145 Handle(1) returns jpeg_decompress_struct* when reading, and 146 jpeg_compress_struct* when writing (libJPEG structures). 147 148 Attributes: 149 AutoYCbCr IM_INT (1) (controls YCbCr auto conversion) default 1 150 JPEGQuality IM_INT (1) [0-100, default 75] (write only) 151 ResolutionUnit (string) ["DPC", "DPI"] 152 XResolution, YResolution IM_FLOAT (1) 153 Interlaced (same as Progressive) IM_INT (1 | 0) default 0 154 Description (string) 155 (lots of Exif tags) 156 157 Changes to libJPEG: 158 jdatadst.c - fflush and ferror replaced by macros JFFLUSH and JFERROR. 159 jinclude.h - standard JFFLUSH and JFERROR definitions, and new macro HAVE_JFIO. 160 new file created: jconfig.h from jconfig.txt 161 162 Changes to libEXIF: 163 new files config.h and _stdint.h 164 small fixes in exif-entry.c, exif-loader.c, exif-tag.c, mnote-fuji-tag.h and mnote-olympus-tag.h 165 166 Comments: 167 Other APPx markers are ignored. 168 No thumbnail support. 169 RGB images are automatically converted to YCbCr when saved. 170 Also YcbCr are automatically converted to RGB when loaded. Use AutoYCbCr=0 to disable this behavior. 171 \endverbatim 172 * \ingroup format */ 173 void imFormatRegisterJPEG(); 174 175 176 /** \defgroup png PNG - Portable Network Graphic Format 177 * \section Description 178 * 179 * \par 180 * Access to the PNG file format uses libpng version 1.6.23. \n 181 * http://www.libpng.org \n 182 * Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson 183 * 184 * \section Features 185 * 186 \verbatim 187 Data Types: Byte and UShort 188 Color Spaces: Gray, RGB, MAP and Binary 189 Compressions: 190 DEFLATE - LZ77 variation (ZIP) [default] 191 Only one image. 192 Can have an alpha channel. 193 Internally the components are always packed. 194 Internally the lines are arranged from top down to bottom. 195 Handle(1) returns png_structp libPNG structure. 196 197 Attributes: 198 ZIPQuality IM_INT (1) [1-9, default 6] (write only) 199 ResolutionUnit (string) ["DPC", "DPI"] 200 XResolution, YResolution IM_FLOAT (1) 201 Interlaced (same as Progressive) IM_INT (1 | 0) default 0 202 Gamma IM_FLOAT (1) 203 WhitePoint IMFLOAT (2) 204 PrimaryChromaticities IMFLOAT (6) 205 XPosition, YPosition IM_FLOAT (1) 206 sRGBIntent IM_INT (1) [0: Perceptual, 1: Relative colorimetric, 2: Saturation, 3: Absolute colorimetric] 207 TransparencyMap IM_BYTE (N) (for MAP images is the alpha value of the corresponding palette index) 208 TransparencyIndex IM_BYTE (1) (for MAP images is the first index that has minimum alpha in TransparencyMap, for GRAY images is the index that it is fully transparent) 209 TransparencyColor IM_BYTE (3) (for RGB images is the color that is full transparent) 210 CalibrationName, CalibrationUnits (string) 211 CalibrationLimits IM_INT (2) 212 CalibrationEquation IM_BYTE (1) [0-Linear,1-Exponential,2-Arbitrary,3-HyperbolicSine)] 213 CalibrationParam (string) [params separated by '\\n'] 214 Title, Author, Description, Copyright, DateTime (string) 215 Software, Disclaimer, Warning, Source, Comment, ... (string) 216 DateTimeModified (string) [when writing uses the current system time] 217 ICCProfile IM_BYTE (N) 218 ScaleUnit (string) ["meters", "radians"] 219 XScale, YScale IM_FLOAT (1) 220 221 Comments: 222 When saving PNG image with TransparencyIndex or TransparencyMap, TransparencyMap has precedence, 223 so set it to NULL if you changed TransparencyIndex. 224 Attributes set after the image are ignored. 225 \endverbatim 226 * \ingroup format */ 227 void imFormatRegisterPNG(); 228 229 230 /** \defgroup gif GIF - Graphics Interchange Format 231 * \section Description 232 * 233 * \par 234 * Copyright (c) 1987,1988,1989,1990 CompuServe Incorporated. \n 235 * GIF is a Service Mark property of CompuServe Incorporated. \n 236 * Graphics Interchange Format Programming Reference, 1990. \n 237 * LZW Copyright Unisys. 238 * \par 239 * Patial Internal Implementation. \n 240 * Decoding and encoding code were extracted from GIFLib 1.0. \n 241 * Copyright (c) 1989 Gershon Elber. 242 * 243 * \section Features 244 * 245 \verbatim 246 Data Types: Byte 247 Color Spaces: MAP only, (Gray and Binary saved as MAP) 248 Compressions: 249 LZW - Lempel-Ziv & Welch [default] 250 Can have more than one image. 251 No alpha channel. 252 Internally the lines are arranged from top down to bottom. 253 254 Attributes: 255 ScreenHeight, ScreenWidth IM_USHORT (1) screen size [default to the first image size] 256 Interlaced IM_INT (1 | 0) default 0 257 Description (string) 258 TransparencyIndex IM_BYTE (1) 259 XScreen, YScreen IM_USHORT (1) screen position 260 UserInput IM_BYTE (1) [1, 0] 261 Disposal (string) [UNDEF, LEAVE, RBACK, RPREV] 262 Delay IM_USHORT (1) [time to wait betweed frames in 1/100 of a second] 263 Iterations IM_USHORT (1) (NETSCAPE2.0 Application Extension) [The number of times to repeat the animation. 0 means to repeat forever. ] 264 265 Comments: 266 Attributes after the last image are ignored. 267 Reads GIF87 and GIF89, but writes GIF89 always. 268 Ignored attributes: Background Color Index, Pixel Aspect Ratio, 269 Plain Text Extensions, Application Extensions... 270 \endverbatim 271 * \ingroup format */ 272 void imFormatRegisterGIF(); 273 274 275 /** \defgroup bmp BMP - Windows Device Independent Bitmap 276 * \section Description 277 * 278 * \par 279 * Windows Copyright Microsoft Corporation. 280 * \par 281 * Internal Implementation. 282 * 283 * \section Features 284 * 285 \verbatim 286 Data Types: Byte 287 Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 288 Compressions: 289 NONE - no compression [default] 290 RLE - Run Lenght Encoding (only for MAP and Gray) 291 Only one image. 292 Can have an alpha channel (only for RGB) 293 Internally the components are always packed. 294 Lines arranged from top down to bottom or bottom up to top. But are saved always as bottom up. 295 296 Attributes: 297 ResolutionUnit (string) ["DPC", "DPI"] 298 XResolution, YResolution IM_FLOAT (1) 299 300 Comments: 301 Reads OS2 1.x and Windows 3, but writes Windows 3 always. 302 Version 4 and 5 BMPs are not supported. 303 \endverbatim 304 * \ingroup format */ 305 void imFormatRegisterBMP(); 306 307 308 /** \defgroup ras RAS - Sun Raster File 309 * \section Description 310 * 311 * \par 312 * Copyright Sun Corporation. 313 * \par 314 * Internal Implementation. 315 * 316 * \section Features 317 * 318 \verbatim 319 Data Types: Byte 320 Color Spaces: Gray, RGB, MAP and Binary 321 Compressions: 322 NONE - no compression [default] 323 RLE - Run Lenght Encoding 324 Only one image. 325 Can have an alpha channel (only for IM_RGB) 326 Internally the components are always packed. 327 Internally the lines are arranged from top down to bottom. 328 329 Attributes: 330 none 331 \endverbatim 332 * \ingroup format */ 333 void imFormatRegisterRAS(); 334 335 336 /** \defgroup led LED - IUP image in LED 337 * \section Description 338 * 339 * \par 340 * Copyright Tecgraf/PUC-Rio and PETROBRAS/CENPES. 341 * \par 342 * Internal Implementation. 343 * 344 * \section Features 345 * 346 \verbatim 347 Data Types: Byte 348 Color Spaces: MAP only (Gray and Binary saved as MAP) 349 Compressions: 350 NONE - no compression [default] 351 Only one image. 352 No alpha channel. 353 Internally the lines are arranged from top down to bottom. 354 355 Attributes: 356 none 357 358 Comments: 359 LED file must start with "LEDImage = IMAGE[". 360 \endverbatim 361 * \ingroup format */ 362 void imFormatRegisterLED(); 363 364 365 /** \defgroup sgi SGI - Silicon Graphics Image File Format 366 * \section Description 367 * 368 * \par 369 * SGI is a trademark of Silicon Graphics, Inc. 370 * \par 371 * Internal Implementation. 372 * 373 * \section Features 374 * 375 \verbatim 376 Data Types: Byte and UShort 377 Color Spaces: Gray and RGB (Binary saved as Gray, MAP with fixed palette when reading only) 378 Compressions: 379 NONE - no compression [default] 380 RLE - Run Lenght Encoding 381 Only one image. 382 Can have an alpha channel (only for IM_RGB) 383 Internally the components are always packed. 384 Internally the lines are arranged from bottom up to top. 385 386 Attributes: 387 Description (string) 388 \endverbatim 389 * \ingroup format */ 390 void imFormatRegisterSGI(); 391 392 393 /** \defgroup pcx PCX - ZSoft Picture 394 * \section Description 395 * 396 * \par 397 * Copyright ZSoft Corporation. \n 398 * ZSoft (1988) PCX Technical Reference Manual. 399 * \par 400 * Internal Implementation. 401 * 402 * \section Features 403 * 404 \verbatim 405 Data Types: Byte 406 Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 407 Compressions: 408 NONE - no compression 409 RLE - Run Lenght Encoding [default - since uncompressed PCX is not well supported] 410 Only one image. 411 No alpha channel. 412 Internally the components are always packed. 413 Internally the lines are arranged from top down to bottom. 414 415 Attributes: 416 ResolutionUnit (string) ["DPC", "DPI"] 417 XResolution, YResolution IM_FLOAT (1) 418 XScreen, YScreen IM_USHORT (1) screen position 419 420 Comments: 421 Reads Versions 0-5, but writes Version 5 always. 422 \endverbatim 423 * \ingroup format */ 424 void imFormatRegisterPCX(); 425 426 427 /** \defgroup tga TGA - Truevision Graphics Adapter File 428 * \section Description 429 * 430 * \par 431 * Truevision TGA File Format Specification Version 2.0 \n 432 * Technical Manual Version 2.2 January, 1991 \n 433 * Copyright 1989, 1990, 1991 Truevision, Inc. 434 * \par 435 * Internal Implementation. 436 * 437 * \section Features 438 * 439 \verbatim 440 Data Types: Byte 441 Color Spaces: Gray, RGB and MAP (Binary saved as Gray) 442 Compressions: 443 NONE - no compression [default] 444 RLE - Run Lenght Encoding 445 Only one image. 446 Can have an alpha channel (only for RGB) 447 Internally the components are always packed. 448 Internally the lines are arranged from bottom up to top or from top down to bottom. 449 450 Attributes: 451 XScreen, YScreen IM_USHORT (1) screen position 452 Title, Author, Description, JobName, Software (string) 453 SoftwareVersion (read only) (string) 454 DateTimeModified (string) [when writing uses the current system time] 455 Gamma IM_FLOAT (1) 456 \endverbatim 457 * \ingroup format */ 458 void imFormatRegisterTGA(); 459 460 461 /** \defgroup pnm PNM - Netpbm Portable Image Map 462 * \section Description 463 * 464 * \par 465 * PNM formats Copyright Jef Poskanzer 466 * \par 467 * Internal Implementation. 468 * 469 * \section Features 470 * 471 \verbatim 472 Data Types: Byte and UShort 473 Color Spaces: Gray, RGB and Binary 474 Compressions: 475 NONE - no compression [default] 476 ASCII (textual data) 477 Can have more than one image, but sequencial access only. 478 No alpha channel. 479 Internally the components are always packed. 480 Internally the lines are arranged from top down to bottom. 481 482 Attributes: 483 Description (string) 484 485 Comments: 486 In fact ASCII is an expansion, not a compression, because the file will be larger than binary data. 487 \endverbatim 488 * \ingroup format */ 489 void imFormatRegisterPNM(); 490 491 492 /** \defgroup pfm PFM - Portable FloatMap Image Format 493 * \section Description 494 * 495 * \par 496 * Internal Implementation. 497 * 498 * \section Features 499 * 500 \verbatim 501 Data Types: Float 502 Color Spaces: Gray and RGB 503 Compressions: 504 NONE - no compression [default] 505 506 No alpha channel. 507 Internally the components are always packed. 508 Internally the lines are arranged from bottom to top. 509 510 \endverbatim 511 * \ingroup format */ 512 void imFormatRegisterPFM(); 513 514 515 /** \defgroup ico ICO - Windows Icon 516 * \section Description 517 * 518 * \par 519 * Windows Copyright Microsoft Corporation. 520 * \par 521 * Internal Implementation. 522 * 523 * \section Features 524 * 525 \verbatim 526 Data Types: Byte 527 Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 528 Compressions: 529 NONE - no compression [default] 530 Can have more than one image. But reading and writing is limited to 10 images max, 531 and all images must have different sizes and bpp. 532 Can have an alpha channel (only for RGB) 533 Internally the components are always packed. 534 Internally the lines are arranged from bottom up to top. 535 536 Attributes: 537 TransparencyIndex IM_BYTE (1) 538 539 Comments: 540 If the user specifies an alpha channel, the AND mask is loaded as alpha if 541 the file color mode does not contain the IM_ALPHA flag. 542 For MAP imagens, if the user does not specifies an alpha channel 543 the TransparencyIndex is used to initialize the AND mask when writing, 544 and if the user does specifies an alpha channel 545 the most repeated index with transparency will be the transparent index. 546 Although any size and common bpp can be used is recomended to use the typical configurations: 547 16x16, 32x32, 48x48, 64x64 or 96x96 548 2 colors, 16 colors, 256 colors, 24bpp or 32bpp 549 \endverbatim 550 * \ingroup format */ 551 void imFormatRegisterICO(); 552 553 554 /** \defgroup krn KRN - IM Kernel File Format 555 * \section Description 556 * 557 * \par 558 * Textual format to provied a simple way to create kernel convolution images. 559 * \par 560 * Internal Implementation. 561 * 562 * \section Features 563 * 564 \verbatim 565 Data Types: Int, Float 566 Color Spaces: Gray 567 Compressions: 568 NONE - no compression [default] 569 Only one image. 570 No alpha channel. 571 Internally the lines are arranged from top down to bottom. 572 573 Attributes: 574 Description (string) 575 576 Comments: 577 The format is very simple, inspired by PNM. 578 It was developed because PNM does not have support for INT and FLOAT. 579 Remeber that usually convolution operations use kernel size an odd number. 580 581 Format Model: 582 IMKERNEL 583 Description up to 512 characters 584 width height 585 type (0 - IM_INT, 1 - IM_FLOAT) 586 data... 587 588 Example: 589 IMKERNEL 590 Gradian 591 3 3 592 0 593 0 -1 0 594 0 1 0 595 0 0 0 596 \endverbatim 597 * \ingroup format */ 598 void imFormatRegisterKRN();