Panda3D
Loading...
Searching...
No Matches
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
12typedef struct colorhist_item* colorhist_vector;
14 {
15 pixel color;
16 int value;
17 };
18
21 {
22 struct colorhist_item ch;
23 colorhist_list next;
24 };
25
26EXPCL_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
29EXPCL_PANDA_PNMIMAGE void ppm_addtocolorhist ( colorhist_vector chv, int* colorsP, int maxcolors, pixel* colorP, int value, int position );
30
31EXPCL_PANDA_PNMIMAGE void ppm_freecolorhist( colorhist_vector chv );
32
33
34/* Color hash table stuff. */
35
37
38EXPCL_PANDA_PNMIMAGE colorhash_table ppm_computecolorhash ( pixel** pixels, int cols, int rows, int maxcolors, int* colorsP );
39
40EXPCL_PANDA_PNMIMAGE int
41ppm_lookupcolor( colorhash_table cht, pixel* colorP );
42
43EXPCL_PANDA_PNMIMAGE colorhist_vector ppm_colorhashtocolorhist ( colorhash_table cht, int maxcolors );
44EXPCL_PANDA_PNMIMAGE colorhash_table ppm_colorhisttocolorhash( colorhist_vector chv, int colors );
45
46EXPCL_PANDA_PNMIMAGE int ppm_addtocolorhash ( colorhash_table cht, pixel* colorP, int value );
47/* Returns -1 on failure. */
48
49EXPCL_PANDA_PNMIMAGE colorhash_table ppm_alloccolorhash ( void );
50
51EXPCL_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.