br_fraction
br_fraction
138
type can be used to represent numbers in the range [-1,+1)*1. Although used internally, this type is not currently used by the BRender API.
Under the floating point library, br_fraction
138 is a
float
. Under the fixed point library, br_fraction
138 is a 16 bit signed fixed point number.
typedef
scalar.h
for precise declaration)
float br_fraction Floating point Signed Fraction
br_fixed_lsf br_fraction Fixed - Long Signed Fraction (0.15)
br_scalar
332
and use that type's arithmetic macros instead.
The following macros are provided to assist with fractional vector arithmetic (see br_fraction
138). In the following macros, arguments
a
, c
, e
and g
are of type br_fraction
138,
b
, d
, f
and h
are of type br_scalar
332. The macro computes a
br_scalar
332 result.
BR_FMAC2(a,b,c,d)
Return the equivalent of a * b + c * d
.
Return the equivalent ofBR_FMAC3(a,b,c,d,e,f)
a * b + c * d + e * f
.
Return the equivalent ofBR_FMAC4(a,b,c,d,e,f,g,h)
a * b + c * d + e * f + g * h
.ConvertBR_FRACTION(x)
x
from any numeric constant to br_fraction
138
.
BR_SCALAR_EPSILON
Smallest positive fractional value.
br_scalar
332
as an intermediary.
br_scalar
332
br_fraction BrScalarToFraction(br_scalar s)Converts
s
from br_scalar
332
to br_fraction
138
. It is up to the application to ensure the value is in the required range.
br_scalar
332
as an intermediary.
br_scalar
332
br_scalar BrFractionToScalar(br_fraction f)Converts
s
from br_fraction
138
to br_scalar
332
. It is up to the application to ensure the value is in the required range.