freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] CPAL interface


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] CPAL interface
Date: Fri, 18 May 2018 16:06:39 -0400

On Fri, May 18, 2018 at 5:11 AM, Werner LEMBERG <address@hidden> 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.



reply via email to

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