Visualization Library 2.0.0-b3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
vl::half Class Reference

Represents an half-precision floating point value. More...

#include <half.hpp>

Public Member Functions

 half ()
 
 half (const half &hf)
 
 half (int i)
 
 half (long long i)
 
 half (float f)
 
 half (double d)
 
 operator float () const
 
 operator double () const
 
 operator int () const
 
 operator long long () const
 
halfoperator= (const half &other)
 
half operator+ (const half &other) const
 
halfoperator+= (const half &other)
 
half operator- (const half &other) const
 
halfoperator-= (const half &other)
 
half operator* (const half &other) const
 
halfoperator*= (const half &other)
 
half operator/ (const half &other) const
 
halfoperator/= (const half &other)
 
bool isZero () const
 
 operator bool () const
 
bool operator== (const half &other) const
 
bool operator== (const float &other) const
 
bool operator== (const double &other) const
 
bool operator== (const int &other) const
 
bool operator== (const long long &other) const
 
bool operator!= (const half &other) const
 
bool operator!= (const float &other) const
 
bool operator!= (const double &other) const
 
bool operator!= (const int &other) const
 
bool operator!= (const long long &other) const
 
bool operator< (const half &other) const
 
bool operator> (const half &other) const
 
bool isNaN () const
 
bool isinf () const
 
bool isinf_pos () const
 
bool isinf_neg () const
 
bool isdenorm () const
 
half operator- () const
 

Static Public Member Functions

static half infinity ()
 
static half NaN ()
 
static void convertDoubleToHalf (const double *d, half *h, int count)
 
static void convertHalfToDouble (const half *h, double *d, int count)
 
static half convertFloatToHalf (float f)
 
static float convertHalfToFloat (const half &h)
 
static void convertFloatToHalf (const float *f, half *h, int count)
 
static void convertHalfToFloat (const half *h, float *f, int count)
 

Public Attributes

unsigned short bits
 

Detailed Description

Represents an half-precision floating point value.

Definition at line 40 of file half.hpp.

Constructor & Destructor Documentation

◆ half() [1/6]

vl::half::half ( )
inline

Definition at line 43 of file half.hpp.

◆ half() [2/6]

vl::half::half ( const half hf)
inline

Definition at line 45 of file half.hpp.

◆ half() [3/6]

vl::half::half ( int  i)
inline

Definition at line 47 of file half.hpp.

◆ half() [4/6]

vl::half::half ( long long  i)
inline

Definition at line 49 of file half.hpp.

◆ half() [5/6]

vl::half::half ( float  f)
inline

Definition at line 51 of file half.hpp.

◆ half() [6/6]

vl::half::half ( double  d)
inline

Definition at line 53 of file half.hpp.

Member Function Documentation

◆ convertDoubleToHalf()

static void vl::half::convertDoubleToHalf ( const double *  d,
half h,
int  count 
)
inlinestatic

Definition at line 262 of file half.hpp.

References convertFloatToHalf().

◆ convertFloatToHalf() [1/2]

static half vl::half::convertFloatToHalf ( float  f)
inlinestatic

◆ convertFloatToHalf() [2/2]

static void vl::half::convertFloatToHalf ( const float *  f,
half h,
int  count 
)
inlinestatic

Definition at line 366 of file half.hpp.

References bits, vl::exp(), and vl::sign().

◆ convertHalfToDouble()

static void vl::half::convertHalfToDouble ( const half h,
double *  d,
int  count 
)
inlinestatic

Definition at line 268 of file half.hpp.

References convertHalfToFloat().

◆ convertHalfToFloat() [1/2]

static float vl::half::convertHalfToFloat ( const half h)
inlinestatic

◆ convertHalfToFloat() [2/2]

static void vl::half::convertHalfToFloat ( const half h,
float *  f,
int  count 
)
inlinestatic

Definition at line 411 of file half.hpp.

References bits, vl::exp(), and vl::sign().

◆ infinity()

static half vl::half::infinity ( )
inlinestatic

Definition at line 248 of file half.hpp.

References bits.

◆ isdenorm()

bool vl::half::isdenorm ( ) const
inline

Definition at line 233 of file half.hpp.

References bits, and vl::exp().

◆ isinf()

bool vl::half::isinf ( ) const
inline

Definition at line 210 of file half.hpp.

References bits, and vl::exp().

◆ isinf_neg()

bool vl::half::isinf_neg ( ) const
inline

Definition at line 225 of file half.hpp.

References bits, vl::exp(), and vl::sign().

◆ isinf_pos()

bool vl::half::isinf_pos ( ) const
inline

