Panda3D
ppmcmap.h
1 /* ppmcmap.h - header file for colormap routines in libppm
2 */
3 
4 /* Color histogram stuff. */
5 
6 #ifndef PPMCMAP_H
7 #define PPMCMAP_H
8 
9 #include "pandabase.h"
10 #include "pnmimage_base.h"
11 
12 typedef struct colorhist_item* colorhist_vector;
14  {
15  pixel color;
16  int value;
17  };
18 
19 typedef struct colorhist_list_item* colorhist_list;
21  {
22  struct colorhist_item ch;
23  colorhist_list next;
24  };
25 
26 EXPCL_PANDA_PNMIMAGE colorhist_vector ppm_computecolorhist( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP );
27 /* Returns a colorhist *colorsP long (with space allocated for maxcolors. */
28 
29 EXPCL_PANDA_PNMIMAGE void ppm_addtocolorhist ( colorhist_vector chv, int* colorsP, int maxcolors, pixel* colorP, int value, int position );
30 
31 EXPCL_PANDA_PNMIMAGE void ppm_freecolorhist( colorhist_vector chv );
32 
33 
34 /* Color hash table stuff. */
35 
37 
38 EXPCL_PANDA_PNMIMAGE colorhash_table ppm_computecolorhash ( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP );
39 
40 EXPCL_PANDA_PNMIMAGE int
41 ppm_lookupcolor( colorhash_table cht, pixel* colorP );
42 
43 EXPCL_PANDA_PNMIMAGE colorhist_vector ppm_colorhashtocolorhist ( colorhash_table cht, int maxcolors );
44 EXPCL_PANDA_PNMIMAGE colorhash_table ppm_colorhisttocolorhash( colorhist_vector chv, int colors );
45 
46 EXPCL_PANDA_PNMIMAGE int ppm_addtocolorhash ( colorhash_table cht, pixel* colorP, int value );
47 /* Returns -1 on failure. */
48 
49 EXPCL_PANDA_PNMIMAGE colorhash_table ppm_alloccolorhash ( void );
50 
51 EXPCL_PANDA_PNMIMAGE void ppm_freecolorhash( colorhash_table cht );
52 
53 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.