Lines Matching defs:histogram
35 * In the first pass over the image, we accumulate a histogram showing the
36 * usage count of each possible color. To keep the histogram to a reasonable
39 * in the same histogram cell.
82 * you'll probably want to tweak the histogram sizes too.
103 * First we have the histogram data structure and routines for creating it.
110 * To maintain a fully accurate histogram, we'd need to allocate a "long"
114 * enough results. This reduces the recommended histogram size from 256Kb
116 * (In the second pass the histogram space is re-used for pixel mapping data;
120 * machines, we can't just allocate the histogram in one chunk. Instead
133 #define HIST_C0_BITS 5 /* bits of precision in R/B histogram */
134 #define HIST_C1_BITS 6 /* bits of precision in G histogram */
135 #define HIST_C2_BITS 5 /* bits of precision in B/R histogram */
137 /* Number of elements along histogram axes. */
142 /* These are the amounts to shift an input value to get a histogram index. */
148 typedef UINT16 histcell; /* histogram cell; prefer an unsigned type */
150 typedef histcell FAR * histptr; /* for pointers to histogram cells */
202 hist3d histogram; /* pointer to the histogram */
204 boolean needs_zeroed; /* TRUE if next pass must zero histogram */
217 * In this module the prescan simply updates the histogram, which has been
231 register hist3d histogram = cquantize->histogram;
239 /* get pixel value and index into the histogram */
240 histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
254 * given the completed histogram.
256 * subset of the input color space (to histogram precision).
260 /* The bounds of the box (inclusive); expressed as histogram indexes */
266 /* The number of nonzero histogram cells within this box */
319 hist3d histogram = cquantize->histogram;
333 histp = & histogram[c0][c1][c2min];
344 histp = & histogram[c0][c1][c2min];
355 histp = & histogram[c0][c1][c2min];
366 histp = & histogram[c0][c1][c2min];
377 histp = & histogram[c0][c1min][c2];
388 histp = & histogram[c0][c1min][c2];
401 * Since the differences are expressed in histogram-cell units,
414 histp = & histogram[c0][c1][c2min];
506 hist3d histogram = cquantize->histogram;
522 histp = & histogram[c0][c1][c2min];
574 * We re-use the histogram space as an "inverse color map", essentially a
576 * histogram cell will be mapped to the same colormap entry, namely the one
589 * the distances from a given colormap entry to each cell of the histogram can
593 * distance from every colormap entry to every histogram cell. Unfortunately,
594 * it needs a work array to hold the best-distance-so-far for each histogram
600 * nearest colors for only the cells within a small subbox of the histogram.
612 * size seems to be about 1/512th of the histogram (1/8th in each direction).
618 * with plenty of memory, filling the whole histogram in one shot with Thomas'
624 /* log2(histogram cells in update box) for each axis; this can be adjusted */
667 * histogram cell, which are the upper bounds of the volume we care about.
858 /* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */
862 hist3d histogram = cquantize->histogram;
880 * histogram cell, which are the lower bounds of the volume we care about.
902 cachep = & histogram[c0+ic0][c1+ic1][c2];
921 hist3d histogram = cquantize->histogram;
937 cachep = & histogram[c0][c1][c2];
955 hist3d histogram = cquantize->histogram;
1028 cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];
1171 hist3d histogram = cquantize->histogram;
1183 cquantize->needs_zeroed = TRUE; /* Always zero histogram */
1215 /* Zero the histogram or inverse color map, if necessary */
1218 FMEMZERO((void FAR *) histogram[i],
1263 /* Allocate the histogram/inverse colormap storage */
1264 cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)
1267 cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)
1271 cquantize->needs_zeroed = TRUE; /* histogram is garbage now */