TLIB documentation
 

tlFile.h File Reference


Detailed Description

Internal file I/O routines.

#include "tlVision.h"

Include dependency graph for tlFile.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int tl_write_bmp (tlPixel *src, int width, int height, tl_format format, char *filename)
int tl_write_jpg (tlPixel *src, int width, int height, int pixel_width, int quality, char *filename)
int tl_write_ppm (tlPixel *src, int width, int height, char *filename)
int tl_write_tlb (tlImage *image, char *filename)
tlPixeltl_read_bmp (char *filename, int *width, int *height, tl_format *format)
tlPixeltl_read_jpg (char *filename, int *width, int *height, tl_format *format)
tlPixeltl_read_ppm (char *filename, int *width, int *height, tl_format *format)
void * tl_read_tlb (char *filename, int *width, int *height, int *pixel_width, tl_format *format)


Function Documentation

tlPixel* tl_read_bmp ( char *  filename,
int *  width,
int *  height,
tl_format format 
)

Read an image from a BMP format.

Parameters:
filename file name
width [out] image width
height [out] image height
format [out] image format
Returns:
A pointer to the image pixel array read on success, NULL otherwise.
See error management for details.

tlPixel* tl_read_jpg ( char *  filename,
int *  width,
int *  height,
tl_format format 
)

Read an image from a JPEG format.

Parameters:
filename file name
width [out] image width
height [out] image height
format [out] image format
Returns:
A pointer to the image pixel array read on success, NULL otherwise.
See error management for details.

tlPixel* tl_read_ppm ( char *  filename,
int *  width,
int *  height,
tl_format format 
)

Read an image from a Portable Pixmap format (binary format).

Parameters:
filename file name
width [out] image width
height [out] image height
format [out] image format
Returns:
A pointer to the image pixel array read on success, NULL otherwise.
See error management for details.

void* tl_read_tlb ( char *  filename,
int *  width,
int *  height,
int *  pixel_width,
tl_format format 
)

Read an image in TLIB format.

Parameters:
filename file name
width [out] image width
height [out] image height
pixel_width [out] pixel width
format [out] image format
Returns:
A pointer to the image pixel array read on success, NULL otherwise.
See error management for details.

int tl_write_bmp ( tlPixel src,
int  width,
int  height,
tl_format  format,
char *  filename 
)

Write to Bitmap format.

Parameters:
src RGB pixel array to save
width image width
height image height
format image format
filename the file name. If NULL, write to stdout
Returns:
0 on success, -1 otherwise.
See error management for details.
Warning:
this code is NOT portable! Do not attempt to use this on anything other than 32-bit little-endian machines!

int tl_write_jpg ( tlPixel src,
int  width,
int  height,
int  pixel_width,
int  quality,
char *  filename 
)

Write to JPEG format.

Parameters:
src RGB pixel array to save
width image width
height image height
filename the file name; if NULL, write to stdout
pixel_width the number of bytes in each pixel
quality the quality of the output jpg file [%]
Returns:
0 on success, -1 otherwise. See error management for details.

int tl_write_ppm ( tlPixel src,
int  width,
int  height,
char *  filename 
)

Write to Portable Pixmap format (binary format).

Parameters:
src RGB pixel array to save
width image width
height image height
filename the file name; if NULL, write to stdout
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_write_tlb ( tlImage image,
char *  filename 
)

Write to TLIB image format.

image image to save filename the file name. If NULL, write to stdout.

Returns:
0 on success, -1 otherwise.
See error management for details.



TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.