IM: im_format_all.h Source File
From IM - An Imaging Tool
im_format_all.h
Go to the documentation of this file.00001 /** \file 00002 * \brief All the Internal File Formats. 00003 * They are all automatically registered by the library. 00004 * The signatures are in C, but the functions are C++. 00005 * Header for internal use only. 00006 * 00007 * See Copyright Notice in im_lib.h 00008 */ 00009 00010 #ifndef __IM_FORMAT_ALL_H 00011 #define __IM_FORMAT_ALL_H 00012 00013 #if defined(__cplusplus) 00014 extern "C" { 00015 #endif 00016 00017 /** \defgroup tiff TIFF - Tagged Image File Format 00018 * \section Description 00019 * 00020 * \par 00021 * Copyright (c) 1986-1988, 1992 by Adobe Systems Incorporated. \n 00022 * Originally created by a group of companies, 00023 * the Aldus Corporation keeped the copyright until Aldus was aquired by Adobe. \n 00024 * TIFF Revision 6.0 Final June 3, 1992 \n 00025 * http://www.adobe.com/Support/TechNotes.html 00026 * \par 00027 * Access to the TIFF file format uses libTIFF version 3.8.2 \n 00028 * http://www.remotesensing.org/libtiff/ \n 00029 * Copyright (c) 1988-1997 Sam Leffler \n 00030 * Copyright (c) 1991-1997 Silicon Graphics, Inc. \n 00031 * 00032 * \section Features 00033 * 00034 \verbatim 00035 Data Types: <all> 00036 Color Spaces: Gray, RGB, CMYK, YCbCr, Lab, XYZ, Map and Binary. 00037 Compressions: 00038 NONE - no compression [default for IEEE Floating Point Data] 00039 CCITTRLE - CCITT modified Huffman RLE (binary only) [default for Binary] 00040 CCITTFAX3 - CCITT Group 3 fax (binary only) 00041 CCITTFAX4 - CCITT Group 4 fax (binary only) 00042 LZW - Lempel-Ziv & Welch [default] 00043 JPEG - ISO JPEG [default for YCBCR] 00044 NEXT - NeXT 2-bit RLE (2 bpp only) 00045 CCITTRLEW - CCITT modified Huffman RLE with word alignment (binary only) 00046 RLE - Packbits (Macintosh RLE) [default for MAP] 00047 THUNDERSCAN - ThunderScan 4-bit RLE (only for 2 or 4 bpp) 00048 PIXARLOG - Pixar companded 11-bit ZIP (only byte, ushort and float) 00049 DEFLATE - LZ77 variation (ZIP) 00050 ADOBE_DEFLATE - Adobe LZ77 variation 00051 SGILOG - SGI Log Luminance RLE for L and Luv (only byte, ushort and float) [default for XYZ] 00052 SGILOG24 - SGI Log 24-bit packed for Luv (only byte, ushort and float) 00053 Can have more than one image. 00054 Can have an alpha channel. 00055 Components can be packed or not. 00056 Lines arranged from top down to bottom or bottom up to top. 00057 Handle(1) returns a TIFF* libTIFF structure. 00058 00059 Attributes: 00060 Photometric IM_USHORT (1) (when writing this will complement the color_mode information, for Mask, MinIsWhite, ITULab and ICCLab) 00061 ExtraSampleInfo IM_USHORT (1) (description of alpha channel: 0- uknown, 1- pre-multiplied, 2-normal) 00062 JPEGQuality IM_INT (1) [0-100, default 75] (write only) 00063 ZIPQuality IM_INT (1) [1-9, default 6] (write only) 00064 ResolutionUnit (string) ["DPC", "DPI"] 00065 XResolution, YResolution IM_FLOAT (1) 00066 Description, Author, Copyright, DateTime, DocumentName, 00067 PageName, TargetPrinter, Make, Model, Software, HostComputer (string) 00068 InkNames (strings separated by '0's) 00069 InkSet IM_USHORT (1) 00070 NumberOfInks IM_USHORT (1) 00071 DotRange IM_USHORT (2) 00072 TransferFunction0, TransferFunction1, TransferFunction3 IM_USHORT [gray=0, rgb=012] 00073 ReferenceBlackWhite IMFLOAT (6) 00074 WhitePoint IMFLOAT (2) 00075 PrimaryChromaticities IMFLOAT (6) 00076 YCbCrCoefficients IM_FLOAT (3) 00077 YCbCrSubSampling IM_USHORT (2) 00078 YCbCrPositioning IM_USHORT (1) 00079 PageNumber IM_USHORT (2) 00080 StoNits IM_FLOAT (1) 00081 XPosition, YPosition IM_FLOAT (1) 00082 SMinSampleValue, SMaxSampleValue IM_FLOAT (1) 00083 HalftoneHints IM_USHORT (2) 00084 SubfileType IM_INT (1) 00085 ICCProfile IM_BYTE (N) 00086 MultiBandCount IM_USHORT (1) [Number of bands in a multiband gray image.] 00087 MultiBandSelect IM_USHORT (1) [Band number to read one band of a multiband gray image. Must be set before reading image info.] 00088 and other TIFF tags as they are described in the TIFF documentation. 00089 GeoTIFF tags: 00090 GeoTiePoints, GeoTransMatrix, IntergraphMatrix, GeoPixelScale, GeoDoubleParams IM_FLOAT (N) 00091 GeoASCIIParams (string) 00092 Read-only support for EXIF tags as they are described in the EXIF 2.2 documentation. See http://www.exif.org/ 00093 DNG tags as they are described in the DNG documentation. See http://www.adobe.com/br/products/dng/ 00094 Tags BlackLevel, DefaultCropOrigin and DefaultCropSize are incorrectly interpreted by libTIFF so they are ignored. 00095 Raw image is loaded in place of the thumbnail image in the main IFD. 00096 SubIFDCount IM_USHORT (1) [Number of subifds of the current image.] 00097 SubIFDSelect IM_USHORT (1) [Subifd number to be readed. Must be set before reading image info.] 00098 (other attributes can be obtained by using libTIFF directly using the Handle(1) function) 00099 00100 Comments: 00101 LogLuv is in fact Y'+CIE(u,v), so we choose to always convert it to XYZ. 00102 SubIFD is handled only for DNG. 00103 Since LZW patent expired, LZW compression is enabled. LZW Copyright Unisys. 00104 libGeoTIFF can be used without XTIFF initialization. Use Handle(1) to obtain a TIFF*. 00105 00106 Changes: 00107 "tiff_jpeg.c" - commented "downsampled_output = TRUE" in 2 places. 00108 New file "tif_config.h" to match our needs. 00109 New file "tiff_binfile.c" that implement I/O rotines using imBinFile. 00110 \endverbatim 00111 * \ingroup format */ 00112 void imFormatRegisterTIFF(void); 00113 00114 /** \defgroup jpeg JPEG - JPEG File Interchange Format 00115 * \section Description 00116 * 00117 * \par 00118 * ISO/IEC 10918 (1994, 1995, 1997, 1999)\n 00119 * http://www.jpeg.org/ 00120 * \par 00121 * Access to the JPEG file format uses libJPEG version 6b. \n 00122 * http://www.ijg.org \n 00123 * Copyright (C) 1991-1998, Thomas G. Lane \n 00124 * from the Independent JPEG Group. 00125 * \par 00126 * Access to the EXIF attributes uses libEXIF version 0.6.12. \n 00127 * http://sourceforge.net/projects/libexif \n 00128 * Copyright (C) 2001-2003, Lutz Müller 00129 * 00130 * \section Features 00131 * 00132 \verbatim 00133 Data Types: Byte 00134 Color Spaces: Gray, RGB, CMYK and YCbCr (Binary Saved as Gray) 00135 Compressions: 00136 JPEG - ISO JPEG [default] 00137 Only one image. 00138 No alpha channel. 00139 Internally the components are always packed. 00140 Internally the lines are arranged from top down to bottom. 00141 Handle(1) returns jpeg_decompress_struct* when reading, and 00142 jpeg_compress_struct* when writing (libJPEG structures). 00143 00144 Attributes: 00145 AutoYCbCr IM_INT (1) (controls YCbCr auto conversion) default 1 00146 JPEGQuality IM_INT (1) [0-100, default 75] (write only) 00147 ResolutionUnit (string) ["DPC", "DPI"] 00148 XResolution, YResolution IM_FLOAT (1) 00149 Interlaced (same as Progressive) IM_INT (1 | 0) default 0 00150 Description (string) 00151 (lots of Exif tags) 00152 00153 Changes to libJPEG: 00154 jdatadst.c - fflush and ferror replaced by macros JFFLUSH and JFERROR. 00155 jinclude.h - standard JFFLUSH and JFERROR definitions, and new macro HAVE_JFIO. 00156 jmorecfg.h - changed definition of INT32 to JINT32 for better compatibility. 00157 jdhuf.c - added support for OJPEG_SUPPORT in libTIFF. 00158 new file created: jconfig.h 00159 00160 Changes to libEXIF: 00161 new file config.h 00162 changed "exif-tag.c" to add new function 00163 changed "exif-entry.c" to improve exif_entry_initialize 00164 fixed small bug in "mnote-pentax-tag.h". 00165 00166 Comments: 00167 Other APPx markers are ignored. 00168 No thumbnail support. 00169 RGB images are automatically converted to YCbCr when saved. 00170 Also YcbCr are converted to RGB when loaded. Use AutoYCbCr=0 to disable this behavior. 00171 \endverbatim 00172 * \ingroup format */ 00173 void imFormatRegisterJPEG(void); 00174 00175 /** \defgroup png PNG - Portable Network Graphic Format 00176 * \section Description 00177 * 00178 * \par 00179 * Access to the PNG file format uses libPNG version 1.2.22. \n 00180 * http://www.libpng.org \n 00181 * Copyright (C) 1998-2007 Glenn Randers-Pehrson 00182 * 00183 * \section Features 00184 * 00185 \verbatim 00186 Data Types: Byte and UShort 00187 Color Spaces: Gray, RGB, MAP and Binary 00188 Compressions: 00189 DEFLATE - LZ77 variation (ZIP) [default] 00190 Only one image. 00191 Can have an alpha channel. 00192 Internally the components are always packed. 00193 Internally the lines are arranged from top down to bottom. 00194 Handle(1) returns png_structp libPNG structure. 00195 00196 Attributes: 00197 ZIPQuality IM_INT (1) [1-9, default 6] (write only) 00198 ResolutionUnit (string) ["DPC", "DPI"] 00199 XResolution, YResolution IM_FLOAT (1) 00200 Interlaced (same as Progressive) IM_INT (1 | 0) default 0 00201 Gamma IM_FLOAT (1) 00202 WhitePoint IMFLOAT (2) 00203 PrimaryChromaticities IMFLOAT (6) 00204 XPosition, YPosition IM_FLOAT (1) 00205 sRGBIntent IM_INT (1) [0: Perceptual, 1: Relative colorimetric, 2: Saturation, 3: Absolute colorimetric] 00206 TransparencyIndex IM_BYTE (1 or N) 00207 TransparentColor IM_BYTE (3) 00208 CalibrationName, CalibrationUnits (string) 00209 CalibrationLimits IM_INT (2) 00210 CalibrationEquation IM_BYTE (1) [0-Linear,1-Exponential,2-Arbitrary,3-HyperbolicSine)] 00211 CalibrationParam (string) [params separated by '\\n'] 00212 Title, Author, Description, Copyright, DateTime (string) 00213 Software, Disclaimer, Warning, Source, Comment, ... (string) 00214 DateTimeModified (string) [when writing uses the current system time] 00215 ICCProfile IM_BYTE (N) 00216 ScaleUnit (string) ["meters", "radians"] 00217 XScale, YScale IM_FLOAT (1) 00218 00219 Comments: 00220 Attributes after the image are ignored. 00221 Define PNG_NO_CONSOLE_IO to avoid printfs. 00222 We define PNG_TIME_RFC1123_SUPPORTED. 00223 Add the following files to the makefile to optimize the library: 00224 pngvcrd.c - PNG_USE_PNGVCRD 00225 For Intel x86 CPU and Microsoft Visual C++ compiler 00226 pnggccrd.c - PNG_USE_PNGGCCRD 00227 For Intel x86 CPU (Pentium-MMX or later) and GNU C compiler. 00228 Changed pngconf.h to use int instead of long in png_uint_32 and png_int_32. 00229 \endverbatim 00230 * \ingroup format */ 00231 void imFormatRegisterPNG(void); 00232 00233 /** \defgroup gif GIF - Graphics Interchange Format 00234 * \section Description 00235 * 00236 * \par 00237 * Copyright (c) 1987,1988,1989,1990 CompuServe Incorporated. \n 00238 * GIF is a Service Mark property of CompuServe Incorporated. \n 00239 * Graphics Interchange Format Programming Reference, 1990. \n 00240 * LZW Copyright Unisys. 00241 * \par 00242 * Patial Internal Implementation. \n 00243 * Decoding and encoding code were extracted from GIFLib 1.0. \n 00244 * Copyright (c) 1989 Gershon Elber. 00245 * 00246 * \section Features 00247 * 00248 \verbatim 00249 Data Types: Byte 00250 Color Spaces: MAP only, (Gray and Binary saved as MAP) 00251 Compressions: 00252 LZW - Lempel-Ziv & Welch [default] 00253 Can have more than one image. 00254 No alpha channel. 00255 Internally the lines are arranged from top down to bottom. 00256 00257 Attributes: 00258 ScreenHeight, ScreenWidth IM_USHORT (1) screen size [default to the first image size] 00259 Interlaced IM_INT (1 | 0) default 0 00260 Description (string) 00261 TransparencyIndex IM_BYTE (1) 00262 XScreen, YScreen IM_USHORT (1) screen position 00263 UserInput IM_BYTE (1) [1, 0] 00264 Disposal (string) [UNDEF, LEAVE, RBACK, RPREV] 00265 Delay IM_USHORT (1) 00266 Iterations IM_USHORT (1) (NETSCAPE2.0 Application Extension) 00267 00268 Comments: 00269 Attributes after the last image are ignored. 00270 Reads GIF87 and GIF89, but writes GIF89 always. 00271 Ignored attributes: Background Color Index, Pixel Aspect Ratio, 00272 Plain Text Extensions, Application Extensions... 00273 \endverbatim 00274 * \ingroup format */ 00275 void imFormatRegisterGIF(void); 00276 00277 /** \defgroup bmp BMP - Windows Device Independent Bitmap 00278 * \section Description 00279 * 00280 * \par 00281 * Windows Copyright Microsoft Corporation. 00282 * \par 00283 * Internal Implementation. 00284 * 00285 * \section Features 00286 * 00287 \verbatim 00288 Data Types: Byte 00289 Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 00290 Compressions: 00291 NONE - no compression [default] 00292 RLE - Run Lenght Encoding (only for MAP and Gray) 00293 Only one image. 00294 Can have an alpha channel (only for RGB) 00295 Internally the components are always packed. 00296 Lines arranged from top down to bottom or bottom up to top. But are saved always as bottom up. 00297 00298 Attributes: 00299 ResolutionUnit (string) ["DPC", "DPI"] 00300 XResolution, YResolution IM_FLOAT (1) 00301 00302 Comments: 00303 Reads OS2 1.x and Windows 3, but writes Windows 3 always. 00304 Version 4 and 5 BMPs are not supported. 00305 \endverbatim 00306 * \ingroup format */ 00307 void imFormatRegisterBMP(void); 00308 00309 /** \defgroup ras RAS - Sun Raster File 00310 * \section Description 00311 * 00312 * \par 00313 * Copyright Sun Corporation. 00314 * \par 00315 * Internal Implementation. 00316 * 00317 * \section Features 00318 * 00319 \verbatim 00320 Data Types: Byte 00321 Color Spaces: Gray, RGB, MAP and Binary 00322 Compressions: 00323 NONE - no compression [default] 00324 RLE - Run Lenght Encoding 00325 Only one image. 00326 Can have an alpha channel (only for IM_RGB) 00327 Internally the components are always packed. 00328 Internally the lines are arranged from top down to bottom. 00329 00330 Attributes: 00331 none 00332 \endverbatim 00333 * \ingroup format */ 00334 void imFormatRegisterRAS(void); 00335 00336 /** \defgroup led LED - IUP image in LED 00337 * \section Description 00338 * 00339 * \par 00340 * Copyright Tecgraf/PUC-Rio and PETROBRAS/CENPES. 00341 * \par 00342 * Internal Implementation. 00343 * 00344 * \section Features 00345 * 00346 \verbatim 00347 Data Types: Byte 00348 Color Spaces: MAP only (Gray and Binary saved as MAP) 00349 Compressions: 00350 NONE - no compression [default] 00351 Only one image. 00352 No alpha channel. 00353 Internally the lines are arranged from top down to bottom. 00354 00355 Attributes: 00356 none 00357 00358 Comments: 00359 LED file must start with "LEDImage = IMAGE[". 00360 \endverbatim 00361 * \ingroup format */ 00362 void imFormatRegisterLED(void); 00363 00364 /** \defgroup sgi SGI - Silicon Graphics Image File Format 00365 * \section Description 00366 * 00367 * \par 00368 * SGI is a trademark of Silicon Graphics, Inc. 00369 * \par 00370 * Internal Implementation. 00371 * 00372 * \section Features 00373 * 00374 \verbatim 00375 Data Types: Byte and UShort 00376 Color Spaces: Gray and RGB (Binary saved as Gray, MAP with fixed palette when reading only) 00377 Compressions: 00378 NONE - no compression [default] 00379 RLE - Run Lenght Encoding 00380 Only one image. 00381 Can have an alpha channel (only for IM_RGB) 00382 Internally the components are always packed. 00383 Internally the lines are arranged from bottom up to top. 00384 00385 Attributes: 00386 Description (string) 00387 \endverbatim 00388 * \ingroup format */ 00389 void imFormatRegisterSGI(void); 00390 00391 /** \defgroup pcx PCX - ZSoft Picture 00392 * \section Description 00393 * 00394 * \par 00395 * Copyright ZSoft Corporation. \n 00396 * ZSoft (1988) PCX Technical Reference Manual. 00397 * \par 00398 * Internal Implementation. 00399 * 00400 * \section Features 00401 * 00402 \verbatim 00403 Data Types: Byte 00404 Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 00405 Compressions: 00406 NONE - no compression 00407 RLE - Run Lenght Encoding [default - since uncompressed PCX is not well supported] 00408 Only one image. 00409 No alpha channel. 00410 Internally the components are always packed. 00411 Internally the lines are arranged from top down to bottom. 00412 00413 Attributes: 00414 ResolutionUnit (string) ["DPC", "DPI"] 00415 XResolution, YResolution IM_FLOAT (1) 00416 XScreen, YScreen IM_USHORT (1) screen position 00417 00418 Comments: 00419 Reads Versions 0-5, but writes Version 5 always. 00420 \endverbatim 00421 * \ingroup format */ 00422 void imFormatRegisterPCX(void); 00423 00424 /** \defgroup tga TGA - Truevision Graphics Adapter File 00425 * \section Description 00426 * 00427 * \par 00428 * Truevision TGA File Format Specification Version 2.0 \n 00429 * Technical Manual Version 2.2 January, 1991 \n 00430 * Copyright 1989, 1990, 1991 Truevision, Inc. 00431 * \par 00432 * Internal Implementation. 00433 * 00434 * \section Features 00435 * 00436 \verbatim 00437 Supports 8 bits per component only. Data type is always Byte. 00438 Color Spaces: Gray, RGB and MAP (Binary saved as Gray) 00439 Compressions: 00440 NONE - no compression [default] 00441 RLE - Run Lenght Encoding 00442 Only one image. 00443 No alpha channel. 00444 Internally the components are always packed. 00445 Internally the lines are arranged from bottom up to top or from top down to bottom. 00446 00447 Attributes: 00448 XScreen, YScreen IM_USHORT (1) screen position 00449 Title, Author, Description, JobName, Software (string) 00450 SoftwareVersion (read only) (string) 00451 DateTimeModified (string) [when writing uses the current system time] 00452 Gamma IM_FLOAT (1) 00453 \endverbatim 00454 * \ingroup format */ 00455 void imFormatRegisterTGA(void); 00456 00457 /** \defgroup pnm PNM - Netpbm Portable Image Map 00458 * \section Description 00459 * 00460 * \par 00461 * PNM formats Copyright Jef Poskanzer 00462 * \par 00463 * Internal Implementation. 00464 * 00465 * \section Features 00466 * 00467 \verbatim 00468 Data Types: Byte and UShort 00469 Color Spaces: Gray, RGB and Binary 00470 Compressions: 00471 NONE - no compression [default] 00472 ASCII (textual data) 00473 Can have more than one image, but sequencial access only. 00474 No alpha channel. 00475 Internally the components are always packed. 00476 Internally the lines are arranged from top down to bottom. 00477 00478 Attributes: 00479 Description (string) 00480 00481 Comments: 00482 In fact ASCII is an expansion... 00483 \endverbatim 00484 * \ingroup format */ 00485 void imFormatRegisterPNM(void); 00486 00487 /** \defgroup ico ICO - Windows Icon 00488 * \section Description 00489 * 00490 * \par 00491 * Windows Copyright Microsoft Corporation. 00492 * \par 00493 * Internal Implementation. 00494 * 00495 * \section Features 00496 * 00497 \verbatim 00498 Data Types: Byte 00499 Color Spaces: RGB, MAP and Binary (Gray saved as MAP) 00500 Compressions: 00501 NONE - no compression [default] 00502 Can have more than one image. But writing is limited to 5 images, 00503 and all images must have different sizes and bpp. 00504 Can have an alpha channel (only for RGB) 00505 Internally the components are always packed. 00506 Internally the lines are arranged from bottom up to top. 00507 00508 Attributes: 00509 TransparencyIndex IM_BYTE (1 or N) 00510 00511 Comments: 00512 If the user specifies an alpha channel, the AND mask is loaded as alpha if 00513 the file color mode does not contain the IM_ALPHA flag. 00514 For MAP imagens, if the user does not specifies an alpha channel 00515 the TransparencyIndex is used to initialize the AND mask when writing, 00516 and if the user does specifies an alpha channel 00517 the most repeated index with transparency will be the transparent index. 00518 Although any size and common bpp can be used is recomended to use the typical configurations: 00519 16x16, 32x32, 48x48, 64x64 or 96x96 00520 2 colors, 16 colors, 256 colors, 24bpp or 32bpp 00521 \endverbatim 00522 * \ingroup format */ 00523 void imFormatRegisterICO(void); 00524 00525 /** \defgroup krn KRN - IM Kernel File Format 00526 * \section Description 00527 * 00528 * \par 00529 * Textual format to provied a simple way to create kernel convolution images. 00530 * \par 00531 * Internal Implementation. 00532 * 00533 * \section Features 00534 * 00535 \verbatim 00536 Data Types: Byte, Int 00537 Color Spaces: Gray 00538 Compressions: 00539 NONE - no compression [default] 00540 Only one image. 00541 No alpha channel. 00542 Internally the lines are arranged from top down to bottom. 00543 00544 Attributes: 00545 Description (string) 00546 00547 Comments: 00548 The format is very simple, inspired by PNM. 00549 It was developed because PNM does not have support for INT and FLOAT. 00550 Remeber that usually convolution operations use kernel size an odd number. 00551 00552 Format Model: 00553 IMKERNEL 00554 Description up to 512 characters 00555 width height 00556 type (0 - IM_INT, 1 - IM_FLOAT) 00557 data... 00558 00559 Example: 00560 IMKERNEL 00561 Gradian 00562 3 3 00563 0 00564 0 -1 0 00565 0 1 0 00566 0 0 0 00567 \endverbatim 00568 * \ingroup format */ 00569 void imFormatRegisterKRN(void); 00570 00571 00572 #if defined(__cplusplus) 00573 } 00574 #endif 00575 00576 #endif