home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netpbma.zip / ppm / ppmcmap.h < prev    next >
C/C++ Source or Header  |  1993-10-04  |  1KB  |  46 lines

  1. /* ppmcmap.h - header file for colormap routines in libppm
  2. */
  3.  
  4. /* Color histogram stuff. */
  5.  
  6. typedef struct colorhist_item* colorhist_vector;
  7. struct colorhist_item
  8.     {
  9.     pixel color;
  10.     int value;
  11.     };
  12.  
  13. typedef struct colorhist_list_item* colorhist_list;
  14. struct colorhist_list_item
  15.     {
  16.     struct colorhist_item ch;
  17.     colorhist_list next;
  18.     };
  19.  
  20. colorhist_vector ppm_computecolorhist ARGS(( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP ));
  21. /* Returns a colorhist *colorsP long (with space allocated for maxcolors. */
  22.  
  23. void ppm_addtocolorhist ARGS(( colorhist_vector chv, int* colorsP, int maxcolors, pixel* colorP, int value, int position ));
  24.  
  25. void ppm_freecolorhist ARGS(( colorhist_vector chv ));
  26.  
  27.  
  28. /* Color hash table stuff. */
  29.  
  30. typedef colorhist_list* colorhash_table;
  31.  
  32. colorhash_table ppm_computecolorhash ARGS(( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP ));
  33.  
  34. int
  35. ppm_lookupcolor ARGS(( colorhash_table cht, pixel* colorP ));
  36.  
  37. colorhist_vector ppm_colorhashtocolorhist ARGS(( colorhash_table cht, int maxcolors ));
  38. colorhash_table ppm_colorhisttocolorhash ARGS(( colorhist_vector chv, int colors ));
  39.  
  40. int ppm_addtocolorhash ARGS(( colorhash_table cht, pixel* colorP, int value ));
  41. /* Returns -1 on failure. */
  42.  
  43. colorhash_table ppm_alloccolorhash ARGS(( void ));
  44.  
  45. void ppm_freecolorhash ARGS(( colorhash_table cht ));
  46.