On Fri, May 18, 2018 at 5:11 AM, Werner LEMBERG <[email protected]> wrote:
>
>>> I think that FreeType should provide a single, most basic solution
>>> for convenience – it's really just a few lines of code.
>>
>> Lets do it properly then.  Let's blend a layer or a glyph (in color)
>> onto an arbitrary background image with gamma correction.  I just
>> checked that finite difference approximation for gamma ramps works
>> pretty good.
>
> OK.  How would an API look like?

FT_Library_SetGamma
would initialize two 256-byte look up tables in FT_LibraryRec
so that instead of power functions we could do library->gamma[red].

FT_Blend_Glyph(FT_Bitmap target,
                            FT_GyphSlot source,
                           FT_Color color
                            FT_Vector topleft )

target must be  FT_PIXEL_MODE_BGRA
source must be FT_GLYPH_FORMAT_BITMAP
if topleft is not rounded,  we can try to blend with a subpixel shift

you can start from any target but you need to blend layers sequentially.

> Note that blending onto an arbitrary background image is not necessary
> IMHO.  I think the ultimate goal is to return color glyph images to
> the client that have the same format as colored bitmaps from the
> `CBDT' table.

_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to