# type_half.hpp Source File

type_half.hpp
Go to the documentation of this file.
#ifndef glm_core_type_half
#define glm_core_type_half
#include <cstdlib>
namespace glm{
namespace detail
{
typedef short hdata;
float toFloat32(hdata value);
hdata toFloat16(float const & value);
class half
{
public:
// Constructors
GLM_FUNC_DECL half();
GLM_FUNC_DECL half(half const & s);
template <typename U>
GLM_FUNC_DECL explicit half(U const & s);
// Cast
//template <typename U>
//GLM_FUNC_DECL operator U() const;
GLM_FUNC_DECL operator float() const;
// Unary updatable operators
GLM_FUNC_DECL half& operator= (half const & s);
GLM_FUNC_DECL half& operator+=(half const & s);
GLM_FUNC_DECL half& operator-=(half const & s);
GLM_FUNC_DECL half& operator*=(half const & s);
GLM_FUNC_DECL half& operator/=(half const & s);
GLM_FUNC_DECL half& operator++();
GLM_FUNC_DECL half& operator--();
GLM_FUNC_DECL float toFloat() const{return toFloat32(data);}
GLM_FUNC_DECL hdata _data() const{return data;}
private:
hdata data;
};
half operator+ (half const & s1, half const & s2);
half operator- (half const & s1, half const & s2);
half operator* (half const & s1, half const & s2);
half operator/ (half const & s1, half const & s2);
// Unary constant operators
half operator- (half const & s);
half operator-- (half const & s, int);
half operator++ (half const & s, int);
bool operator==(
detail::half const & x,
detail::half const & y);
bool operator!=(
detail::half const & x,
detail::half const & y);
bool operator<(
detail::half const & x,
detail::half const & y);
bool operator<=(
detail::half const & x,
detail::half const & y);
bool operator>(
detail::half const & x,
detail::half const & y);
bool operator>=(
detail::half const & x,
detail::half const & y);
}//namespace detail
}//namespace glm
#include "type_half.inl"
#endif//glm_core_type_half