#include "pgm.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Functions | |
static int | remove_line (FILE *f) |
Reremove all characters to the next new-line. | |
static int | remove_blanks (FILE *f) |
Reremove white-spaces and comments. | |
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. | |
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. |
static int remove_blanks | ( | FILE * | f | ) | [static] |
For internal use only.
f | file to strip. |
static int remove_line | ( | FILE * | f | ) | [static] |
For internal use only.
f | file to strip. |
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. |