From 74f5b2bd2c1d052104b6da996e2ace4cab4bf74c Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 16 Sep 2006 18:53:46 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@58 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/pnmtopalm/gen_palm_colormap.c | 33 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'converter') diff --git a/converter/other/pnmtopalm/gen_palm_colormap.c b/converter/other/pnmtopalm/gen_palm_colormap.c index 4b65e631..b71854b2 100644 --- a/converter/other/pnmtopalm/gen_palm_colormap.c +++ b/converter/other/pnmtopalm/gen_palm_colormap.c @@ -7,18 +7,25 @@ #include "palm.h" -int main( int argc, char **argv ) { - - int i; - Color_s current; - Colormap default_map = palmcolor_build_default_8bit_colormap (); - - printf("P3\n%d 1\n255\n", default_map->ncolors); - for (i = 0; i < default_map->ncolors; i++) { - current = default_map->color_entries[i]; - printf ("%d %d %d\n", (current & 0xFF0000) >> 16, (current & 0xFF00) >> 8, (current & 0xFF)); - /* printf ("%x: %d %d %d\n", (current & 0xFF000000) >> 24, (current & 0xFF0000) >> 16, (current & 0xFF00) >> 8, (current & 0xFF)); */ - }; - return 0; +int +main(int argc, + char ** argv) { + + Colormap const defaultMap = palmcolor_build_default_8bit_colormap(); + + unsigned int i; + + printf("P3\n%d 1\n255\n", defaultMap->ncolors); + + for (i = 0; i < defaultMap->ncolors; ++i) { + Color_s const current = defaultMap->color_entries[i]; + + printf("%u %u %u\n", + (unsigned char)(current >> 16), + (unsigned char)(current >> 8), + (unsigned char)(current >> 0)); + } + + return 0; } -- cgit 1.4.1