Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Classes

NameDescription
Geo::GeoFloat3SE
Geo::GeoFloatAsBits

Allow safe conversion between a float and its representative bit pattern.

Functions

NameDescription
ConstructFloatPow2(int)

Constructs a float which is exactly equal to 1x2^exponent.

ConvertColourToV(GeoColour)

The 4 float components of v128 correspond to the native ordering of the 4 byte components of u32.

ConvertVToColour(v128)

The 4 float components of v128 correspond to the native ordering of the 4 byte components of u32.

ConvertVToIntensity(v128)

The 4 float components of v128 correspond to the native ordering of the 4 byte components of u32.

GetFloatExponent(float)

Extract the exponent of the given float, accounting for the bias (i.e. the result is in the range -127 to +128).

GetFloatMantissa(float)

Extracts the mantissa of the given float.

PackFloatToFixedWidth(float)

Packs a single-precision floating point number into a floating point number with the given number of exponent and mantissa bits.

PackFloatToRgbm(v128, bool)

Pack a v128 colour value into a u32 in RGBM format.

PackFloatToSharedExponent999e5(v128)

Packs a 4-vector of single-precision floating point numbers into a "shared exponent" 999e5 format.

UnpackFloatFromFixedWidth(u32)

Unacks a single-precision floating point number from a floating point number with the given number of exponent and mantissa bits.

UnpackFloatFromSharedExponent999e5(u32)

Unpacks a 4-vector of single-precision floating point numbers from a "shared exponent" 999e5 format.

UnpackRgbmToFloat(u32)

Unpack an rgbm colour into a v128.

VNormaliseLuminance(v128)

Normalise the intensity of a colour vector to have unit luminance.

Typedefs

NameDescription
u32 GeoColour

An 8-bit colour.

Variables

NameDescription
const Geo::v128 g_LuminanceCoefficients = Geo::VConstruct(0.2126f, 0.7152f, 0.0722f, 0.0f)

The coefficients to calculate the luminance from a colour specified in linear sRGB space These values are determined by the CIE 1931 colour space standard and the definition of the sRGB primaries.


Anchor
a17524e4f03592c7a493156bfb69c2de6
a17524e4f03592c7a493156bfb69c2de6

GEO_FORCE_INLINE float Geo::ConstructFloatPow2

...

public: GEO_FORCE_INLINE float ConstructFloatPow2
(
    int exponent
)

...

Constructs a float which is exactly equal to 1x2^exponent.


Anchor
a2aa72d2b5056632ed95c4d565124e6a2
a2aa72d2b5056632ed95c4d565124e6a2

v128 GEO_CALL Geo::ConvertColourToV

...

public: v128 GEO_CALL ConvertColourToV
(
    GeoColour colour
)

...

The 4 float components of v128 correspond to the native ordering of the 4 byte components of u32.


Anchor
a4a97751a5c33d6cdfe689b93ffed4d72
a4a97751a5c33d6cdfe689b93ffed4d72

GeoColour GEO_CALL Geo::ConvertVToColour

...

public: GeoColour GEO_CALL ConvertVToColour
(
    v128 colour
)

...

The 4 float components of v128 correspond to the native ordering of the 4 byte components of u32.


Anchor
a0ea8e7c32d83314eec2164351530b3e5
a0ea8e7c32d83314eec2164351530b3e5

float GEO_CALL Geo::ConvertVToIntensity

...

public: float GEO_CALL ConvertVToIntensity
(
    v128 colour
)

...

The 4 float components of v128 correspond to the native ordering of the 4 byte components of u32.


Anchor
a94160f8fbb851a3c9c738f139992960b
a94160f8fbb851a3c9c738f139992960b

GEO_FORCE_INLINE int Geo::GetFloatExponent

...

public: GEO_FORCE_INLINE int GetFloatExponent
(
    float f
)

...

Extract the exponent of the given float, accounting for the bias (i.e. the result is in the range -127 to +128).


Anchor
a36f4af9b15c59a0e4de69d4948ad78c4
a36f4af9b15c59a0e4de69d4948ad78c4

GEO_FORCE_INLINE u32 Geo::GetFloatMantissa

...

public: GEO_FORCE_INLINE u32 GetFloatMantissa
(
    float f
)

...

Extracts the mantissa of the given float.


Anchor
a1029f73fe92b839c21d8f50fb7491414
a1029f73fe92b839c21d8f50fb7491414

GEO_FORCE_INLINE u32 Geo::PackFloatToFixedWidth

...

public: GEO_FORCE_INLINE u32 PackFloatToFixedWidth
(
    float in
)

...

Packs a single-precision floating point number into a floating point number with the given number of exponent and mantissa bits.


Anchor
a77394cc40d3a4aabaa2e9389c654bb01
a77394cc40d3a4aabaa2e9389c654bb01

GEO_FORCE_INLINE u32 Geo::PackFloatToRgbm

...

public: GEO_FORCE_INLINE u32 PackFloatToRgbm
(
    v128 inputValue,
    bool isRgbaByteOrder
)

...

Pack a v128 colour value into a u32 in RGBM format.


Anchor
a45ffaf55c97d38dac85bf30cf6a359cf
a45ffaf55c97d38dac85bf30cf6a359cf

GEO_FORCE_INLINE u32 Geo::PackFloatToSharedExponent999e5

...

public: GEO_FORCE_INLINE u32 PackFloatToSharedExponent999e5
(
    v128 colour
)

...

Packs a 4-vector of single-precision floating point numbers into a "shared exponent" 999e5 format.


Anchor
a460c75afed0bb29342037727191ba679
a460c75afed0bb29342037727191ba679

GEO_FORCE_INLINE float Geo::UnpackFloatFromFixedWidth

...

public: GEO_FORCE_INLINE float UnpackFloatFromFixedWidth
(
    u32 in
)

...

Unacks a single-precision floating point number from a floating point number with the given number of exponent and mantissa bits.


Anchor
ab5548a45ed15013ad01be85d4877dc2d
ab5548a45ed15013ad01be85d4877dc2d

GEO_FORCE_INLINE v128 Geo::UnpackFloatFromSharedExponent999e5

...

public: GEO_FORCE_INLINE v128 UnpackFloatFromSharedExponent999e5
(
    u32 colour
)

...

Unpacks a 4-vector of single-precision floating point numbers from a "shared exponent" 999e5 format.


Anchor
a04b857732e957b10ecf959997e6e4959
a04b857732e957b10ecf959997e6e4959

GEO_FORCE_INLINE v128 Geo::UnpackRgbmToFloat

...

public: GEO_FORCE_INLINE v128 UnpackRgbmToFloat
(
    u32 rgbm
)

...

Unpack an rgbm colour into a v128.


Anchor
a934fa0a639b0be798eaefa0e3641f765
a934fa0a639b0be798eaefa0e3641f765

v128 Geo::VNormaliseLuminance

...

public: v128 VNormaliseLuminance
(
    v128 colour
)

...

Normalise the intensity of a colour vector to have unit luminance.

If colour has no luminance (black, or infs/nans) then this returns black The alpha is always preserved.