freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Is it BUG???


From: mpsuzuki
Subject: Re: [ft-devel] Is it BUG???
Date: Fri, 4 Sep 2009 01:58:38 +0900

On Thu, 03 Sep 2009 16:18:34 +0300
Z3N <address@hidden> wrote:
>I'm have some new question. How to add digits in 16.16, or 26.6 
>format??? a>>6+b>>6 - not usefull.

I'm not sure what you want to do. In the calculation "a>>6 + b>>6",
what are a and b? Both of a and b are 26.6 fixed point values and
you want to obtain the integer result? Here I quote a few macros
in include/freetype/internal/ftcalc.h...

#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )
#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )
#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )
#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )
#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )
#define FIXED_TO_INT( x )      ( FT_RoundFix( x ) >> 16 )

#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \
                                        : ( -( ( 32 - (x) ) & -64 ) ) )


Regards,
mpsuzuki




reply via email to

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