freetype
[Top][All Lists]
Advanced

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

Re: [ft] FT_Outline_Get_Bitmap() in 2.3.5


From: Werner LEMBERG
Subject: Re: [ft] FT_Outline_Get_Bitmap() in 2.3.5
Date: Sat, 21 Jun 2008 08:28:02 +0200 (CEST)

While looking through older mails, I've found this one which I've
apparently never answered.  Sorry for the delay.

> 1. My reading of the documentation and code is that when
>    FT_Outline_Get_Bitmap is called, the bitmap passed in should
>    already have all its fields set, including bitmap->pixel_mode and
>    bitmap->num_grays.  Correct?

Yes.
>
> 2. I am dealing with client code that calls FT_Outline_Get_Bitmap,
>    but does not set num_grays when pixel_mode==FT_PIXEL_MODE_GRAY.
>    I think this is a bug in the client code, but it works ok because
>    gray_raster_render assumes that bitmap->num_grays==256, as does
>    the client software.  Specifically, ftgrays.c creates 256 gray
>    values unless you provide a replacement callback for
>    gray_render_span via the FT_RASTER_FLAG_DIRECT bit in
>    params->flags.  Am I missing something obvious in what I am
>    saying?

This is correct also.

>    If my analysis is correct, then if you pass into
>    FT_Outline_Get_Bitmap() a bitmap->num_grays that is other than
>    256, you’ll still get values from [0..255] unless you provide
>    your own render_span replacement.

Yes.

>    My tests show this to be true, and if so, I believe it should be
>    documented.

I've done this right now.

> 3. There is a typo, I believe, at line 132 (both CVS and Release
>    2.3.5) of include/ftimage.h in the documentation. Instead of
>    'num_bytes', it should say 'num_grays'.

Fixed also, thanks.


    Werner

reply via email to

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