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