00001 /* 00002 * This software is copyrighted as noted below. It may be freely copied, 00003 * modified, and redistributed, provided that the copyright notice is 00004 * preserved on all copies. 00005 * 00006 * There is no warranty or other guarantee of fitness for this software, 00007 * it is provided solely "as is". Bug reports or fixes may be sent 00008 * to the author, who may or may not act on them as he desires. 00009 * 00010 * You may not include this software in a program or other software product 00011 * without supplying the source, or without informing the end-user that the 00012 * source is available for no extra charge. 00013 * 00014 * If you modify this software, you should include a notice giving the 00015 * name of the person performing the modification, the date of modification, 00016 * and the reason for such modification. 00017 */ 00018 00019 /** @addtogroup utahrle */ 00020 /*@{*/ 00021 /** @file colorquant.h 00022 * 00023 * colorquant.h - Definitions for colorquant. 00024 * 00025 * @author Spencer W. Thomas 00026 * EECS Dept. 00027 * University of Michigan 00028 * 00029 * Date: Thu Jan 3 1991 00030 * Copyright (c) 1991, University of Michigan 00031 */ 00032 00033 00034 /* Define values for the accum_hist argument: 00035 * 00036 * If non-zero the histogram will accumulate and reflect pixels from 00037 * multiple images. When 1, the histogram will be initialized and 00038 * summed, but not thrown away OR processed. When 2, the image RGB will 00039 * be added to it. When 3, Boxes are cut and a colormap and rgbmap are 00040 * be returned, Histogram is freed too. When zero, all code is 00041 * executed as per normal. 00042 */ 00043 #define INIT_HIST 1 00044 #define USE_HIST 2 00045 #define PROCESS_HIST 3 00046 00047 /* 00048 * Flag bits. 00049 * 00050 * CQ_FAST: If set, the rgbmap will be constructed quickly. If 00051 * not set, the rgbmap will be built much slower, but 00052 * more accurately. In most cases, CQ_FAST should be 00053 * set, as the error introduced by the approximation is 00054 * usually small. 00055 * CQ_QUANTIZE: If set, the data in red, green, and blue is not 00056 * pre-quantized, and will be quantized "on the fly". 00057 * This slows the routine slightly. If not set, the data 00058 * has been prequantized to 'bits' significant bits. 00059 * CQ_NO_RGBMAP:If set, rgbmap will not be built. 00060 * 00061 */ 00062 #define CQ_FAST 1 00063 #define CQ_QUANTIZE 2 00064 #define CQ_NO_RGBMAP 4 00065 00066 /* Declare the function. */ 00067 #ifdef USE_PROTOTYPES 00068 extern int colorquant( unsigned char *red, 00069 unsigned char *green, 00070 unsigned char *blue, 00071 unsigned long pixels, 00072 unsigned char *colormap[3], 00073 int colors, 00074 int bits, 00075 unsigned char *rgbmap, 00076 int flags, 00077 int accum_hist ); 00078 #else 00079 extern int colorquant(); 00080 #endif 00081 00082 /*@}*/