freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] CPAL interface


From: Werner LEMBERG
Subject: Re: [ft-devel] CPAL interface
Date: Wed, 16 May 2018 06:12:04 +0200 (CEST)

>> * The used color space is sRGB; the colors are not pre-multiplied,
>> * and alpha values must be explicitly set.
> 
> This somewhat contradicts with
> https://www.freetype.org/freetype2/docs/reference/ft2-basic_types.html#FT_PIXEL_MODE_BGRA,
> which is premultiplied.

Mhmm, `CPAL' is defined this way...  It's the job of the blender to
apply the not-pre-multiplied colors appropriately to get a
pre-multiplied bitmap.  The code from Shao-Yu contains such a blending
operation; I'll also make this function publicly available.

> Also I thought that sRGB means blending with gamma correction of 2
> or so.  Did I miss it?
> http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/base/ftbitmap.c#n457
> Is this reusable somehow?

Not for this case, as far as I can see.  The code to blend two color
layers as specified in COLR/CPAL is (currently) function
`tt_face_colr_blend_layer'.


    Werner



reply via email to

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