org.ogre4j
Class Bitwise

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.Bitwise
All Implemented Interfaces:
IBitwise, INativeObject

public class Bitwise
extends NativeObject
implements IBitwise


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Bitwise()
           
  Bitwise(InstancePointer p)
          This constructor is public for internal useage only!
protected Bitwise(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Bitwise(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
static long firstPO2From(long n)
          Returns the closest power-of-two number greater or equal to value.
static long fixedToFixed(long value, long n, long p)
          Convert N bit colour channel value to P bits.
static float fixedToFloat(long value, long bits)
          Fixed point to float
static long floatToFixed(float value, long bits)
          Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to integer of a certain number of bits.
static int floatToHalf(float i)
          Convert a float32 to a float16 (NV_half_float) Courtesy of OpenEXR
static int floatToHalfI(long i)
          Converts float in uint32 format to a a half in uint16 format
static float halfToFloat(int y)
          Convert a float16 (NV_half_float) to a float32 Courtesy of OpenEXR
static long halfToFloatI(int y)
          Converts a half in uint16 format to a float in uint32 format
static long intRead(VoidPointer src, int n)
          Read a n*8 bits integer value to memory in native endian.
static void intWrite(VoidPointer dest, int n, long value)
          Write a n*8 bits integer value to memory in native endian.
static long mostSignificantBitSet(long value)
          Returns the most significant bit set in a value.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

Bitwise

public Bitwise(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


Bitwise

protected Bitwise(InstancePointer p,
                  boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


Bitwise

public Bitwise(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Bitwise

public Bitwise()
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

mostSignificantBitSet

public static long mostSignificantBitSet(long value)
Returns the most significant bit set in a value.


firstPO2From

public static long firstPO2From(long n)
Returns the closest power-of-two number greater or equal to value.


fixedToFixed

public static long fixedToFixed(long value,
                                long n,
                                long p)
Convert N bit colour channel value to P bits. It fills P bits with the bit pattern repeated. (this is /((1<

floatToFixed

public static long floatToFixed(float value,
                                long bits)
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.


fixedToFloat

public static float fixedToFloat(long value,
                                 long bits)
Fixed point to float


intWrite

public static void intWrite(VoidPointer dest,
                            int n,
                            long value)
Write a n*8 bits integer value to memory in native endian.


intRead

public static long intRead(VoidPointer src,
                           int n)
Read a n*8 bits integer value to memory in native endian.


floatToHalf

public static int floatToHalf(float i)
Convert a float32 to a float16 (NV_half_float) Courtesy of OpenEXR


floatToHalfI

public static int floatToHalfI(long i)
Converts float in uint32 format to a a half in uint16 format


halfToFloat

public static float halfToFloat(int y)
Convert a float16 (NV_half_float) to a float32 Courtesy of OpenEXR


halfToFloatI

public static long halfToFloatI(int y)
Converts a half in uint16 format to a float in uint32 format



Copyright © 2007 netAllied GmbH. All Rights Reserved.