IM: im_format_all.h Source File

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  * $Id: im_format_all.h,v 1.6 2005/04/18 21:41:41 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.2 \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, LZW compression is enabled. LZW Copyright Unisys.
00095       libGeoTIFF can be used without XTIFF initialization. Use Handle() to obtain a TIFF*.
00096       Must define in the makefile: JPEG_SUPPORT, ZIP_SUPPORT, PIXARLOG_SUPPORT, OJPEG_SUPPORT.
00097       Changed "tiff_jpeg.c" - commented "downsampled_output = TRUE" in 2 places.
00098       Fixed "tiff_ojpeg.c" for boolean type compilation. 
00099       New file tiff_binfile.c
00100       Changed tif_config.h to match our needs.
00101 \endverbatim
00102  * \ingroup format */
00103 void imFormatRegisterTIFF(void);
00104 
00105 /** \defgroup jpeg JPEG - JPEG File Interchange Format
00106  * \section Description
00107  * 
00108  * \par
00109  * ISO/IEC 10918 (1994, 1995, 1997, 1999)\n
00110  * http://www.jpeg.org/
00111  * \par
00112  * Access to the JPEG file format uses libJPEG version 6b. \n
00113  * http://www.ijg.org                                      \n
00114  * Copyright (C) 1991-1998, Thomas G. Lane                 \n
00115  *   from the Independent JPEG Group.
00116  * \par
00117  * Access to the EXIF attributes uses libEXIF version 0.6.12. \n
00118  * http://sourceforge.net/projects/libexif                    \n
00119  * Copyright (C) 2001-2003, Lutz Müller
00120  *
00121  * \section Features
00122  *
00123 \verbatim
00124     Data Types: Byte
00125     Color Spaces: Gray, RGB, CMYK and YCbCr (Binary Saved as Gray)
00126     Compressions: 
00127       JPEG - ISO JPEG  [default]
00128     Only one image.
00129     No alpha channel.
00130     Internally the components are always packed.
00131     Internally the lines are arranged from top down to bottom.
00132     Handle() returns jpeg_decompress_struct* when reading, and 
00133       jpeg_compress_struct* when writing.
00134  
00135     Attributes:
00136       AutoYCbCr IM_INT (1) (controls YCbCr auto conversion) default 1
00137       JPEGQuality IM_INT (1) [0-100, default 75] (write only)
00138       ResolutionUnit (string) ["DPC", "DPI"]
00139       XResolution, YResolution IM_FLOAT (1)
00140       Interlaced (same as Progressive) IM_INT (1 | 0) default 0  
00141       Description (string)
00142       (lots of Exif tags)
00143  
00144     Changes to libJPEG:
00145       jdatadst.c - fflush and ferror replaced by macros JFFLUSH and JFERROR.
00146       jinclude.h - standard JFFLUSH and JFERROR definitions, and new macro HAVE_JFIO.
00147       jmorecfg.h - changed definition of INT32 to JINT32 for better compatibility.
00148       jdhuf.c - added support for OJPEG_SUPPORT in libTIFF.
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       fixed small bug in "mnote-pentax-tag.h".
00156 
00157     Comments:
00158       Other APPx markers are ignored.
00159       No thumbnail support.
00160       RGB images are automatically converted to YCbCr when saved. 
00161       Also YcbCr are converted to RGB when loaded. Use AutoYCbCr=0 to disable this behavior. 
00162 \endverbatim
00163  * \ingroup format */
00164 void imFormatRegisterJPEG(void);
00165 
00166 /** \defgroup png PNG - Portable Network Graphic Format
00167  * \section Description
00168  * 
00169  * \par
00170  * Access to the PNG file format uses libPNG version 1.2.8. \n
00171  * http://www.libpng.org                                    \n
00172  * Copyright (C) 1998-2004 Glenn Randers-Pehrson
00173  *
00174  * \section Features
00175  *
00176 \verbatim
00177     Data Types: Byte and UShort
00178     Color Spaces: Gray, RGB, MAP and Binary
00179     Compressions: 
00180       DEFLATE - LZ77 variation (ZIP) [default]
00181     Only one image.
00182     Can have an alpha channel.
00183     Internally the components are always packed.
00184     Internally the lines are arranged from top down to bottom.
00185     Handle() returns png_structp
00186  
00187     Attributes:
00188       ZIPQuality IM_INT (1) [1-9, default 6] (write only)
00189       ResolutionUnit (string) ["DPC", "DPI"]
00190       XResolution, YResolution IM_FLOAT (1)
00191       Interlaced (same as Progressive) IM_INT (1 | 0) default 0 
00192       Gamma IM_FLOAT (1)
00193       WhitePoint IMFLOAT (2)
00194       PrimaryChromaticities  IMFLOAT (6)
00195       XPosition, YPosition IM_FLOAT (1)
00196       sRGBIntent IM_INT (1) [0: Perceptual, 1: Relative colorimetric, 2: Saturation, 3: Absolute colorimetric]
00197       TransparencyIndex IM_BYTE (1 or N)
00198       TransparentColor IM_BYTE (3)
00199       CalibrationName, CalibrationUnits (string)
00200       CalibrationLimits IM_INT (2) 
00201       CalibrationEquation IM_BYTE (1) [0-Linear,1-Exponential,2-Arbitrary,3-HyperbolicSine)]
00202       CalibrationParam (string) [params separated by '\\n']
00203       Title, Author, Description, Copyright, DateTime (string)
00204       Software, Disclaimer, Warning, Source, Comment, ...       (string)
00205       DateTimeModified (string) [when writing uses the current system time]
00206       ICCProfile IM_BYTE (N)
00207       ScaleUnit (string) ["meters", "radians"]
00208       XScale, YScale IM_FLOAT (1)
00209 
00210     Comments:
00211       Attributes after the image are ignored.
00212       Define PNG_NO_CONSOLE_IO to avoid printfs.
00213       We define PNG_TIME_RFC1123_SUPPORTED.
00214       Add the following files to the makefile to optimize the library:
00215       pngvcrd.c  - PNG_USE_PNGVCRD
00216                    For Intel x86 CPU and Microsoft Visual C++ compiler
00217       pnggccrd.c - PNG_USE_PNGGCCRD
00218                    For Intel x86 CPU (Pentium-MMX or later) and GNU C compiler.
00219       Changed pngconf.h to use int instead of long in png_uint_32 and png_int_32.
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       TransparencyIndex IM_BYTE (1 or N)
00510 
00511     Comments:
00512       If the user specifies an alpha channel, the AND mask is loaded as alpha,
00513         but the file color mode will not contain the IM_ALPHA flag.
00514       For IM_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 the most repeated index with transparency will be the transparent index.
00517       Although any size and bpp can be used is recomended to use the typical configurations:
00518         16x16, 32x32, 48x48, 64x64 or 96x96
00519         2 colors, 16 colors or 256 colors
00520 \endverbatim
00521  * \ingroup format */
00522 void imFormatRegisterICO(void);
00523 
00524 /** \defgroup krn KRN - IM Kernel File Format
00525  * \section Description
00526  * 
00527  * \par
00528  * Textual format to provied a simple way to create kernel convolution images.
00529  * \par
00530  * Internal Implementation.
00531  *
00532  * \section Features
00533  *
00534 \verbatim
00535     Data Types: Byte, Int
00536     Color Spaces: Gray
00537     Compressions: 
00538       NONE - no compression [default]
00539     Only one image.
00540     No alpha channel.
00541     Internally the lines are arranged from top down to bottom.
00542     Handle() returns imBinFile* pointer.
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