Go to the source code of this file.
Defines | |
#define | IO_PNG_VERSION 0.20100727 |
Functions | |
unsigned char * | read_png_u8 (const char *fname, size_t *nx, size_t *ny, size_t *nc) |
read a PNG file into a 8bit integer array | |
unsigned char * | read_png_u8_rgb (const char *fname, size_t *nx, size_t *ny) |
read a PNG file into a 8bit integer array, converted to RGB | |
unsigned char * | read_png_u8_gray (const char *fname, size_t *nx, size_t *ny) |
read a PNG file into a 8bit integer array, converted to gray | |
float * | read_png_f32 (const char *fname, size_t *nx, size_t *ny, size_t *nc) |
read a PNG file into a 32bit float array | |
float * | read_png_f32_rgb (const char *fname, size_t *nx, size_t *ny) |
read a PNG file into a 32bit float array, converted to RGB | |
float * | read_png_f32_gray (const char *fname, size_t *nx, size_t *ny) |
read a PNG file into a 32bit float array, converted to gray | |
int | write_png_u8 (const char *fname, const unsigned char *data, size_t nx, size_t ny, size_t nc) |
write a 8bit unsigned integer array into a PNG file | |
int | write_png_f32 (const char *fname, const float *data, size_t nx, size_t ny, size_t nc) |
write a float array into a PNG file |
float* read_png_f32 | ( | const char * | fname, | |
size_t * | nx, | |||
size_t * | ny, | |||
size_t * | nc | |||
) |
read a PNG file into a 32bit float array
The array contains the deinterlaced channels. 1, 2, 4 and 8bit images are converted to float values between 0. and 1., 3., 15. or 255. 16bit images are also downscaled to 8bit before conversion.
fname | PNG file name | |
nx,ny,nc | pointers to variables to be filled with the number of columns, lines and channels of the image |
Definition at line 379 of file io_png.c.
float* read_png_f32_gray | ( | const char * | fname, | |
size_t * | nx, | |||
size_t * | ny | |||
) |
read a PNG file into a 32bit float array, converted to gray
See read_png_f32() for details.
Definition at line 432 of file io_png.c.
float* read_png_f32_rgb | ( | const char * | fname, | |
size_t * | nx, | |||
size_t * | ny | |||
) |
read a PNG file into a 32bit float array, converted to RGB
See read_png_f32() for details.
Definition at line 391 of file io_png.c.
unsigned char* read_png_u8 | ( | const char * | fname, | |
size_t * | nx, | |||
size_t * | ny, | |||
size_t * | nc | |||
) |
read a PNG file into a 8bit integer array
The array contains the deinterlaced channels. 1, 2 and 4bit images are converted to 8bit. 16bit images are previously downscaled to 8bit.
fname | PNG file name | |
nx,ny,nc | pointers to variables to be filled with the number of columns, lines and channels of the image |
Definition at line 269 of file io_png.c.
unsigned char* read_png_u8_gray | ( | const char * | fname, | |
size_t * | nx, | |||
size_t * | ny | |||
) |
read a PNG file into a 8bit integer array, converted to gray
See read_png_u8() for details.
Definition at line 324 of file io_png.c.
unsigned char* read_png_u8_rgb | ( | const char * | fname, | |
size_t * | nx, | |||
size_t * | ny | |||
) |
read a PNG file into a 8bit integer array, converted to RGB
See read_png_u8() for details.
Definition at line 282 of file io_png.c.
int write_png_f32 | ( | const char * | fname, | |
const float * | data, | |||
size_t | nx, | |||
size_t | ny, | |||
size_t | nc | |||
) |
write a float array into a PNG file
The float values are rounded to 8bit integers, and bounded to [0, 255].
fname | PNG file name | |
data | array to write | |
nx,ny,nc | number of columns, lines and channels of the image |
Definition at line 700 of file io_png.c.
int write_png_u8 | ( | const char * | fname, | |
const unsigned char * | data, | |||
size_t | nx, | |||
size_t | ny, | |||
size_t | nc | |||
) |
write a 8bit unsigned integer array into a PNG file
fname | PNG file name | |
data | array to write | |
nx,ny,nc | number of columns, lines and channels of the image |
Definition at line 680 of file io_png.c.