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: 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.6.1 \n
00029 * http://www.libtiff.org \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() returns a TIFF* of libTIFF.
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() 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, we use the libtiff-lzw-compression-kit-1.5 to enable LZW compression.
00095 LZW Copyright Unisys.
00096 libGeoTIFF can be used without XTIFF initialization. Use Handle() to obtain a TIFF*.
00097 Must define in the makefile: JPEG_SUPPORT, ZIP_SUPPORT, PIXARLOG_SUPPORT
00098 If your system does not have the definitions u_char, u_short, ...
00099 you must define BSDTYPES in the makefile when compiling libTIFF.
00100 Our include file "port.h" simply includes "tiffcomp.h".
00101 Changed "tiff_jpeg.c" - commented "downsampled_output = TRUE"
00102 New file tiff_binfile.c
00103 \endverbatim
00104 * \ingroup format */
00105 void imFormatRegisterTIFF(void);
00106
00107 /** \defgroup jpeg JPEG - JPEG File Interchange Format
00108 * \section Description
00109 *
00110 * \par
00111 * ISO/IEC 10918 (1994, 1995, 1997, 1999)\n
00112 * http://www.jpeg.org/
00113 * \par
00114 * Access to the JPEG file format uses libJPEG version 6b. \n
00115 * http://www.ijg.org \n
00116 * Copyright (C) 1991-1998, Thomas G. Lane \n
00117 * from the Independent JPEG Group.
00118 * \par
00119 * Access to the EXIF attributes uses libEXIF version 0.5.12. \n
00120 * http://sourceforge.net/projects/libexif \n
00121 * Copyright (C) 2001-2003, Lutz Müller
00122 *
00123 * \section Features
00124 *
00125 \verbatim
00126 Data Types: Byte
00127 Color Spaces: Gray, RGB, CMYK and YCbCr (Binary Saved as Gray)
00128 Compressions:
00129 JPEG - ISO JPEG [default]
00130 Only one image.
00131 No alpha channel.
00132 Internally the components are always packed.
00133 Internally the lines are arranged from top down to bottom.
00134 Handle() returns jpeg_decompress_struct* when reading, and
00135 jpeg_compress_struct* when writing.
00136
00137 Attributes:
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 new file created: jconfig.h
00150
00151 Changes to libEXIF:
00152 new file config.h
00153 changed "exif-tag.c" to add new function
00154 changed "exif-entry.c" to improve exif_entry_initialize
00155
00156 Comments:
00157 Other APPx markers are ignored.
00158 No thumbnail support.
00159 \endverbatim
00160 * \ingroup format */
00161 void imFormatRegisterJPEG(void);
00162
00163 /** \defgroup png PNG - Portable Network Graphic Format
00164 * \section Description
00165 *
00166 * \par
00167 * Access to the PNG file format uses libPNG version 1.2.5. \n
00168 * http://www.libpng.org \n
00169 * Copyright (C) 2000-2002 Glenn Randers-Pehrson
00170 * \par
00171 * Deflate compression support uses zlib version 1.2.1. \n
00172 * http://www.zlib.org \n
00173 * Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler
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() returns png_structp
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 \endverbatim
00221 * \ingroup format */
00222 void imFormatRegisterPNG(void);
00223
00224 /** \defgroup gif GIF - Graphics Interchange Format
00225 * \section Description
00226 *
00227 * \par
00228 * Copyright (c) 1987,1988,1989,1990 CompuServe Incorporated. \n
00229 * GIF is a Service Mark property of CompuServe Incorporated. \n
00230 * Graphics Interchange Format Programming Reference, 1990. \n
00231 * LZW Copyright Unisys.
00232 * \par
00233 * Patial Internal Implementation. \n
00234 * Decoding and encoding code were extracted from GIFLib 1.0. \n
00235 * Copyright (c) 1989 Gershon Elber.
00236 *
00237 * \section Features
00238 *
00239 \verbatim
00240 Data Types: Byte
00241 Color Spaces: MAP only, (Gray and Binary saved as MAP)
00242 Compressions:
00243 LZW - Lempel-Ziv & Welch [default]
00244 Can have more than one image.
00245 No alpha channel.
00246 Internally the lines are arranged from top down to bottom.
00247 Handle() returns a imBinFile* pointer.
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 Handle() returns imBinFile* pointer.
00290
00291 Attributes:
00292 ResolutionUnit (string) ["DPC", "DPI"]
00293 XResolution, YResolution IM_FLOAT (1)
00294
00295 Comments:
00296 Reads OS2 1.x and Windows 3, but writes Windows 3 always.
00297 Version 4 and 5 BMPs are not supported.
00298 \endverbatim
00299 * \ingroup format */
00300 void imFormatRegisterBMP(void);
00301
00302 /** \defgroup ras RAS - Sun Raster File
00303 * \section Description
00304 *
00305 * \par
00306 * Copyright Sun Corporation.
00307 * \par
00308 * Internal Implementation.
00309 *
00310 * \section Features
00311 *
00312 \verbatim
00313 Data Types: Byte
00314 Color Spaces: Gray, RGB, MAP and Binary
00315 Compressions:
00316 NONE - no compression [default]
00317 RLE - Run Lenght Encoding
00318 Only one image.
00319 Can have an alpha channel (only for IM_RGB)
00320 Internally the components are always packed.
00321 Internally the lines are arranged from top down to bottom.
00322 Handle() returns imBinFile* pointer.
00323
00324 Attributes:
00325 none
00326 \endverbatim
00327 * \ingroup format */
00328 void imFormatRegisterRAS(void);
00329
00330 /** \defgroup led LED - IUP image in LED
00331 * \section Description
00332 *
00333 * \par
00334 * Copyright Tecgraf/PUC-Rio and PETROBRAS/CENPES.
00335 * \par
00336 * Internal Implementation.
00337 *
00338 * \section Features
00339 *
00340 \verbatim
00341 Data Types: Byte
00342 Color Spaces: MAP only (Gray and Binary saved as MAP)
00343 Compressions:
00344 NONE - no compression [default]
00345 Only one image.
00346 No alpha channel.
00347 Internally the lines are arranged from top down to bottom.
00348 Handle() returns imBinFile* pointer.
00349
00350 Attributes:
00351 none
00352
00353 Comments:
00354 LED file must start with "LEDImage = IMAGE[".
00355 \endverbatim
00356 * \ingroup format */
00357 void imFormatRegisterLED(void);
00358
00359 /** \defgroup sgi SGI - Silicon Graphics Image File Format
00360 * \section Description
00361 *
00362 * \par
00363 * SGI is a trademark of Silicon Graphics, Inc.
00364 * \par
00365 * Internal Implementation.
00366 *
00367 * \section Features
00368 *
00369 \verbatim
00370 Data Types: Byte and UShort
00371 Color Spaces: Gray and RGB (Binary saved as Gray, MAP with fixed palette when reading only)
00372 Compressions:
00373 NONE - no compression [default]
00374 RLE - Run Lenght Encoding
00375 Only one image.
00376 Can have an alpha channel (only for IM_RGB)
00377 Internally the components are always packed.
00378 Internally the lines are arranged from bottom up to top.
00379 Handle() returns imBinFile* pointer.
00380
00381 Attributes:
00382 Description (string)
00383 \endverbatim
00384 * \ingroup format */
00385 void imFormatRegisterSGI(void);
00386
00387 /** \defgroup pcx PCX - ZSoft Picture
00388 * \section Description
00389 *
00390 * \par
00391 * Copyright ZSoft Corporation. \n
00392 * ZSoft (1988) PCX Technical Reference Manual.
00393 * \par
00394 * Internal Implementation.
00395 *
00396 * \section Features
00397 *
00398 \verbatim
00399 Data Types: Byte
00400 Color Spaces: RGB, MAP and Binary (Gray saved as MAP)
00401 Compressions:
00402 NONE - no compression
00403 RLE - Run Lenght Encoding [default - since uncompressed PCX is not well supported]
00404 Only one image.
00405 No alpha channel.
00406 Internally the components are always packed.
00407 Internally the lines are arranged from top down to bottom.
00408 Handle() returns imBinFile* pointer.
00409
00410 Attributes:
00411 ResolutionUnit (string) ["DPC", "DPI"]
00412 XResolution, YResolution IM_FLOAT (1)
00413 XScreen, YScreen IM_USHORT (1) screen position
00414
00415 Comments:
00416 Reads Versions 0-5, but writes Version 5 always.
00417 \endverbatim
00418 * \ingroup format */
00419 void imFormatRegisterPCX(void);
00420
00421 /** \defgroup tga TGA - Truevision Graphics Adapter File
00422 * \section Description
00423 *
00424 * \par
00425 * Truevision TGA File Format Specification Version 2.0 \n
00426 * Technical Manual Version 2.2 January, 1991 \n
00427 * Copyright 1989, 1990, 1991 Truevision, Inc.
00428 * \par
00429 * Internal Implementation.
00430 *
00431 * \section Features
00432 *
00433 \verbatim
00434 Supports 8 bits per component only. Data type is always Byte.
00435 Color Spaces: Gray, RGB and MAP (Binary saved as Gray)
00436 Compressions:
00437 NONE - no compression [default]
00438 RLE - Run Lenght Encoding
00439 Only one image.
00440 No alpha channel.
00441 Internally the components are always packed.
00442 Internally the lines are arranged from bottom up to top or from top down to bottom.
00443 Handle() returns imBinFile* pointer.
00444
00445 Attributes:
00446 XScreen, YScreen IM_USHORT (1) screen position
00447 Title, Author, Description, JobName, Software (string)
00448 SoftwareVersion (read only) (string)
00449 DateTimeModified (string) [when writing uses the current system time]
00450 Gamma IM_FLOAT (1)
00451 \endverbatim
00452 * \ingroup format */
00453 void imFormatRegisterTGA(void);
00454
00455 /** \defgroup pnm PNM - Netpbm Portable Image Map
00456 * \section Description
00457 *
00458 * \par
00459 * PNM formats Copyright Jef Poskanzer
00460 * \par
00461 * Internal Implementation.
00462 *
00463 * \section Features
00464 *
00465 \verbatim
00466 Data Types: Byte and UShort
00467 Color Spaces: Gray, RGB and Binary
00468 Compressions:
00469 NONE - no compression [default]
00470 ASCII (textual data)
00471 Can have more than one image, but sequencial access only.
00472 No alpha channel.
00473 Internally the components are always packed.
00474 Internally the lines are arranged from top down to bottom.
00475 Handle() returns imBinFile* pointer.
00476
00477 Attributes:
00478 Description (string)
00479
00480 Comments:
00481 In fact ASCII is an expansion...
00482 \endverbatim
00483 * \ingroup format */
00484 void imFormatRegisterPNM(void);
00485
00486 /** \defgroup ico ICO - Windows Icon
00487 * \section Description
00488 *
00489 * \par
00490 * Windows Copyright Microsoft Corporation.
00491 * \par
00492 * Internal Implementation.
00493 *
00494 * \section Features
00495 *
00496 \verbatim
00497 Data Types: Byte
00498 Color Spaces: RGB, MAP and Binary (Gray saved as MAP)
00499 Compressions:
00500 NONE - no compression [default]
00501 Can have more than one image. But writing is limited to 5 images,
00502 and all images must have different sizes and bpp.
00503 No alpha channel.
00504 Internally the components are always packed.
00505 Internally the lines are arranged from bottom up to top.
00506 Handle() returns imBinFile* pointer.
00507
00508 Attributes:
00509 none
00510
00511 Comments:
00512 If the user specifies an alpha channel, the AND mask is loaded as alpha,
00513 but the file color mode never contains the IM_ALPHA flag.
00514 Although any size and bpp can be used is recomended to use the typical configurations:
00515 16x16, 32x32, 48x48, 64x64 or 96x96
00516 2 colors, 16 colors or 256 colors
00517 \endverbatim
00518 * \ingroup format */
00519 void imFormatRegisterICO(void);
00520
00521 /** \defgroup krn KRN - IM Kernel File Format
00522 * \section Description
00523 *
00524 * \par
00525 * Textual format to provied a simple way to create kernel convolution images.
00526 * \par
00527 * Internal Implementation.
00528 *
00529 * \section Features
00530 *
00531 \verbatim
00532 Data Types: Byte, Int
00533 Color Spaces: Gray
00534 Compressions:
00535 NONE - no compression [default]
00536 Only one image.
00537 No alpha channel.
00538 Internally the lines are arranged from top down to bottom.
00539 Handle() returns imBinFile* pointer.
00540
00541 Attributes:
00542 Description (string)
00543
00544 Comments:
00545 The format is very simple, inspired by PNM.
00546 It was developed because PNM does not have support for INT and FLOAT.
00547 Remeber that usually convolution operations use kernel size an odd number.
00548
00549 Format Model:
00550 IMKERNEL
00551 Description up to 512 characters
00552 width height
00553 type (0 - IM_INT, 1 - IM_FLOAT)
00554 data...
00555
00556 Example:
00557 IMKERNEL
00558 Gradian
00559 3 3
00560 0
00561 0 -1 0
00562 0 1 0
00563 0 0 0
00564 \endverbatim
00565 * \ingroup format */
00566 void imFormatRegisterKRN(void);
00567
00568
00569 #if defined(__cplusplus)
00570 }
00571 #endif
00572
00573 #endif