Lines Matching defs:stdmap
63 static int IsGray(Display *dpy, XStandardColormap *stdmap);
64 static void Do_StdGray(Display *dpy, XStandardColormap *stdmap, int ncolors,
66 static void Do_StdCol(Display *dpy, XStandardColormap *stdmap, int ncolors,
155 XStandardColormap *stdmaps, *stdmap = NULL;
444 stdmap = &stdmaps[0];
448 stdmap = &stdmaps[i];
452 if (stdmap->visualid != vinfo.visualid)
456 if (stdmap->visualid == vinfos[i].visualid) {
525 colormap = stdmap->colormap;
559 if (!stdmap->green_max && !stdmap->blue_max && IsGray(dpy, stdmap))
560 Do_StdGray(dpy, stdmap, ncolors, colors, in_image, out_image);
562 Do_StdCol(dpy, stdmap, ncolors, colors, in_image, out_image);
933 IsGray(Display *dpy, XStandardColormap *stdmap)
937 color.pixel = stdmap->base_pixel + (stdmap->red_max * stdmap->red_mult);
938 XQueryColor(dpy, stdmap->colormap, &color);
943 Do_StdGray(Display *dpy, XStandardColormap *stdmap,
950 lim = stdmap->red_max + 1;
952 color->pixel = stdmap->base_pixel +
956 * lim) >> 16) * stdmap->red_mult);
968 Do_StdCol(Display *dpy, XStandardColormap *stdmap,
975 limr = stdmap->red_max;
976 limg = stdmap->green_max;
977 limb = stdmap->blue_max;
979 color->pixel = stdmap->base_pixel +
980 MapVal(color->red, limr, stdmap->red_mult) +
981 MapVal(color->green, limg, stdmap->green_mult) +
982 MapVal(color->blue, limb, stdmap->blue_mult);