[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [freetype2-demos] master 1612259: [ftview, ftstring, ftgrid] Unify g
From: |
Werner LEMBERG |
Subject: |
Re: [freetype2-demos] master 1612259: [ftview, ftstring, ftgrid] Unify gamma adjustments. |
Date: |
Thu, 14 May 2020 06:38:59 +0200 (CEST) |
+ void
+ FTDemo_Display_Gamma_Change( FTDemo_Display* display,
+ int dir )
+ {
+ if ( dir > 0 )
+ {
+ if ( display->gamma == 0.0 )
+ display->gamma = 2.3;
+ else if ( 2.25 - 0.1 < display->gamma && display->gamma < 2.25 )
+ display->gamma = 0.0; /* sRGB */
+ else if ( display->gamma < 2.95 )
+ display->gamma += 0.1;
+ }
+ else if ( dir < 0 )
+ {
+ if ( display->gamma == 0.0 )
+ display->gamma = 2.2;
+ else if ( 2.25 + 0.1 > display->gamma && display->gamma > 2.25 )
+ display->gamma = 0.0; /* sRGB */
+ else if ( display->gamma > 0.35 )
+ display->gamma -= 0.1;
+ }
+
+ grSetTargetGamma( display->bitmap, display->gamma );
+ }
Alexei,
I don't understand what this function exactly does, and why the gamma
value is sometimes changed abruptly. Please add a comment that
explains this – maybe even some additional info should be displayed?
Werner
- Re: [freetype2-demos] master 1612259: [ftview, ftstring, ftgrid] Unify gamma adjustments.,
Werner LEMBERG <=