>> * 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

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

Reply via email to