Panda3D
panda
src
pnmimage
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
;
13
struct
colorhist_item
14
{
15
pixel
color;
16
int
value;
17
};
18
19
typedef
struct
colorhist_list_item
*
colorhist_list
;
20
struct
colorhist_list_item
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
36
typedef
colorhist_list
*
colorhash_table
;
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
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pnmimage_base.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pixel
Definition:
pnmimage_base.h:41
colorhist_item
Definition:
ppmcmap.h:13
colorhist_list_item
Definition:
ppmcmap.h:20
Generated on Sat Jan 11 2020 15:15:31 for Panda3D by
1.8.17