C# Класс Axiom.Media.Bitwise

Class for manipulating bit patterns.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FirstPO2From ( uint n ) : uint

Returns the closest power-of-two number greater or equal to value.

0 and 1 are powers of two, so firstPO2From(0)==0 and firstPO2From(1)==1.

FixedToByteFixed ( uint value, int p ) : byte

Convert N bit colour channel value to 8 bits, and return as a byte. It fills P bits with thebit pattern repeated. (this is /((1<<n)-1) in fixed point)

FixedToFixed ( uint value, int n, int p ) : uint

Convert N bit colour channel value to P bits. It fills P bits with the bit pattern repeated. (this is /((1<<n)-1) in fixed point)

FixedToFloat ( uint value, int bits ) : float

Fixed point to float

FloatToByteFixed ( float value ) : byte

Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to an 8-bit integer, and return as a byte.

FloatToFixed ( float value, int bits ) : uint

Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to integer of a certain number of bits. Works for any value of bits between 0 and 31.

FloatToHalf ( float f ) : ushort

Convert a float32 to a float16 (NV_half_float) Courtesy of OpenEXR

FloatToHalfI ( uint i ) : ushort

Converts float in uint format to a a half in ushort format

HalfToFloat ( ushort y ) : float

Convert a float16 (NV_half_float) to a float32 Courtesy of OpenEXR

HalfToFloatI ( ushort y ) : uint

Converts a half in ushort format to a float in uint format

IntRead ( IntPtr src, int n ) : uint

Read a n*8 bits integer value to memory in native endian.

IntWrite ( IntPtr dest, int n, uint value ) : void
IsPow2 ( int number ) : bool

checks if a number is a power of 2

MostSignificantBitSet ( uint value ) : uint

Returns the most significant bit set in a value.

Описание методов

FirstPO2From() публичный статический метод

Returns the closest power-of-two number greater or equal to value.
0 and 1 are powers of two, so firstPO2From(0)==0 and firstPO2From(1)==1.
public static FirstPO2From ( uint n ) : uint
n uint
Результат uint

FixedToByteFixed() публичный статический метод

Convert N bit colour channel value to 8 bits, and return as a byte. It fills P bits with thebit pattern repeated. (this is /((1<<n)-1) in fixed point)
public static FixedToByteFixed ( uint value, int p ) : byte
value uint
p int
Результат byte

FixedToFixed() публичный статический метод

Convert N bit colour channel value to P bits. It fills P bits with the bit pattern repeated. (this is /((1<<n)-1) in fixed point)
public static FixedToFixed ( uint value, int n, int p ) : uint
value uint
n int
p int
Результат uint

FixedToFloat() публичный статический метод

Fixed point to float
public static FixedToFloat ( uint value, int bits ) : float
value uint
bits int
Результат float

FloatToByteFixed() публичный статический метод

Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to an 8-bit integer, and return as a byte.
public static FloatToByteFixed ( float value ) : byte
value float
Результат byte

FloatToFixed() публичный статический метод

Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to integer of a certain number of bits. Works for any value of bits between 0 and 31.
public static FloatToFixed ( float value, int bits ) : uint
value float
bits int
Результат uint

FloatToHalf() публичный статический метод

Convert a float32 to a float16 (NV_half_float) Courtesy of OpenEXR
public static FloatToHalf ( float f ) : ushort
f float
Результат ushort

FloatToHalfI() публичный статический метод

Converts float in uint format to a a half in ushort format
public static FloatToHalfI ( uint i ) : ushort
i uint
Результат ushort

HalfToFloat() публичный статический метод

Convert a float16 (NV_half_float) to a float32 Courtesy of OpenEXR
public static HalfToFloat ( ushort y ) : float
y ushort
Результат float

HalfToFloatI() публичный статический метод

Converts a half in ushort format to a float in uint format
public static HalfToFloatI ( ushort y ) : uint
y ushort
Результат uint

IntRead() публичный статический метод

Read a n*8 bits integer value to memory in native endian.
public static IntRead ( IntPtr src, int n ) : uint
src System.IntPtr
n int
Результат uint

IntWrite() публичный статический метод

public static IntWrite ( IntPtr dest, int n, uint value ) : void
dest System.IntPtr
n int
value uint
Результат void

IsPow2() публичный статический метод

checks if a number is a power of 2
public static IsPow2 ( int number ) : bool
number int
Результат bool

MostSignificantBitSet() публичный статический метод

Returns the most significant bit set in a value.
public static MostSignificantBitSet ( uint value ) : uint
value uint
Результат uint