diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2024-04-01 17:20:01 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2024-04-01 17:20:01 +0000 |
commit | 182cb1b68e40b2e1d900b3ccd7a5ee7de818a9f4 (patch) | |
tree | 59054a5f723fdc5577d0877b15fbf7deec72b2fb /lib/ppm.h | |
parent | 507fe8daac1361fe28e62aab07624b1d86bb14ed (diff) | |
download | netpbm-mirror-182cb1b68e40b2e1d900b3ccd7a5ee7de818a9f4.tar.gz netpbm-mirror-182cb1b68e40b2e1d900b3ccd7a5ee7de818a9f4.tar.xz netpbm-mirror-182cb1b68e40b2e1d900b3ccd7a5ee7de818a9f4.zip |
Allow color dictionary with more than 1000 colors; Add Resene paint colors to distributed color dictionary
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4901 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/ppm.h')
-rw-r--r-- | lib/ppm.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/ppm.h b/lib/ppm.h index acc70c85..9fa547fe 100644 --- a/lib/ppm.h +++ b/lib/ppm.h @@ -161,6 +161,36 @@ ppm_colorname(const pixel* const colorP, pixval const maxval, int const hexok); +typedef struct { + unsigned int version; + const char ** name; + /* malloced, and each entry malloced. Has space for at least 'size' + entries. May be null if size == 0 + */ + pixel * color; /* malloced */ + /* malloced. Has space for at least 'size' entries. May be null if + size == 0 + */ + unsigned int size; + /* allocated size of 'name' and 'color'. At least 'count' */ + unsigned int count; + /* number of entries used.*/ + colorhash_table cht; + /* Hash table mapping name[] to color[] */ +} ppm_ColorDict; + +ppm_ColorDict * +ppm_colorDict_new(const char * const fileName, + int const mustOpen); + +void +ppm_colorDict_destroy(ppm_ColorDict * colorDictP); + +void +ppm_readcolordict2(const char * const fileName, + int const mustOpen, + ppm_ColorDict ** const colorDictP); + void ppm_readcolordict(const char * const fileName, int const mustOpen, |