/* * * File: p24to8.h * Project: libpict 1.1 * Date: Fri, May 19, 1995 * (c) SPDsoft 1992-95 * */ #ifndef P24TO8_H #define P24TO8_H #include #include #include #include "pict.h" typedef U_char byte; typedef struct COLOR_RECT { long first,last; long hist_sum; byte r_min,r_max, g_min,g_max, b_min,b_max; byte widest; short width; float r,g,b; struct COLOR_RECT *next; } COLOR_RECT; #define RED(x) (((x) & r_mask) >> 2*n_bits_left) #define GREEN(x) (((x) & g_mask) >> n_bits_left) #define BLUE(x) (((x) & b_mask) ) #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b)) #if defined(__STDC__) || defined(THINK_C) void init_all(int); void calc_hist(Pict, int *); void test_hist(int *); int num_diff_colors(int *); void select_colors(int *); void build_table_1(int *); COLOR_RECT *new_rect(); void init_list(COLOR_RECT *,int *,int *), head(COLOR_RECT **,COLOR_RECT **), insert(COLOR_RECT **,COLOR_RECT *), append(COLOR_RECT **,COLOR_RECT *); void split_rect(COLOR_RECT *,COLOR_RECT **,COLOR_RECT **); int comp_r(const void *,const void *), comp_g(const void *,const void *), comp_b(const void *,const void *); void sort_list(int *,long,long,byte); int find_half(int *,int *,long,long,byte,long,long *); void find_min_max(COLOR_RECT *); void average_color(COLOR_RECT *,int *,int *); void build_table_2(); Pict save_8bits(Pict); void mem_out(); #else /* __STDC__ || THINK_C */ void init_all(); void calc_hist(); void test_hist(); int num_diff_colors(); void select_colors(); void build_table_1(); COLOR_RECT *new_rect(); void init_list(), head(), insert(), append(); void split_rect(); int comp_r(), comp_g(), comp_b(); void sort_list(); int find_half(); void find_min_max(); void average_color(); void build_table_2(); Pict save_8bits(); void mem_out(); #endif /* __STDC__ || THINK_C */ #endif /* P24TO8_H */