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