/* * quantize.h -- image quantizer header file * (C)Copyright 1998 by Hiroshi Takekawa * Last Modified: Fri Apr 9 06:53:04 1999. */ typedef struct _box { /* box coordinate */ int rmin, rmax; int gmin, gmax; int bmin, bmax; /* avarage values */ int r, g, b; /* the volume of the box */ int volume; /* how many pixels in the box */ int population; /* which egde to be splitted */ int longest; } box; /* color precision 0に近い値ほど良い、その分メモリをくう */ #define PRECISION_R 2 #define PRECISION_G 1 #define PRECISION_B 2 unsigned char *quantize(unsigned char *, unsigned char *, int, int, int); /* defineから自動的に定義される定数 */ #define R_INDEX (256 >> PRECISION_R) #define G_INDEX (256 >> PRECISION_G) #define B_INDEX (256 >> PRECISION_B)