freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] [sfnt] Improve sRGB constants.


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] [sfnt] Improve sRGB constants.
Date: Thu, 27 Jan 2022 07:48:10 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • src/base/ftbitmap.c
    ... ... @@ -480,7 +480,7 @@
    480 480
          * A gamma of 2.2 is fair to assume.  And then, we need to
    
    481 481
          * undo the premultiplication too.
    
    482 482
          *
    
    483
    -     *   https://accessibility.kde.org/hsl-adjusted.php
    
    483
    +     *   http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html#SideNotes
    
    484 484
          *
    
    485 485
          * We do the computation with integers only, applying a gamma of 2.0.
    
    486 486
          * We guarantee 32-bit arithmetic to avoid overflow but the resulting
    
    ... ... @@ -488,9 +488,9 @@
    488 488
          *
    
    489 489
          */
    
    490 490
     
    
    491
    -    l = (  4732UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] +
    
    492
    -          46871UL /* 0.7152 * 65536 */ * bgra[1] * bgra[1] +
    
    493
    -          13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2] ) >> 16;
    
    491
    +    l = (  4731UL /* 0.072186 * 65536 */ * bgra[0] * bgra[0] +
    
    492
    +          46868UL /* 0.715158 * 65536 */ * bgra[1] * bgra[1] +
    
    493
    +          13937UL /* 0.212656 * 65536 */ * bgra[2] * bgra[2] ) >> 16;
    
    494 494
     
    
    495 495
         /*
    
    496 496
          * Final transparency can be determined as follows.
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]