Home | History | Annotate | Download | only in jpeg

Lines Matching refs:colormap

57  * This allowed the color conversion math to be done only once per colormap
61 * externally-supplied colormap. We have therefore abandoned that approach.
127 #define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */
196 /* Space for the eventually created colormap is stashed here */
197 JSAMPARRAY sv_colormap; /* colormap allocated at init time */
198 int desired; /* desired # of colors = size of colormap */
252 * Next we have the really interesting routines: selection of a colormap
500 /* Compute representative color for a box, put it in colormap[icolor] */
532 cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
533 cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
534 cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
561 /* Compute the representative color for each box, fill colormap */
571 * colors to the nearest color in the selected colormap.
575 * histogram cell will be mapped to the same colormap entry, namely the one
580 * nearest color for a cell, its colormap index plus one is recorded in the
588 * the distances from a given colormap entry to each cell of the histogram can
592 * distance from every colormap entry to every histogram cell. Unfortunately,
594 * cell (because the inner loop has to be over cells, not colormap entries).
605 * eliminate colormap entries that are far away from the subbox; typically
606 * three-fourths of the colormap entries are rejected by Heckbert's criterion,
610 * can't eliminate as many colormap entries. Empirically the best subbox
638 * The next three routines implement inverse colormap filling. They could
648 /* Locate the colormap entries close enough to an update box to be candidates
651 * candidate colormap entries is returned, and their colormap indexes are
662 INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
677 /* For each color in colormap, find:
689 x = GETJSAMPLE(cinfo->colormap[0][i]);
712 x = GETJSAMPLE(cinfo->colormap[1][i]);
734 x = GETJSAMPLE(cinfo->colormap[2][i]);
762 * away from some colormap entry. Therefore, only colors that are
777 /* Find the closest colormap entry for each cell in the update box,
781 * find the distance from a colormap entry to successive cells in the box.
814 inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
816 inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
818 inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
856 /* Fill the inverse-colormap entries in the update box that contains */
866 /* This array lists the candidate colormap indexes. */
869 /* This array holds the actually closest colormap index for each cell. */
885 /* Determine which colormap entries are close enough to be candidates
937 /* If we have not seen this color before, find nearest colormap entry */
941 /* Now emit the colormap index for this cell */
969 JSAMPROW colormap0 = cinfo->colormap[0];
970 JSAMPROW colormap1 = cinfo->colormap[1];
971 JSAMPROW colormap2 = cinfo->colormap[2];
1028 /* If we have not seen this color before, find nearest colormap */
1032 /* Now emit the colormap index for this cell */
1147 /* Select the representative colors and fill in cinfo->colormap */
1148 cinfo->colormap = cquantize->sv_colormap;
1226 * Switch to a new external colormap between output passes.
1262 /* Allocate the histogram/inverse colormap storage */
1272 /* Allocate storage for the completed colormap, if required.
1282 /* Make sure colormap indexes can be represented by JSAMPLEs */