#include "generic.h"
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
| struct | _VlPgmImage |
| PGM image meta data. More... | |
Defines | |
PGM parser error codes | |
| #define | VL_ERR_PGM_INV_HEAD 101 |
| #define | VL_ERR_PGM_INV_META 102 |
| #define | VL_ERR_PGM_INV_DATA 103 |
| #define | VL_ERR_PGM_IO 104 |
Typedefs | |
| typedef struct _VlPgmImage | VlPgmImage |
| PGM image meta data type. | |
Functions | |
| int | vl_pgm_extract_head (FILE *f, VlPgmImage *im) |
| Read PGM header. | |
| int | vl_pgm_extract_data (FILE *f, VlPgmImage const *im, void *data) |
| Read PGM data. | |
| int | vl_pgm_insert (FILE *f, VlPgmImage const *im, void *data) |
| Write a PGM image. | |
| int | vl_pgm_get_data_size (VlPgmImage const *im) |
| Get PGM image data size. | |
| int | vl_pgm_get_bpp (VlPgmImage const *im) |
| Get PGM image bytes per pixel. | |
To write a PGM image use vl_pgm_insert().
| #define VL_ERR_PGM_INV_DATA 103 |
Invalid PGM data section.
| #define VL_ERR_PGM_INV_HEAD 101 |
Invalid PGM heder serction.
| #define VL_ERR_PGM_INV_META 102 |
Invalid PGM meta section.
| #define VL_ERR_PGM_IO 104 |
Generic I/O error.
| typedef struct _VlPgmImage VlPgmImage |
| int vl_pgm_extract_data | ( | FILE * | f, | |
| VlPgmImage const * | im, | |||
| void * | data | |||
| ) |
| f | input file. | |
| im | PGM image descriptor. | |
| data | data buffer to fill. |
| int vl_pgm_extract_head | ( | FILE * | f, | |
| VlPgmImage * | im | |||
| ) |
----------------------------------------------------------------
| f | input file. | |
| im | image structure to fill. |
| int vl_pgm_get_bpp | ( | VlPgmImage const * | im | ) |
| im | PGM image descriptor. |
| int vl_pgm_get_data_size | ( | VlPgmImage const * | im | ) |
| im | PGM image descriptor. |
To calculate the image data size in bytes, this value must be multiplied by the number of byte per pixels (see vl_pgm_get_bpp()).
| int vl_pgm_insert | ( | FILE * | f, | |
| VlPgmImage const * | im, | |||
| void * | data | |||
| ) |
| f | output file. | |
| im | PGM image meta-data. | |
| data | image data. |
1.5.4