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.8 2005/12/07 20:28:27 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() 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       
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() returns jpeg_decompress_struct* when reading, and 
00134       jpeg_compress_struct* when writing.
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() 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       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     Handle() returns a imBinFile* pointer.
00249  
00250     Attributes:
00251       ScreenHeight, ScreenWidth IM_USHORT (1) screen size [default to the first image size]
00252       Interlaced IM_INT (1 | 0) default 0 
00253       Description (string)
00254       TransparencyIndex IM_BYTE (1)
00255       XScreen, YScreen IM_USHORT (1) screen position
00256       UserInput IM_BYTE (1) [1, 0]
00257       Disposal (string) [UNDEF, LEAVE, RBACK, RPREV]
00258       Delay IM_USHORT (1)
00259       Iterations IM_USHORT (1) (NETSCAPE2.0 Application Extension)
00260 
00261     Comments:
00262       Attributes after the last image are ignored.
00263       Reads GIF87 and GIF89, but writes GIF89 always.
00264       Ignored attributes: Background Color Index, Pixel Aspect Ratio, 
00265                           Plain Text Extensions, Application Extensions...
00266 \endverbatim
00267  * \ingroup format */
00268 void imFormatRegisterGIF(void);
00269 
00270 /** \defgroup bmp BMP - Windows Device Independent Bitmap
00271  * \section Description
00272  * 
00273  * \par
00274  * Windows Copyright Microsoft Corporation.
00275  * \par
00276  * Internal Implementation.
00277  *
00278  * \section Features
00279  *
00280 \verbatim
00281     Data Types: Byte
00282     Color Spaces: RGB, MAP and Binary (Gray saved as MAP)
00283     Compressions: 
00284       NONE - no compression [default]
00285       RLE  - Run Lenght Encoding (only for MAP and Gray)
00286     Only one image.
00287     Can have an alpha channel (only for RGB)
00288     Internally the components are always packed.
00289     Lines arranged from top down to bottom or bottom up to top. But are saved always as bottom up.
00290     Handle() returns imBinFile* pointer.
00291  
00292     Attributes:
00293       ResolutionUnit (string) ["DPC", "DPI"]
00294       XResolution, YResolution IM_FLOAT (1)
00295 
00296     Comments:
00297       Reads OS2 1.x and Windows 3, but writes Windows 3 always.
00298       Version 4 and 5 BMPs are not supported.
00299 \endverbatim
00300  * \ingroup format */
00301 void imFormatRegisterBMP(void);
00302 
00303 /** \defgroup ras RAS - Sun Raster File
00304  * \section Description
00305  * 
00306  * \par
00307  * Copyright Sun Corporation.
00308  * \par
00309  * Internal Implementation.
00310  *
00311  * \section Features
00312  *
00313 \verbatim
00314     Data Types: Byte
00315     Color Spaces: Gray, RGB, MAP and Binary
00316     Compressions: 
00317       NONE - no compression   [default]
00318       RLE  - Run Lenght Encoding
00319     Only one image.
00320     Can have an alpha channel (only for IM_RGB)
00321     Internally the components are always packed.
00322     Internally the lines are arranged from top down to bottom.
00323     Handle() returns imBinFile* pointer.
00324  
00325     Attributes:
00326       none
00327 \endverbatim
00328  * \ingroup format */
00329 void imFormatRegisterRAS(void);
00330 
00331 /** \defgroup led LED - IUP image in LED
00332  * \section Description
00333  * 
00334  * \par
00335  * Copyright Tecgraf/PUC-Rio and PETROBRAS/CENPES.
00336  * \par
00337  * Internal Implementation.
00338  *
00339  * \section Features
00340  *
00341 \verbatim
00342     Data Types: Byte
00343     Color Spaces: MAP only (Gray and Binary saved as MAP)
00344     Compressions: 
00345       NONE - no compression  [default]
00346     Only one image. 
00347     No alpha channel.
00348     Internally the lines are arranged from top down to bottom.
00349     Handle() returns imBinFile* pointer.
00350  
00351     Attributes:
00352       none
00353 
00354     Comments:
00355       LED file must start with "LEDImage = IMAGE[".
00356 \endverbatim
00357  * \ingroup format */
00358 void imFormatRegisterLED(void);
00359 
00360 /** \defgroup sgi SGI - Silicon Graphics Image File Format
00361  * \section Description
00362  * 
00363  * \par
00364  * SGI is a trademark of Silicon Graphics, Inc.
00365  * \par
00366  * Internal Implementation.
00367  *
00368  * \section Features
00369  *
00370 \verbatim
00371     Data Types: Byte and UShort
00372     Color Spaces: Gray and RGB (Binary saved as Gray, MAP with fixed palette when reading only)
00373     Compressions: 
00374       NONE - no compression  [default]
00375       RLE  - Run Lenght Encoding
00376     Only one image.
00377     Can have an alpha channel (only for IM_RGB)
00378     Internally the components are always packed.
00379     Internally the lines are arranged from bottom up to top.
00380     Handle() returns imBinFile* pointer.
00381  
00382     Attributes:
00383       Description (string)
00384 \endverbatim
00385  * \ingroup format */
00386 void imFormatRegisterSGI(void);
00387 
00388 /** \defgroup pcx PCX - ZSoft Picture
00389  * \section Description
00390  * 
00391  * \par
00392  * Copyright ZSoft Corporation. \n
00393  * ZSoft (1988) PCX Technical Reference Manual.
00394  * \par
00395  * Internal Implementation.
00396  *
00397  * \section Features
00398  *
00399 \verbatim
00400     Data Types: Byte
00401     Color Spaces: RGB, MAP and Binary (Gray saved as MAP)
00402     Compressions: 
00403       NONE - no compression 
00404       RLE  - Run Lenght Encoding [default - since uncompressed PCX is not well supported]
00405     Only one image.
00406     No alpha channel.
00407     Internally the components are always packed.
00408     Internally the lines are arranged from top down to bottom.
00409     Handle() returns imBinFile* pointer.
00410  
00411     Attributes:
00412       ResolutionUnit (string) ["DPC", "DPI"]
00413       XResolution, YResolution IM_FLOAT (1)
00414       XScreen, YScreen IM_USHORT (1) screen position
00415 
00416     Comments:
00417       Reads Versions 0-5, but writes Version 5 always.
00418 \endverbatim
00419  * \ingroup format */
00420 void imFormatRegisterPCX(void);
00421 
00422 /** \defgroup tga TGA - Truevision Graphics Adapter File
00423  * \section Description
00424  * 
00425  * \par
00426  * Truevision TGA File Format Specification Version 2.0 \n
00427  * Technical Manual Version 2.2 January, 1991           \n
00428  * Copyright 1989, 1990, 1991 Truevision, Inc.
00429  * \par
00430  * Internal Implementation.
00431  *
00432  * \section Features
00433  *
00434 \verbatim
00435     Supports 8 bits per component only. Data type is always Byte.
00436     Color Spaces: Gray, RGB and MAP (Binary saved as Gray)
00437     Compressions: 
00438       NONE - no compression [default]
00439       RLE  - Run Lenght Encoding
00440     Only one image.
00441     No alpha channel.
00442     Internally the components are always packed.
00443     Internally the lines are arranged from bottom up to top or from top down to bottom.
00444     Handle() returns imBinFile* pointer.
00445  
00446     Attributes:
00447       XScreen, YScreen IM_USHORT (1) screen position
00448       Title, Author, Description, JobName, Software (string)
00449       SoftwareVersion (read only) (string)
00450       DateTimeModified (string) [when writing uses the current system time]
00451       Gamma IM_FLOAT (1)
00452 \endverbatim
00453  * \ingroup format */
00454 void imFormatRegisterTGA(void);
00455 
00456 /** \defgroup pnm PNM - Netpbm Portable Image Map
00457  * \section Description
00458  * 
00459  * \par
00460  * PNM formats Copyright Jef Poskanzer
00461  * \par
00462  * Internal Implementation.
00463  *
00464  * \section Features
00465  *
00466 \verbatim
00467     Data Types: Byte and UShort
00468     Color Spaces: Gray, RGB and Binary
00469     Compressions: 
00470       NONE - no compression [default]
00471       ASCII (textual data)
00472     Can have more than one image, but sequencial access only.
00473     No alpha channel.
00474     Internally the components are always packed.
00475     Internally the lines are arranged from top down to bottom.
00476     Handle() returns imBinFile* pointer.
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     No alpha channel.
00505     Internally the components are always packed.
00506     Internally the lines are arranged from bottom up to top.
00507     Handle() returns imBinFile* pointer.
00508  
00509     Attributes:
00510       TransparencyIndex IM_BYTE (1 or N)
00511 
00512     Comments:
00513       If the user specifies an alpha channel, the AND mask is loaded as alpha,
00514         but the file color mode will not contain the IM_ALPHA flag.
00515       For IM_MAP imagens, if the user does not specifies an alpha channel 
00516         the TransparencyIndex is used to initialize the AND mask when writing,
00517         and the most repeated index with transparency will be the transparent index.
00518       Although any size and bpp can be used is recomended to use the typical configurations:
00519         16x16, 32x32, 48x48, 64x64 or 96x96
00520         2 colors, 16 colors or 256 colors
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     Handle() returns imBinFile* pointer.
00544  
00545     Attributes:
00546       Description (string)
00547 
00548     Comments:
00549       The format is very simple, inspired by PNM.
00550       It was developed because PNM does not have support for INT and FLOAT.
00551       Remeber that usually convolution operations use kernel size an odd number.
00552 
00553     Format Model:
00554       IMKERNEL
00555       Description up to 512 characters
00556       width height
00557       type (0 - IM_INT, 1 - IM_FLOAT)
00558       data...
00559 
00560     Example:
00561       IMKERNEL
00562       Gradian
00563       3 3
00564       0
00565       0 -1 0     
00566       0  1 0  
00567       0  0 0  
00568 \endverbatim
00569  * \ingroup format */
00570 void imFormatRegisterKRN(void);
00571 
00572 
00573 #if defined(__cplusplus)
00574 }
00575 #endif
00576 
00577 #endif