io_tiff.cpp File Reference

TIFF I/O routines. More...

#include "io_tiff.h"
Include dependency graph for io_tiff.cpp:

Go to the source code of this file.

Defines

#define TIFFPackRGBA(r, g, b, a)

Functions

static uint32 * read_tiff_rgba_raw (const char *fname, size_t *nx, size_t *ny)
 load the raw data from a TIFF image file as an uint32 array.
static void * read_tiff_rgba (const char *fname, size_t *nx, size_t *ny, int dtype)
 load the data from a TIFF image file as an RGBA array
float * read_tiff_rgba_f32 (const char *fname, size_t *nx, size_t *ny)
 load the data from a TIFF image file as a float RGBA array
unsigned char * read_tiff_rgba_u8 (const char *fname, size_t *nx, size_t *ny)
 load the data from a TIFF image file as a 8bit RGBA array
static int write_tiff_rgba_raw (const char *fname, const uint32 *data_tiff, size_t nx, size_t ny)
 save an array into a LZW-compressed TIFF file
static int write_tiff_rgba (const char *fname, const void *data, size_t nx, size_t ny, int dtype)
 save four contiguous arrays into a TIFF file
int write_tiff_rgba_f32 (const char *fname, const float *data, size_t nx, size_t ny)
 save four contiguous float arrays into a TIFF file
int write_tiff_rgba_u8 (const char *fname, const unsigned char *data, size_t nx, size_t ny)
 save four contiguous 8bit arrays into a TIFF file

Detailed Description

TIFF I/O routines.

Author:
Nicolas Limare <nicolas.limare@cmla.ens-cachan.fr>
Todo:

stdin/stdout handling

simple RGB/grayscale version

TIFF float version

These routines focus on RGBA 8bit TIFF files. These files can be read into or written from unsigned char or float arrays.

Definition in file io_tiff.cpp.


Define Documentation

#define TIFFPackRGBA ( r,
g,
b,
 ) 
Value:
(uint32) ((r & 0xff)                   \
| (g & 0xff) << 8            \
| (b & 0xff) << 16           \
| (a & 0xff) << 24)

Macro for packing RGBA components to the ABGR form used by TIFFReadRGBAImage.

See TIFFGetR() in tiffio.h for the reverse operation.

Definition at line 289 of file io_tiff.cpp.


Function Documentation

static void* read_tiff_rgba ( const char *  fname,
size_t *  nx,
size_t *  ny,
int  dtype 
) [static]

load the data from a TIFF image file as an RGBA array

The array is allocated by this function. It hold the RGBA pixels as 4 contiguous arrays.

Parameters:
fname the file name to read
nx,ny storage space for the image size
dtype the desired output type : DT_U8 or DT_F32
Returns:
the data array pointer, NULL if an error occured

Definition at line 96 of file io_tiff.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float* read_tiff_rgba_f32 ( const char *  fname,
size_t *  nx,
size_t *  ny 
)

load the data from a TIFF image file as a float RGBA array

The array is allocated in this function call. It hold the RGBA pixels as 4 contiguous arrays.

Parameters:
fname the file name to read
nx,ny storage space for the image size
Returns:
the data array pointer, NULL if an error occured

Definition at line 198 of file io_tiff.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static uint32* read_tiff_rgba_raw ( const char *  fname,
size_t *  nx,
size_t *  ny 
) [static]

load the raw data from a TIFF image file as an uint32 array.

The array is allocated by this function. Uint32 is the native data type in libtiff.

Parameters:
fname the file name to read
nx,ny storage space for the image size
Returns:
the data array pointer, NULL if an error occured

Definition at line 39 of file io_tiff.cpp.

Here is the caller graph for this function:

unsigned char* read_tiff_rgba_u8 ( const char *  fname,
size_t *  nx,
size_t *  ny 
)

load the data from a TIFF image file as a 8bit RGBA array

The array is allocated in this function call. It hold the RGBA pixels as 4 contiguous arrays.

Parameters:
fname the file name to read
nx,ny storage space for the image size
Returns:
the data array pointer, NULL if an error occured

Definition at line 214 of file io_tiff.cpp.

Here is the call graph for this function:

static int write_tiff_rgba ( const char *  fname,
const void *  data,
size_t  nx,
size_t  ny,
int  dtype 
) [static]

save four contiguous arrays into a TIFF file

The array balues are supposed in [0,255].

Parameters:
fname TIFF file name
data input array of float values supposed in [0,255]
nx ny array size
dtype the input data type : DT_U8 or DT_F32
Returns:
0 if OK, != 0 if an error occured

Definition at line 306 of file io_tiff.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int write_tiff_rgba_f32 ( const char *  fname,
const float *  data,
size_t  nx,
size_t  ny 
)

save four contiguous float arrays into a TIFF file

Parameters:
fname TIFF file name
data input array of float values supposed in [0,255]
nx ny array size
Returns:
0 if OK, != 0 if an error occured

Definition at line 388 of file io_tiff.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static int write_tiff_rgba_raw ( const char *  fname,
const uint32 *  data_tiff,
size_t  nx,
size_t  ny 
) [static]

save an array into a LZW-compressed TIFF file

Returns:
0 if OK, != 0 if an error occured

Definition at line 228 of file io_tiff.cpp.

Here is the caller graph for this function:

int write_tiff_rgba_u8 ( const char *  fname,
const unsigned char *  data,
size_t  nx,
size_t  ny 
)

save four contiguous 8bit arrays into a TIFF file

Parameters:
fname TIFF file name
data input array of 8bit values
nx ny array size
Returns:
0 if OK, != 0 if an error occured

Definition at line 403 of file io_tiff.cpp.

Here is the call graph for this function:

 All Files Functions Defines

Generated on Fri May 27 09:39:38 2011 for self similarity driven demosaicking by  doxygen 1.6.1