The name Half is derived from half-precision floating-point number. It occupies only 16 bits, which are split into 1 Sign bit, 5 Exponent bits and 10 Mantissa bits.
More...
Inherits ISerializable, IComparable< Half >, IFormattable, and IEquatable< Half >.
|
| Half (Single f) |
| The new Half instance will convert the parameter into 16-bit half-precision floating-point. More...
|
|
| Half (Single f, bool throwOnError) |
| The new Half instance will convert the parameter into 16-bit half-precision floating-point. More...
|
|
| Half (Double d) |
| The new Half instance will convert the parameter into 16-bit half-precision floating-point. More...
|
|
| Half (Double d, bool throwOnError) |
| The new Half instance will convert the parameter into 16-bit half-precision floating-point. More...
|
|
Single | ToSingle () |
| Converts the 16-bit half to 32-bit floating-point. More...
|
|
| Half (SerializationInfo info, StreamingContext context) |
| Constructor used by ISerializable to deserialize the object. More...
|
|
void | GetObjectData (SerializationInfo info, StreamingContext context) |
| Used by ISerialize to serialize the object. More...
|
|
void | FromBinaryStream (BinaryReader bin) |
| Updates the Half by reading from a Stream. More...
|
|
void | ToBinaryStream (BinaryWriter bin) |
| Writes the Half into a Stream. More...
|
|
bool | Equals (Half other) |
| Returns a value indicating whether this instance is equal to a specified OpenTK.Half value. More...
|
|
int | CompareTo (Half other) |
| Compares this instance to a specified half-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified half-precision floating-point number. More...
|
|
override string | ToString () |
| Converts this Half into a human-legible string representation. More...
|
|
string | ToString (string format, IFormatProvider formatProvider) |
| Converts this Half into a human-legible string representation. More...
|
|
|
UInt16 | bits |
|
const int | maxUlps = 1 |
|
|
static readonly Int32 | SizeInBytes = 2 |
| The size in bytes for an instance of the Half struct. More...
|
|
static readonly Single | MinValue = 5.96046448e-08f |
| Smallest positive half More...
|
|
static readonly Single | MinNormalizedValue = 6.10351562e-05f |
| Smallest positive normalized half More...
|
|
static readonly Single | MaxValue = 65504.0f |
| Largest positive half More...
|
|
static readonly Single | Epsilon = 0.00097656f |
| Smallest positive e for which half (1.0 + e) != half (1.0) More...
|
|
The name Half is derived from half-precision floating-point number. It occupies only 16 bits, which are split into 1 Sign bit, 5 Exponent bits and 10 Mantissa bits.
Quote from ARB_half_float_pixel specification: Any representable 16-bit floating-point value is legal as input to a GL command that accepts 16-bit floating-point data. The result of providing a value that is not a floating-point number (such as infinity or NaN) to such a command is unspecified, but must not lead to GL interruption or termination. Providing a denormalized number or negative zero to GL must yield predictable results.
OpenTK.Half.Half |
( |
Single |
f | ) |
|
The new Half instance will convert the parameter into 16-bit half-precision floating-point.
- Parameters
-
f | 32-bit single-precision floating-point number. |
OpenTK.Half.Half |
( |
Single |
f, |
|
|
bool |
throwOnError |
|
) |
| |
The new Half instance will convert the parameter into 16-bit half-precision floating-point.
- Parameters
-
f | 32-bit single-precision floating-point number. |
throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
OpenTK.Half.Half |
( |
Double |
d | ) |
|
The new Half instance will convert the parameter into 16-bit half-precision floating-point.
- Parameters
-
d | 64-bit double-precision floating-point number. |
OpenTK.Half.Half |
( |
Double |
d, |
|
|
bool |
throwOnError |
|
) |
| |
The new Half instance will convert the parameter into 16-bit half-precision floating-point.
- Parameters
-
d | 64-bit double-precision floating-point number. |
throwOnError | Enable checks that will throw if the conversion result is not meaningful. |
OpenTK.Half.Half |
( |
SerializationInfo |
info, |
|
|
StreamingContext |
context |
|
) |
| |
Constructor used by ISerializable to deserialize the object.
- Parameters
-
int OpenTK.Half.CompareTo |
( |
Half |
other | ) |
|
Compares this instance to a specified half-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified half-precision floating-point number.
- Parameters
-
other | A half-precision floating-point number to compare. |
- Returns
A signed number indicating the relative values of this instance and value. If the number is:
Less than zero, then this instance is less than other, or this instance is not a number (OpenTK.Half.NaN) and other is a number.
Zero: this instance is equal to value, or both this instance and other are not a number (OpenTK.Half.NaN), OpenTK.Half.PositiveInfinity, or OpenTK.Half.NegativeInfinity.
Greater than zero: this instance is greater than othrs, or this instance is a number and other is not a number (OpenTK.Half.NaN).
bool OpenTK.Half.Equals |
( |
Half |
other | ) |
|
Returns a value indicating whether this instance is equal to a specified OpenTK.Half value.
- Parameters
-
- Returns
- True, if other is equal to this instance; false otherwise.
void OpenTK.Half.FromBinaryStream |
( |
BinaryReader |
bin | ) |
|
Updates the Half by reading from a Stream.
- Parameters
-
bin | A BinaryReader instance associated with an open Stream. |
static Half OpenTK.Half.FromBytes |
( |
byte[] |
value, |
|
|
int |
startIndex |
|
) |
| |
|
static |
Converts an array of bytes into Half.
- Parameters
-
value | A Half in it's byte[] representation. |
startIndex | The starting position within value. |
- Returns
- A new Half instance.
static byte [] OpenTK.Half.GetBytes |
( |
Half |
h | ) |
|
|
static |
Returns the Half as an array of bytes.
- Parameters
-
- Returns
- The input as byte array.
void OpenTK.Half.GetObjectData |
( |
SerializationInfo |
info, |
|
|
StreamingContext |
context |
|
) |
| |
Used by ISerialize to serialize the object.
- Parameters
-
static implicit OpenTK.Half.operator double |
( |
Half |
h | ) |
|
|
static |
Converts a OpenTK.Half to a System.Double.
- Parameters
-
h | The value to convert. A Half |
- Returns
- The result of the conversion. A System.Double
static implicit OpenTK.Half.operator float |
( |
Half |
h | ) |
|
|
static |
Converts a OpenTK.Half to a System.Single.
- Parameters
-
h | The value to convert. A Half |
- Returns
- The result of the conversion. A System.Single
static OpenTK.Half.operator Half |
( |
float |
f | ) |
|
|
explicitstatic |
Converts a System.Single to a OpenTK.Half.
- Parameters
-
f | The value to convert. A System.Single |
- Returns
- The result of the conversion. A Half
static OpenTK.Half.operator Half |
( |
double |
d | ) |
|
|
explicitstatic |
Converts a System.Double to a OpenTK.Half.
- Parameters
-
d | The value to convert. A System.Double |
- Returns
- The result of the conversion. A Half
static Half OpenTK.Half.Parse |
( |
string |
s | ) |
|
|
static |
Converts the string representation of a number to a half-precision floating-point equivalent.
- Parameters
-
s | String representation of the number to convert. |
- Returns
- A new Half instance.
static Half OpenTK.Half.Parse |
( |
string |
s, |
|
|
System.Globalization.NumberStyles |
style, |
|
|
IFormatProvider |
provider |
|
) |
| |
|
static |
Converts the string representation of a number to a half-precision floating-point equivalent.
- Parameters
-
s | String representation of the number to convert. |
style | Specifies the format of s. |
provider | Culture-specific formatting information. |
- Returns
- A new Half instance.
void OpenTK.Half.ToBinaryStream |
( |
BinaryWriter |
bin | ) |
|
Writes the Half into a Stream.
- Parameters
-
bin | A BinaryWriter instance associated with an open Stream. |
Single OpenTK.Half.ToSingle |
( |
| ) |
|
Converts the 16-bit half to 32-bit floating-point.
- Returns
- A single-precision floating-point number.
override string OpenTK.Half.ToString |
( |
| ) |
|
Converts this Half into a human-legible string representation.
- Returns
- The string representation of this instance.
string OpenTK.Half.ToString |
( |
string |
format, |
|
|
IFormatProvider |
formatProvider |
|
) |
| |
Converts this Half into a human-legible string representation.
- Parameters
-
format | Formatting for the output string. |
formatProvider | Culture-specific formatting information. |
- Returns
- The string representation of this instance.
static bool OpenTK.Half.TryParse |
( |
string |
s, |
|
|
out Half |
result |
|
) |
| |
|
static |
Converts the string representation of a number to a half-precision floating-point equivalent. Returns success.
- Parameters
-
s | String representation of the number to convert. |
result | The Half instance to write to. |
- Returns
- Success.
static bool OpenTK.Half.TryParse |
( |
string |
s, |
|
|
System.Globalization.NumberStyles |
style, |
|
|
IFormatProvider |
provider, |
|
|
out Half |
result |
|
) |
| |
|
static |
Converts the string representation of a number to a half-precision floating-point equivalent. Returns success.
- Parameters
-
s | String representation of the number to convert. |
style | Specifies the format of s. |
provider | Culture-specific formatting information. |
result | The Half instance to write to. |
- Returns
- Success.
readonly Single OpenTK.Half.Epsilon = 0.00097656f |
|
static |
Smallest positive e for which half (1.0 + e) != half (1.0)
readonly Single OpenTK.Half.MaxValue = 65504.0f |
|
static |
readonly Single OpenTK.Half.MinNormalizedValue = 6.10351562e-05f |
|
static |
Smallest positive normalized half
readonly Single OpenTK.Half.MinValue = 5.96046448e-08f |
|
static |
readonly Int32 OpenTK.Half.SizeInBytes = 2 |
|
static |
The size in bytes for an instance of the Half struct.
Returns true if the Half represents Not A Number (NaN)
bool OpenTK.Half.IsNegativeInfinity |
|
get |
Returns true if the Half represents negative infinity.
bool OpenTK.Half.IsPositiveInfinity |
|
get |
Returns true if the Half represents positive infinity.
Returns true if the Half is zero.