All pastes #717042 Raw Edit

Mine

public text v1 · immutable
#717042 ·published 2007-09-27 10:52 UTC
rendered paste body
static inline void draw_glyph(AVPicture *picture, FT_Bitmap *bitmap, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned char yuv_fgcolor[3], unsigned char yuv_bgcolor[3], int outline)
{
    int r, c;
    int spixel, dpixel[3], in_glyph = 0;

    if( bitmap->pixel_mode == ft_pixel_mode_mono )
    {
        in_glyph = 0;
        for( r=0; (r < bitmap->rows) && (r+y < height); r++ )
        {
            for (c=0; (c < bitmap->width) && (c+x < width); c++)
            {
                if( bitmap->buffer[r*bitmap->pitch + c] )
                    *((uint32_t*)(picture->data[0] + (x+c)*4 + (y+r)*(picture->linesize[0]))) = 0x00FF0000;
            }
        }
    }
}