[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/libs/kgllib/extras/kgllib
From:       BenoƮt Jacob <jacob () math ! jussieu ! fr>
Date:       2008-03-15 17:57:52
Message-ID: 1205603872.513253.6440.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 785969 by bjacob:

- port a tweak from avogadro trunk:
  reduce the gamma correction applied to glyphs, as the former one
  gave me too bold text with certain fonts. Still not sure this is the perfect
  value but at least in this form it's easier to tweak. A value of 1.0 means no
  correction at all; the lower the value the bigger the impact. Currently 0.75.
- update comments (remove remnants from a former implementation)



 M  +4 -7      textrenderer.cpp  


--- trunk/playground/libs/kgllib/extras/kgllib/textrenderer.cpp #785968:785969
@@ -193,7 +193,7 @@
       for( int i = 0; i < texwidth; i++, n++ )
       {
         double x = qBlue( image.pixel( i, j ) ) / 255.0;
-        double y = sqrt(x); /* this applies a gamma correction with gamma factor 0.5.
+        double y = pow(x, 0.75); /* this applies a gamma correction with gamma factor 0.5.
                   the effect of this is to concentrate the intensities in
                   the large values. This results in a slightly bolder-looking
                   font, which is more suitable for outlining. More importantly,
@@ -239,11 +239,8 @@
       }
     }
 
-    // *** STEP 4 : compute the final bitmap ***
-    // --> explanation: we build the bitmap that will be passed to OpenGL for texturing.
-    //     this texture has 2 channels: the luminance and the alpha channels.
-    //     the rawbitmap readily gives the luminance channel, while the computation of the
-    //     alpha channel is a bit more involved and uses the neighborhood map.
+    // *** STEP 4 : compute the final bitmaps  ***
+    // --> explanation: we build the bitmaps that will be passed to OpenGL for texturing.
 
     GLubyte *glyphbitmap = new GLubyte[ texwidth * texheight ];
     if( ! glyphbitmap ) return false;
@@ -263,7 +260,7 @@
     delete [] rawbitmap;
     delete [] neighborhood;
 
-    // *** STEP 5 : pass the final bitmap to OpenGL for texturing ***
+    // *** STEP 5 : construct OpenGL textures from the final bitmaps ***
 
     glGenTextures( 1, &m_glyphTexture );
     if( ! m_glyphTexture ) return false;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic