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