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: Z3N
Subject: Re: [ft-devel] Is it BUG???
Date: Wed, 09 Sep 2009 16:41:30 +0300
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

address@hidden пишет:
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
  
Hi!
I'm not sure what you want to do.
I'm want add two values in 26.6 format
a in format 26.6
b in format 26.6
a+b=HOW?
Regards,
Z3N

reply via email to

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