IM: File Formats

IM - An Imaging Tool

File Formats
[Image Storage]


Detailed Description

See im.h
Internal Predefined File Formats:
  • "BMP" - Windows Device Independent Bitmap
  • "PCX" - ZSoft Picture
  • "GIF" - Graphics Interchange Format
  • "TIFF" - Tagged Image File Format
  • "RAS" - Sun Raster File
  • "SGI" - Silicon Graphics Image File Format
  • "JPEG" - JPEG File Interchange Format
  • "LED" - IUP image in LED
  • "TGA" - Truevision Targa
  • "RAW" - RAW File
  • "PNM" - Netpbm Portable Image Map
  • "ICO" - Windows Icon
  • "PNG" - Portable Network Graphic Format
Other Supported File Formats:
  • "JP2" - JPEG-2000 JP2 File Format
  • "AVI" - Windows Audio-Video Interleaved RIFF
  • "WMV" - Windows Media Video Format
Some Known Compressions:
  • "NONE" - No Compression.
  • "RLE" - Run Lenght Encoding.
  • "LZW" - Lempel, Ziff and Welsh.
  • "JPEG" - Join Photographics Experts Group.
  • "DEFLATE" - LZ77 variation (ZIP)


Modules

 TIFF - Tagged Image File Format
 JPEG - JPEG File Interchange Format
 PNG - Portable Network Graphic Format
 GIF - Graphics Interchange Format
 BMP - Windows Device Independent Bitmap
 RAS - Sun Raster File
 LED - IUP image in LED
 SGI - Silicon Graphics Image File Format
 PCX - ZSoft Picture
 TGA - Truevision Graphics Adapter File
 PNM - Netpbm Portable Image Map
 ICO - Windows Icon
 KRN - IM Kernel File Format
 AVI - Windows Audio-Video Interleaved RIFF
 JP2 - JPEG-2000 JP2 File Format
 RAW - RAW File
 WMV - Windows Media Video Format

Functions

void imFormatRegisterInternal (void)
void imFormatRemoveAll (void)
void imFormatList (char **format_list, int *format_count)
int imFormatInfo (const char *format, char *desc, char *ext, int *can_sequence)
int imFormatCompressions (const char *format, char **comp, int *comp_count, int color_mode, int data_type)
int imFormatCanWriteImage (const char *format, const char *compression, int color_mode, int data_type)

Function Documentation

void imFormatRegisterInternal void   ) 
 

Registers all the internal formats.
It is automatically called internally when a format is accessed, but can be called to force the internal formats to be registered before other formats. Notice that additional formats when registered will be registered before the internal formats if imFormatRegisterInternal is not called yet.
To control the register order is usefull when two format drivers handle the same format. The first registered format will always be used first.

void imFormatRemoveAll void   ) 
 

Remove all registered formats.

void imFormatList char **  format_list,
int *  format_count
 

Returns a list of the registered formats.
format_list is an array of format identifiers. Each format identifier is 10 chars max, maximum of 50 formats. You can use "char* format_list[50]".

im.FormatList() -> format_list: table of strings [in Lua 5] 

int imFormatInfo const char *  format,
char *  desc,
char *  ext,
int *  can_sequence
 

Returns the format description.
Format description is 50 chars max.
Extensions are separated like "*.tif;*.tiff;", 50 chars max.
Returns an error code. The parameters can be NULL, except format. See also File Formats.

im.FormatInfo(format: string) -> error: number, desc: string, ext: string, can_sequence: boolean [in Lua 5] 

int imFormatCompressions const char *  format,
char **  comp,
int *  comp_count,
int  color_mode,
int  data_type
 

Returns the format compressions.
Compressions are 20 chars max each, maximum of 50 compressions. You can use "char* comp[50]".
color_mode and data_type are optional, use -1 to ignore them.
If you use them they will select only the allowed compressions checked like in imFormatCanWriteImage.
Returns an error code. See also File Formats, imErrorCodes, imDataType, imColorSpace and imColorModeConfig.

im.FormatCompressions(format: string, [color_mode: number], [data_type: number]) -> error: number, comp: table of strings [in Lua 5] 

int imFormatCanWriteImage const char *  format,
const char *  compression,
int  color_mode,
int  data_type
 

Checks if the format suport the given image class at the given compression.
Returns an error code. See also File Formats, imErrorCodes, imDataType, imColorSpace and imColorModeConfig.

im.FormatCanWriteImage(format: string, compression: string, color_mode: number, data_type: number) -> can_write: boolean [in Lua 5]