Add phase/magnitude objective output types
[xiph/unicode.git] / w3d / pnm.h
blob8cea6bfea3fab56ce8593b6185ef258467b06c57
1 #ifndef __PPM_H
2 #define __PPM_H
4 #include "w3dtypes.h"
6 /**
7 * Returns number of color channels (1 == grayscale, 3 == rgb)
8 * or -1 on error.
9 */
10 extern int read_pnm_header (char *fname, int *w, int *h);
12 /**
13 * Read pnm into buf. Assumes you have called read_pnm_header()
14 * and allocated buf before.
16 extern int read_pnm (char *fname, uint8_t *buf);
18 /**
19 * Write buf into pnm file. Depending of the suffix of fname we
20 * assume 1 channel for '.png' and 3 channels for '.ppm'
22 extern void write_pnm (char *fname, uint8_t *buf, int w, int h);
24 /**
25 * Write a int16_t buf into pgm file
27 extern void write_pgm16 (char *fname, int16_t *buf, int w, int h, int16_t offset);
29 #endif