Definition at line 217 of file half.hpp.

References bits, vl::exp(), and vl::sign().

◆ isNaN()

bool vl::half::isNaN ( ) const
inline

Definition at line 203 of file half.hpp.

References bits, and vl::exp().

Referenced by operator!=(), and operator==().

◆ isZero()

bool vl::half::isZero ( ) const
inline

Definition at line 121 of file half.hpp.

References bits.

Referenced by operator bool(), operator!=(), and operator==().

◆ NaN()

static half vl::half::NaN ( )
inlinestatic

Definition at line 255 of file half.hpp.

References bits.

◆ operator bool()

vl::half::operator bool ( ) const
inline

Definition at line 126 of file half.hpp.

References isZero().

◆ operator double()

vl::half::operator double ( ) const
inline

Definition at line 60 of file half.hpp.

References convertHalfToFloat().

◆ operator float()

vl::half::operator float ( ) const
inline

Definition at line 55 of file half.hpp.

References convertHalfToFloat().

◆ operator int()

vl::half::operator int ( ) const
inline

Definition at line 65 of file half.hpp.

References convertHalfToFloat().

◆ operator long long()

vl::half::operator long long ( ) const
inline

Definition at line 70 of file half.hpp.

References convertHalfToFloat().

◆ operator!=() [1/5]

bool vl::half::operator!= ( const half other) const
inline

Definition at line 162 of file half.hpp.

References bits, isNaN(), and isZero().

Referenced by operator!=().

◆ operator!=() [2/5]

bool vl::half::operator!= ( const float &  other) const
inline

Definition at line 173 of file half.hpp.

References convertFloatToHalf(), and operator!=().

◆ operator!=() [3/5]

bool vl::half::operator!= ( const double &  other) const
inline

Definition at line 178 of file half.hpp.

References convertFloatToHalf(), and operator!=().

◆ operator!=() [4/5]

bool vl::half::operator!= ( const int &  other) const
inline

Definition at line 183 of file half.hpp.

References convertFloatToHalf(), and operator!=().

◆ operator!=() [5/5]

bool vl::half::operator!= ( const long long &  other) const
inline

Definition at line 188 of file half.hpp.

References convertFloatToHalf(), and operator!=().

◆ operator*()

half vl::half::operator* ( const half other) const
inline

Definition at line 101 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator*=()

half& vl::half::operator*= ( const half other)
inline

Definition at line 106 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator+()

half vl::half::operator+ ( const half other) const
inline

Definition at line 81 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator+=()

half& vl::half::operator+= ( const half other)
inline

Definition at line 86 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator-() [1/2]

half vl::half::operator- ( const half other) const
inline

Definition at line 91 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator-() [2/2]

half vl::half::operator- ( ) const
inline

Definition at line 240 of file half.hpp.

References bits.

◆ operator-=()

half& vl::half::operator-= ( const half other)
inline

Definition at line 96 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator/()

half vl::half::operator/ ( const half other) const
inline

Definition at line 111 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator/=()

half& vl::half::operator/= ( const half other)
inline

Definition at line 116 of file half.hpp.

References convertFloatToHalf(), and convertHalfToFloat().

◆ operator<()

bool vl::half::operator< ( const half other) const
inline

Definition at line 193 of file half.hpp.

References convertHalfToFloat().

◆ operator=()

half& vl::half::operator= ( const half other)
inline

Definition at line 75 of file half.hpp.

References bits.

◆ operator==() [1/5]

bool vl::half::operator== ( const half other) const
inline

Definition at line 131 of file half.hpp.

References bits, isNaN(), and isZero().

Referenced by operator==().

◆ operator==() [2/5]

bool vl::half::operator== ( const float &  other) const
inline

Definition at line 142 of file half.hpp.

References convertFloatToHalf(), and operator==().

◆ operator==() [3/5]

bool vl::half::operator== ( const double &  other) const
inline

Definition at line 147 of file half.hpp.

References convertFloatToHalf(), and operator==().

◆ operator==() [4/5]

bool vl::half::operator== ( const int &  other) const
inline

Definition at line 152 of file half.hpp.

References convertFloatToHalf(), and operator==().

◆ operator==() [5/5]

bool vl::half::operator== ( const long long &  other) const
inline

Definition at line 157 of file half.hpp.

References convertFloatToHalf(), and operator==().

◆ operator>()

bool vl::half::operator> ( const half other) const
inline

Definition at line 198 of file half.hpp.

References convertHalfToFloat().

Member Data Documentation

◆ bits

unsigned short vl::half::bits

The documentation for this class was generated from the following file: