On Fri, 5 Oct 2001, Davor Buvinic Gonella wrote:

> On Thursday 04 October 2001 11:10 pm, Mark Vojkovich wrote:
> > On Thu, 4 Oct 2001, Davor Buvinic Gonella wrote:
> > > Hi,
> > >
> > > I have a question with regards to gamma correction support in XFree86
> > > that maybe someone in this mailing list can answer me.
> > >
> > > My problem comes when I change the gamma ramps using
> > > XF86VidModeSetGammaRamp(). If after that I query about the gamma
> > > correction value using XF86VidModeGetGamma() I get the last value set
> > > with
> > > XF86VidModeSetGamma(). The new ramp can have totally diferent gamma value
> > > if, for example, I change the ramp to adjust not only this value but
> > > brightness and contrast too. Or the gamma correction value can makes no
> > > sense for a special ramp loaded in the LUT.
> > >
> > > What is the right way to handle this situation?
> >
> >    Don't know.  The Gamma value just doesn't make sense for
> > such things.  Maybe just ignore it or not report it (leave it
> > greyed out or something) when it doesn't match the ramp?
> >
> >
> 
> I was thinking something like that as a solution for the control panel, but 
> maybe it can be do better:
> 
> Why not extend the XF86VidModeGetGamma() function? I would be nice if when I 
> set the ramps with XF86VidModeSetGammaRamp() a subsequent call to 
> XF86VidModeGetGamma() reports that the last change to the LUTs was made with 
> the former. Then I can be sure if the LUTs have a 'typical' gamma curve or 
> maybe another 'thing'.
> 
> Also, as with XF86VidMode{Get|Set}Gamma(), it's would be nice to have 
> something like XF86VidMode{Get|Set}Brightness and Contrast too.
> 
> My question is: worth the effort make such changes? Would you see some 
> application for this? I can code the changes to the functions if someone  
> from the developer team of XFree86 give me ideas about how the function 
> prototypes must lookalike, so I don't break other libraries that relies in 
> the VidMode extension. I know that SDL use the XF86VidMode{Set|Get}GammaRamp, 
> maybe Mesa too.
> 
   
   You can't touch XF86VidModeGetGamma().  It's written in
stone already.  All you can do is add new functions.  But I'm not
sure if it's worth that.  You can tell if it's a standard gamma
ramp by looking at the ramp.  Also, doesn't XF86VidModeSetBrightness 
and Contrast just make the problem worse?  ie. one more thing to
mess up what XF86VidModeGetGamma reports and another thing to get
trashed by setting the ramp.

   I'd suggest doing everything with the ramps.  And I think it's
a reasonable limitation to say that Querying gamma after setting
the ramp to something custom has undefined results.


                                Mark.

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

Reply via email to