Lines Matching defs:ramp

310 	   the server recognizes a gray ramp with red_max=1, red_mult=1,
311 base_pixel=0 to mean a 2 gray ramp with BlackPixel being
470 XStandardColormap **ramp,
481 gotRamp = XGetRGBColormaps(dpy, RootWindow(dpy, vinfo->screen), ramp,
486 c = *ramp;
541 /* We'll need the color cube information to compute the gray ramp,
627 were SOL and have to use a two-element ramp. */
645 static void UseGrayDiagonal(XStandardColormap *cube, XStandardColormap *ramp)
647 ramp->red_max = cube->red_max;
648 ramp->red_mult = cube->red_mult + cube->green_mult + cube->blue_mult;
649 ramp->base_pixel = cube->base_pixel;
652 static void UseGrayCorners(XStandardColormap *cube, XStandardColormap *ramp)
654 ramp->red_max = 1;
655 ramp->red_mult = (cube->red_max + 1) * (cube->green_max + 1) *
657 if (* (int *) &(cube->red_mult) < 0) ramp->red_mult *= -1;
658 ramp->base_pixel = cube->base_pixel;
675 Resource definitions for default color cube / gray ramp sizes
683 If we have a choice, we try to allocate a gray ramp with an odd number
692 PseudoColor depth 4 we try for a 2x2x2 cube with the gray ramp on
694 gray ramp. Depth 12 uses a 6x6x5 "cube" with a separate 17 entry gray
695 ramp. The cube is non-symmetrical; we don't want to use the diagonal
696 for a gray ramp and we can get by with fewer blues than reds or greens.
698 For DirectColor, allocating a gray ramp separate from the color cube
700 share the diagonal entries for the gray ramp.
859 XColor *ramp, *black, *white, *altBlack, *altWhite;
863 ramp = (XColor *) calloc(entries, sizeof(XColor));
865 if (ramp == NULL) {
871 for (i = 0; i < entries; i++) ramp[i].pixel = i;
872 XQueryColors(dpy, colorCube->colormap, ramp, entries);
878 if (ramp[i].flags != (DoRed | DoBlue | DoGreen)) continue;
879 if (ramp[i].red == 0 && ramp[i].blue == 0 &&
880 ramp[i].green == 0) {
881 if (black == NULL) black = ramp+i;
882 else if (altBlack == NULL) altBlack = ramp+i;
883 } else if (ramp[i].red == SCALE && ramp[i].blue == SCALE &&
884 ramp[i].green == SCALE) {
885 if (white == NULL) white = ramp+i;
886 else if (altWhite == NULL) altWhite = ramp+i;
892 free(ramp);
904 free(ramp);
1077 a gray ramp. This handles there being 2 white or black entries
1078 in the colormap and finds the longest linear ramp between pairs of
1088 XColor *ramp, *black, *white, *altBlack, *altWhite;
1093 ramp = (XColor *) calloc(entries, sizeof(XColor));
1095 if (ramp == NULL) {
1101 for (i = 0; i < entries; i++) ramp[i].pixel = i;
1102 XQueryColors(dpy, grayRamp->colormap, ramp, entries);
1108 if (ramp[i].flags != (DoRed | DoBlue | DoGreen)) continue;
1109 if (CheckColor(ramp+i, 0, 0, 0)) {
1110 if (black == NULL) black = ramp+i;
1111 else if (altBlack == NULL) altBlack = ramp+i;
1112 } else if (CheckColor(ramp+i, 1, 1, 1)) {
1113 if (white == NULL) white = ramp+i;
1114 else if (altWhite == NULL) altWhite = ramp+i;
1120 free(ramp);
1124 /* Find out how large a ramp exists between pairs of black & white */
1148 free(ramp);
1161 /* See if we have a backwards ramp */
1307 /* First of all see if there's a usable gray ramp in the color cube */
1401 /* If it's a gray ramp or direct color we need at least 2;
1426 /* We must be in the gray ramp case, so we need at least 2 entries */