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