freetype
[Top][All Lists]
Advanced

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

Re: [ft] Drawing monochrome pixels into byte buffer


From: Werner LEMBERG
Subject: Re: [ft] Drawing monochrome pixels into byte buffer
Date: Fri, 21 Nov 2014 09:04:52 +0100 (CET)

> what's the most efficient way to draw non-antialiased pixels into a
> byte buffer? I've had a look at FT_PIXEL_MODE_MONOCHROME but this
> uses only 1 bit per pixel whereas I want FreeType to always plot 1
> byte per pixel (255 for visible and 0 for invisible pixels).
> Setting "num_grays" of FT_Bitmap to 2 didn't seem to have any effect
> with FT_Outline_Render().
> 
> So is there an easy way to make FT_Outline_Render() or
> FT_Outline_Get_Bitmap() draw monochrome pixels as bytes instead of
> bits or do I have to do two passes, i.e. first draw monochrome bits
> into a temporary bitmap and then map them to bytes?

You have to do the latter, for example using `FT_Bitmap_Convert',
since the B/W rasterizer is optimized to handle 1 pixel == 1 bit.


    Werner



reply via email to

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