Home | History | Annotate | Download | only in libjpeg-turbo

Lines Matching refs:colormap

59  * This allowed the color conversion math to be done only once per colormap
63 * externally-supplied colormap. We have therefore abandoned that approach.
108 #define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */
174 /* Space for the eventually created colormap is stashed here */
175 JSAMPARRAY sv_colormap; /* colormap allocated at init time */
176 int desired; /* desired # of colors = size of colormap */
230 * Next we have the really interesting routines: selection of a colormap
479 /* Compute representative color for a box, put it in colormap[icolor] */
511 cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
512 cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
513 cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
540 /* Compute the representative color for each box, fill colormap */
550 * colors to the nearest color in the selected colormap.
554 * histogram cell will be mapped to the same colormap entry, namely the one
559 * nearest color for a cell, its colormap index plus one is recorded in the
567 * the distances from a given colormap entry to each cell of the histogram can
571 * distance from every colormap entry to every histogram cell. Unfortunately,
573 * cell (because the inner loop has to be over cells, not colormap entries).
584 * eliminate colormap entries that are far away from the subbox; typically
585 * three-fourths of the colormap entries are rejected by Heckbert's criterion,
589 * can't eliminate as many colormap entries. Empirically the best subbox
617 * The next three routines implement inverse colormap filling. They could
627 /* Locate the colormap entries close enough to an update box to be candidates
630 * candidate colormap entries is returned, and their colormap indexes are
641 INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
656 /* For each color in colormap, find:
668 x = GETJSAMPLE(cinfo->colormap[0][i]);
691 x = GETJSAMPLE(cinfo->colormap[1][i]);
713 x = GETJSAMPLE(cinfo->colormap[2][i]);
741 * away from some colormap entry. Therefore, only colors that are
756 /* Find the closest colormap entry for each cell in the update box,
760 * find the distance from a colormap entry to successive cells in the box.
793 inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;
795 inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;
797 inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;
835 /* Fill the inverse-colormap entries in the update box that contains */
845 /* This array lists the candidate colormap indexes. */
848 /* This array holds the actually closest colormap index for each cell. */
864 /* Determine which colormap entries are close enough to be candidates
916 /* If we have not seen this color before, find nearest colormap entry */
920 /* Now emit the colormap index for this cell */
948 JSAMPROW colormap0 = cinfo->colormap[0];
949 JSAMPROW colormap1 = cinfo->colormap[1];
950 JSAMPROW colormap2 = cinfo->colormap[2];
1007 /* If we have not seen this color before, find nearest colormap */
1011 /* Now emit the colormap index for this cell */
1117 /* Select the representative colors and fill in cinfo->colormap */
1118 cinfo->colormap = cquantize->sv_colormap;
1196 * Switch to a new external colormap between output passes.
1232 /* Allocate the histogram/inverse colormap storage */
1242 /* Allocate storage for the completed colormap, if required.
1252 /* Make sure colormap indexes can be represented by JSAMPLEs */