OpenVDB: openvdb/math/Half.h File Reference

OpenVDB 11.0.0

Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
Half.h File Reference
`#include <openvdb/Platform.h>`
`#include <openvdb/version.h>`
`#include <iostream>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <limits>`

Go to the source code of this file.

## Classes
union | imath_half_uif
| a type for both C-only programs and C++ to use the same utilities More...
class | half
class | numeric_limits< openvdb::math::internal::half >

## Namespaces
namespace | std

## Macros
#define | IMATH_HALF_NO_LOOKUP_TABLE
#define | VDBB_HALF_DENORM_MIN 5.96046448e-08
#define | VDB_HALF_NRM_MIN 6.10351562e-05
#define | VDB_HALF_MIN 6.10351562e-05f
#define | VDB_HALF_MAX 65504.0
#define | VDB_HALF_EPSILON 0.00097656
#define | VDB_HALF_MANT_DIG 11
#define | VDB_HALF_DIG 3
#define | VDB_HALF_DECIMAL_DIG 5
#define | VDB_HALF_RADIX 2
#define | VDBB_HALF_DENORM_MIN_EXP -13
#define | VDB_HALF_MAX_EXP 16
#define | VDBB_HALF_DENORM_MIN_10_EXP -4
#define | VDB_HALF_MAX_10_EXP 4

## Typedefs
typedef union imath_half_uif | imath_half_uif_t
| a type for both C-only programs and C++ to use the same utilities
typedef uint16_t | imath_half_bits_t
| a type for both C-only programs and C++ to use the same utilities
typedef imath_half_bits_t | half
| if we're in a C-only context, alias the half bits type to half

## Functions
static float | imath_half_to_float (imath_half_bits_t h)
static imath_half_bits_t | imath_float_to_half (float f)
OPENVDB_API void | printBits (std::ostream &os, half h)
OPENVDB_API void | printBits (std::ostream &os, float f)
OPENVDB_API void | printBits (char c[19], half h)
OPENVDB_API void | printBits (char c[35], float f)
OPENVDB_API std::ostream & | operator<< (std::ostream &os, half h)
| Output h to os, formatted as a float.
OPENVDB_API std::istream & | operator>> (std::istream &is, half &h)
| Input h from is.

## Macro Definition Documentation

## ◆ IMATH_HALF_NO_LOOKUP_TABLE

#define IMATH_HALF_NO_LOOKUP_TABLE

## ◆ VDB_HALF_DECIMAL_DIG

#define VDB_HALF_DECIMAL_DIG 5

## ◆ VDB_HALF_DIG

#define VDB_HALF_DIG 3

## ◆ VDB_HALF_EPSILON

#define VDB_HALF_EPSILON 0.00097656

## ◆ VDB_HALF_MANT_DIG

#define VDB_HALF_MANT_DIG 11

## ◆ VDB_HALF_MAX

#define VDB_HALF_MAX 65504.0

## ◆ VDB_HALF_MAX_10_EXP

#define VDB_HALF_MAX_10_EXP 4

Maximum positive integer such that 10 raised to that power is a normalized half

## ◆ VDB_HALF_MAX_EXP

#define VDB_HALF_MAX_EXP 16

## ◆ VDB_HALF_MIN

#define VDB_HALF_MIN 6.10351562e-05f

## ◆ VDB_HALF_NRM_MIN

#define VDB_HALF_NRM_MIN 6.10351562e-05

## ◆ VDB_HALF_RADIX

#define VDB_HALF_RADIX 2

## ◆ VDBB_HALF_DENORM_MIN

#define VDBB_HALF_DENORM_MIN 5.96046448e-08

## ◆ VDBB_HALF_DENORM_MIN_10_EXP

#define VDBB_HALF_DENORM_MIN_10_EXP -4

Minimum positive integer such that 10 raised to that power is a normalized half

## ◆ VDBB_HALF_DENORM_MIN_EXP

#define VDBB_HALF_DENORM_MIN_EXP -13

## Typedef Documentation

## ◆ half

typedef imath_half_bits_t half

if we're in a C-only context, alias the half bits type to half

## ◆ imath_half_bits_t

typedef uint16_t imath_half_bits_t

a type for both C-only programs and C++ to use the same utilities

## ◆ imath_half_uif_t

typedef union imath_half_uif imath_half_uif_t

a type for both C-only programs and C++ to use the same utilities

## Function Documentation

## ◆ imath_float_to_half()

static imath_half_bits_t imath_float_to_half | ( | float | f | ) |
| inlinestatic

Convert half to float

Note: This only supports the "round to even" rounding mode, which was the only mode supported by the original OpenEXR library

## ◆ imath_half_to_float()

static float imath_half_to_float | ( | imath_half_bits_t | h | ) |
| inlinestatic

Convert half to float

## ◆ operator<<()

OPENVDB_API std::ostream & operator<< | ( | std::ostream & | os,
|  | half | h )

Output h to os, formatted as a float.

## ◆ operator>>()

OPENVDB_API std::istream & operator>> | ( | std::istream & | is,
|  | half & | h )

Input h from is.

## ◆ printBits() [1/4]

OPENVDB_API void printBits | ( | char | c[19],
|  | half | h )

## ◆ printBits() [2/4]

OPENVDB_API void printBits | ( | char | c[35],
|  | float | f )

## ◆ printBits() [3/4]

OPENVDB_API void printBits | ( | std::ostream & | os,
|  | float | f )

## ◆ printBits() [4/4]

OPENVDB_API void printBits | ( | std::ostream & | os,
|  | half | h )