C# 클래스 Axiom.Media.Bitwise

Class for manipulating bit patterns.
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

공개 메소드들

메소드 설명
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