I've implemented a simple configurable mode to control how many colors the 
Render extension allocates on dynamic indexed visuals (pseudo/gray).

Here's the comment I wrote in the code:

/*
 * For dynamic indexed visuals (GrayScale and PseudoColor), these control the
 * selection of colors allocated for drawing to Pictures.  The default
 * policy depends on the size of the colormap:
 *
 * Size         Default Policy
 * ----------------------------
 *  < 64        PolicyMono
 *  < 256       PolicyGray
 *  256         PolicyColor (only on PseudoColor)
 *
 * The actual allocation code lives in miindex.c, and so is
 * austensibly server dependent, but that code does:
 *
 * PolicyMono       Allocate no additional colors, use black and white
 * PolicyGray       Allocate 13 gray levels (11 cells used)
 * PolicyColor      Allocate a 4x4x4 cube and 13 gray levels (71 cells used)
 *
 * Here's a picture to help understand how many colors are
 * actually allocated (this is just the gray ramp):
 *
 *                 gray level
 * all   0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff
 * b/w   0000                                                        ffff
 * 4x4x4                     5555                aaaa
 * extra      1555 2aaa 4000      6aaa 8000 9555      bfff d555 eaaa
 *
 * The default colormap supplies two gray levels (black/white), the
 * 4x4x4 cube allocates another two and nine more are allocated to fill
 * in the 13 levels.  When the 4x4x4 cube is not allocated, a total of
 * 11 cells are allocated.
 */   

This policy is controlled by either a command line option (-render) or an
XF86Config parameter that lives in the ServerFlags section:

        Section "ServerFlags"
                Option          "RenderColormapMode"    "gray"
        EndSection

The set of modes is the same in both cases 'default', 'mono', 'gray' and 
'color'.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab


_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to