home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 309.lha / PBM_PLUS / ppm / ppmcmap.h < prev    next >
C/C++ Source or Header  |  1980-12-04  |  1KB  |  45 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( /* 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( /* colorhist_vector chv, int *colorsP, int maxcolors, pixel color, int value, int position */ );
  24.  
  25. void ppm_freecolorhist( /* colorhist_vector chv */ );
  26.  
  27.  
  28. /* Color hash table stuff. */
  29.  
  30. typedef colorhist_list *colorhash_table;
  31.  
  32. colorhash_table ppm_computecolorhash( /* pixel **pixels, int cols, int rows, int maxcolors, int *colorsP */ );
  33.  
  34. int
  35. ppm_lookupcolor( /* colorhash_table cht, pixel color */ );
  36.  
  37. colorhist_vector ppm_colorhashtocolorhist( /* colorhash_table cht, int maxcolors */ );
  38. colorhash_table ppm_colorhisttocolorhash( /* colorhist_vector chv, int colors */ );
  39.  
  40. void ppm_addtocolorhash( /* colorhash_table cht, pixel color, int value */ );
  41.  
  42. colorhash_table ppm_alloccolorhash( /* */ );
  43.  
  44. void ppm_freecolorhash( /* colorhash_table cht */ );
  45.