00001
00006
00007
00008
00009
00010
00011
00012
00013 #include "generic.h"
00014 #include <stdio.h>
00015
00016 #ifndef VL_PGM
00017 #define VL_PGM
00018
00021 #define VL_ERR_PGM_INV_HEAD 101
00022 #define VL_ERR_PGM_INV_META 102
00023 #define VL_ERR_PGM_INV_DATA 103
00024 #define VL_ERR_PGM_IO 104
00026
00027
00034 struct _VlPgmImage
00035 {
00036 int width ;
00037 int height ;
00038 int max_value ;
00039 vl_bool is_raw ;
00040 };
00041
00045 typedef struct _VlPgmImage VlPgmImage ;
00046
00049 VL_EXPORT int vl_pgm_extract_head (FILE *f, VlPgmImage *im) ;
00050 VL_EXPORT int vl_pgm_extract_data (FILE *f, VlPgmImage const *im, void *data) ;
00051 VL_EXPORT int vl_pgm_insert (FILE *f,
00052 VlPgmImage const *im,
00053 void const*data ) ;
00054 VL_EXPORT int vl_pgm_get_npixels (VlPgmImage const *im) ;
00055 VL_EXPORT int vl_pgm_get_bpp (VlPgmImage const *im) ;
00060 VL_EXPORT int vl_pgm_write (char const *name,
00061 vl_uint8 const *data,
00062 int width, int height) ;
00063 VL_EXPORT int vl_pgm_write_f (char const *name,
00064 float const *data,
00065 int width, int height) ;
00066 VL_EXPORT int vl_pgm_read_new (char const *name,
00067 VlPgmImage *im,
00068 vl_uint8 **data) ;
00069 VL_EXPORT int vl_pgm_read_new_f (char const *name,
00070 VlPgmImage *im,
00071 float **data) ;
00072
00074
00075 #endif