Lines Matching refs:ncolors
65 int i, ncolors, r, g, b; in allocatePseudoColor() local
69 ncolors = cpc * cpc * cpc; in allocatePseudoColor()
71 if (ncolors > (1 << ctx->depth)) { in allocatePseudoColor()
75 ncolors = cpc * cpc * cpc; in allocatePseudoColor()
77 assert(cpc >= 2 && ncolors <= (1 << ctx->depth)); in allocatePseudoColor()
79 colors = malloc(sizeof(XColor) * ncolors); in allocatePseudoColor()
135 for (i = 0; i < ncolors; i++) { in allocatePseudoColor()
150 for (i = 0; i < ncolors; i++) { in allocatePseudoColor()
193 int i, ncolors, r, g, b; in allocateGrayScale() local
197 ncolors = cpc * cpc * cpc; in allocateGrayScale()
201 ncolors = 1 << ctx->depth; in allocateGrayScale()
203 if (ncolors > (1 << ctx->depth)) { in allocateGrayScale()
207 ncolors = cpc * cpc * cpc; in allocateGrayScale()
209 assert(cpc >= 2 && ncolors <= (1 << ctx->depth)); in allocateGrayScale()
212 if (ncolors >= 256 && ctx->vclass == StaticGray) { in allocateGrayScale()
216 colors = malloc(sizeof(XColor) * ncolors); in allocateGrayScale()
221 for (i = 0; i < ncolors; i++) { in allocateGrayScale()
222 colors[i].red = (i * 0xffff) / (ncolors - 1); in allocateGrayScale()
223 colors[i].green = (i * 0xffff) / (ncolors - 1); in allocateGrayScale()
224 colors[i].blue = (i * 0xffff) / (ncolors - 1); in allocateGrayScale()
228 for (i = 0; i < ncolors; i++) { in allocateGrayScale()
255 for (i = 0; i < ncolors; i++) { in allocateGrayScale()