On Sun, 21 Oct 2001, Jamie Zawinski wrote:

> The XFree interface only lets me specify a gamma value, not a curve.
> It generates a curve from that number in the traditional way, and the
> curve generated does not touch fully saturated colors.  So only colors
> at low-to-medium saturation levels are faded properly.
> 
> Furthermore, the XFree interface doesn't let me ramp all the way down
> to black: it signals an X error if you give it a gamma less than 0.1
> (or something like that.)  That means that it never fades all the way
> to black, and you see a slight jump at the very end.  
> 
> So, while it's nice that XFree finally gave us some control over gamma,
> they didn't give us enough control.  Because of that, xscreensaver's
> fading looks kinda hokey on XFree (while it works great on SGIs, and in
> 8-bit mode.)
> 
> So, please provide a gamma interface where I can specify the transfer
> map for each input value: something along the lines of, letting me give
> you an array of 255 values where I can map input intensity to output
> intensity.  (The SGI interface uses three such maps, for R, G, and B.)
> 
> 

   This already exists in 4.1.0 and newer.

#include <X11/extensions/xf86vmode.h>

Bool XF86VidModeSetGammaRamp(
    Display*                    /* dpy */,
    int                         /* screen */,
    int                         /* size */,
    unsigned short*             /* red array */,
    unsigned short*             /* green array */,
    unsigned short*             /* blue array */
);

Bool XF86VidModeGetGammaRamp(
    Display*                    /* dpy */,
    int                         /* screen */,
    int                         /* size */,
    unsigned short*             /* red array */,
    unsigned short*             /* green array */,
    unsigned short*             /* blue array */
);

Bool XF86VidModeGetGammaRampSize(
    Display*                    /* dpy */,
    int                         /* screen */,
    int*                        /* size */
);

  Pay attention to the ramp size our you'll get bitten.
All colors go from 0-65535.  And you had better restore it
when you're done with it our alot of people are going to
be mad at you because you mess up their custom ramps.


                                Mark.


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

Reply via email to