freetype-devel
[Top][All Lists]
Advanced

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

Re: new release?


From: Anuj Verma
Subject: Re: new release?
Date: Sat, 22 May 2021 08:49:53 +0530

Hello Alexei,

> Using signed char is a bit problematic because the FT_Bitmap buffer is
> unsigned char. Going from signed to unsigned is well-defined, but
> backwards is implementation-defined.


I'm assuming here that `FT_Bitmap` is simply a typeless buffer and the client
can do a pointer cast ( like: FT_Char* buff = (FT_Char*)buffer ) to get the values
without modifying/casting each and every value.

> Can we simply map distances like this?
>
> SDF = 128 * ( distance - spread ) / spread;
>
> assuming positive values outside and clamping to [0,255]

Mapping the buffer to any range is fine as long as the client can figure out where
the actual edge is. In the current implementation the edge is at `0`.  So if we map
the [-128, 127] range to [0, 255], the values from [0, 127] will be `inside` and
values [129, 255] will be `outside` with the edge being at 128.

Thanks,
Anuj

reply via email to

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