TIFF I/O routines. More...
#include "io_tiff.h"
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 |
TIFF I/O routines.
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 TIFFPackRGBA | ( | r, | |||
g, | |||||
b, | |||||
a | ) |
(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.
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.
fname | the file name to read | |
nx,ny | storage space for the image size | |
dtype | the desired output type : DT_U8 or DT_F32 |
Definition at line 96 of file io_tiff.cpp.
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.
fname | the file name to read | |
nx,ny | storage space for the image size |
Definition at line 198 of file io_tiff.cpp.
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.
fname | the file name to read | |
nx,ny | storage space for the image size |
Definition at line 39 of file io_tiff.cpp.
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.
fname | the file name to read | |
nx,ny | storage space for the image size |
Definition at line 214 of file io_tiff.cpp.
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].
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 |
Definition at line 306 of file io_tiff.cpp.
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
fname | TIFF file name | |
data | input array of float values supposed in [0,255] | |
nx | ny array size |
Definition at line 388 of file io_tiff.cpp.
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
Definition at line 228 of file io_tiff.cpp.
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
fname | TIFF file name | |
data | input array of 8bit values | |
nx | ny array size |
Definition at line 403 of file io_tiff.cpp.