From 1511ebe5ed9943e31a66214b720544cdbf515eaa Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 25 Sep 2010 20:41:29 +0000 Subject: Get pamtopdbimg, pdbimgtopam working git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1302 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/ipdb.h | 68 +++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 26 deletions(-) (limited to 'converter/other/ipdb.h') diff --git a/converter/other/ipdb.h b/converter/other/ipdb.h index d00fde1a..6af5fc44 100644 --- a/converter/other/ipdb.h +++ b/converter/other/ipdb.h @@ -127,6 +127,7 @@ typedef struct { */ uint8_t * data; } IMAGE; + #define IMAGESIZE (32 + 1 + 1 + 4 + 4 + 2*2 + 4 + 2*2 + 2*2) /* @@ -136,6 +137,10 @@ typedef struct { #define IMG_GRAY ((uint8_t)0) #define IMG_MONO ((uint8_t)0xff) +const char * +ipdb_typeName(uint8_t const type); + + /* * Compression constants for IMAGE.version. */ @@ -159,6 +164,16 @@ typedef struct { TEXT * t; } IPDB; +/* + * Only use four bytes of these. + */ +#define IPDB_vIMG "vIMG" +#define IPDB_View "View" +/* + * Only use three bytes of this. + */ +#define IPDB_MYST "\x40\x6f\x80" + /* * Flags for ipdb_write(). */ @@ -185,43 +200,44 @@ typedef struct { const char * ipdb_err(int error); -int -ipdb_read(IPDB *, FILE *); - -int -ipdb_write(IPDB *, int, FILE *); +size_t +ipdb_img_size(IMAGE * const imgP); -int -ipdb_insert_g16image(IPDB *, int, int, const uint8_t *); +unsigned int +ipdb_img_ppb(IMAGE * const imgP); -int -ipdb_insert_gimage(IPDB *, int, int, const uint8_t*); +uint8_t * +ipdb_img_row(IMAGE * const imgP, + unsigned int const row); -int -ipdb_insert_mimage(IPDB *, int, int, const uint8_t *); +void +ipdb_free(IPDB *); -int -ipdb_insert_text(IPDB *, const char *); +IPDB * +ipdb_alloc(const char *); -int -ipdb_remove_image(IPDB *); +void +ipdb_clear(IPDB * const pdbP); -int -ipdb_remove_text(IPDB *); +PDBHEAD * +ipdb_pdbhead_alloc(const char * const name); -const uint8_t * -ipdb_g16row(IPDB *, unsigned int, uint8_t *); +void +ipdb_pdbhead_free(PDBHEAD * const headP); -const uint8_t * -ipdb_grow(IPDB *, unsigned int, uint8_t *); +IMAGE * +ipdb_image_alloc(const char * const name, + int const type, + int const w, + int const h); -const uint8_t * -ipdb_mrow(IPDB *, unsigned int, uint8_t *); +void +ipdb_image_free(IMAGE * const imgP); void -ipdb_free(IPDB *); +ipdb_text_free(TEXT * const textP); -IPDB * -ipdb_alloc(const char *); +TEXT * +ipdb_text_alloc(const char * const content); #endif -- cgit 1.4.1