java::awt::image::DataBuffer Class Reference

Inheritance diagram for java::awt::image::DataBuffer:

Inheritance graph
java::awt::image::DataBufferBytejava::awt::image::DataBufferIntjava::awt::image::DataBufferShortjava::lang::Object
[legend]
Collaboration diagram for java::awt::image::DataBuffer:

Collaboration graph
java::lang::Object
[legend]

List of all members.

Public Types

enum  DATA_BUFFER_TYPE {
  TYPE_BYTE, TYPE_SHORT, TYPE_INT, TYPE_FLOAT,
  TYPE_DOUBLE, TYPE_UNDEFINED = 32
}

Public Member Functions

virtual jint getDataType () const
 Returns the data type of this DataBuffer.
virtual jint getSize () const
 Returns the size (in array elements) of all banks.
virtual jint getNumBanks () const
 Returns the number of banks in this DataBuffer.
virtual jint getOffset (jint bank=0) const
 Returns the offset of the default bank in array elements.
virtual const Array
< jint > & 
getOffsets () const
 Returns the offsets (in array elements) of all the banks.
virtual jint getElem (jint i, jint bank=0) const =0
 Returns the requested data array element from the specified bank as an integer.
virtual void setElem (jint i, jint val, jint bank=0)=0
 Sets the requested data array element in the specified bank from the given integer.
virtual jfloat getElemFloat (jint i, jint bank=0) const
 Returns the requested data array element from the specified bank as a float.
virtual void setElemFloat (jint i, jfloat val, jint bank=0)
 Sets the requested data array element in the specified bank from the given float.
virtual jdouble getElemDouble (jint i, jint bank=0) const
 Returns the requested data array element from the specified bank as a double.
virtual void setElemDouble (jint i, jdouble val, jint bank=0)
 Sets the requested data array element in the specified bank from the given double.

Static Public Member Functions

static jint getDataTypeSize (jint type)
 Returns the size (in bits) of the data type, given a datatype tag.

Protected Member Functions

 DataBuffer (jint dataType, jint size, jint numBank=1, jint offset=0)
 Constructs a DataBuffer that contains the specified number of banks.
 DataBuffer (jint dataType, jint size, jint numBank, const Array< jint > &offsets)
 Constructs a DataBuffer which contains the specified number of banks.

Protected Attributes

jint dataType
 The data type of this DataBuffer.
jint size
 Usable size of all banks.
jint banks
 The number of banks in this DataBuffer.
Array< jintoffsets
 Offsets into all banks.
 REGISTER_MEMBERS


Member Enumeration Documentation

enum java::awt::image::DataBuffer::DATA_BUFFER_TYPE

Enumerator:
TYPE_BYTE  Tag for signed short data.

TYPE_SHORT  Tag for signed short data.

TYPE_INT  Tag for int data.

TYPE_FLOAT  Tag for float data.

Placeholder for future use.

TYPE_DOUBLE  Tag for double data.

Placeholder for future use.

TYPE_UNDEFINED  Tag for undefined data.


Constructor & Destructor Documentation

java::awt::image::DataBuffer::DataBuffer ( jint  dataType,
jint  size,
jint  numBank = 1,
jint  offset = 0 
) [protected]

Constructs a DataBuffer that contains the specified number of banks.

Each bank has the specified datatype, size and offset.

Parameters:
dataType the data type of this DataBuffer
size the size of the banks
numBanks the number of banks in this DataBuffer
offset the offset for each bank

java::awt::image::DataBuffer::DataBuffer ( jint  dataType,
jint  size,
jint  numBank,
const Array< jint > &  offsets 
) [protected]

Constructs a DataBuffer which contains the specified number of banks.

Each bank has the specified datatype and size. The offset for each bank is specified by its respective entry in the offsets array.

Parameters:
dataType the data type of this DataBuffer
size the size of the banks
numBanks the number of banks in this DataBuffer
offsets an array containing an offset for each bank.
Exceptions:
ArrayIndexOutOfBoundsException if numBanks does not equal the length of offsets


Member Function Documentation

static jint java::awt::image::DataBuffer::getDataTypeSize ( jint  type  )  [static]

Returns the size (in bits) of the data type, given a datatype tag.

Parameters:
type the value of one of the defined datatype tags
Returns:
the size of the data type
Exceptions:
IllegalArgumentException if type is less than zero or greater than TYPE_DOUBLE

virtual jint java::awt::image::DataBuffer::getDataType (  )  const [virtual]

Returns the data type of this DataBuffer.

Returns:
the data type of this DataBuffer.

virtual jint java::awt::image::DataBuffer::getSize (  )  const [virtual]

Returns the size (in array elements) of all banks.

Returns:
the size of all banks.

virtual jint java::awt::image::DataBuffer::getNumBanks (  )  const [virtual]

Returns the number of banks in this DataBuffer.

Returns:
the number of banks.

virtual jint java::awt::image::DataBuffer::getOffset ( jint  bank = 0  )  const [virtual]

Returns the offset of the default bank in array elements.

Parameters:
bank the specified bank, default = 0
Returns:
the offset of the default bank.

virtual const Array<jint>& java::awt::image::DataBuffer::getOffsets (  )  const [virtual]

Returns the offsets (in array elements) of all the banks.

Returns:
the offsets of all banks.

virtual jint java::awt::image::DataBuffer::getElem ( jint  i,
jint  bank = 0 
) const [pure virtual]

Returns the requested data array element from the specified bank as an integer.

Parameters:
i the index of the requested data array element
bank the specified bank, default = 0
Returns:
the data array element at the specified index from the specified bank at the specified index.
See also:
setElem(int, int)

setElem(int, int, int)

Implemented in java::awt::image::DataBufferByte, java::awt::image::DataBufferInt, and java::awt::image::DataBufferShort.

virtual void java::awt::image::DataBuffer::setElem ( jint  i,
jint  val,
jint  bank = 0 
) [pure virtual]

Sets the requested data array element in the specified bank from the given integer.

Parameters:
i the specified index into the data array
val the data to set the element in the specified bank
bank the specified bank at the specified index in the data array
See also:
getElem(int)

getElem(int, int)

Implemented in java::awt::image::DataBufferByte, java::awt::image::DataBufferInt, and java::awt::image::DataBufferShort.

virtual jfloat java::awt::image::DataBuffer::getElemFloat ( jint  i,
jint  bank = 0 
) const [virtual]

Returns the requested data array element from the specified bank as a float.

The implementation in this class is to cast getElem(int, int) to a float. Subclasses can override this method if another implementation is needed.

Parameters:
i the index of the requested data array element
bank the specified bank
Returns:
a float value representing the data array element from the specified bank at the specified index.
See also:
setElemFloat(int, float)

setElemFloat(int, int, float)

virtual void java::awt::image::DataBuffer::setElemFloat ( jint  i,
jfloat  val,
jint  bank = 0 
) [virtual]

Sets the requested data array element in the specified bank from the given float.

The implementation in this class is to cast val to an int and call setElem(int, int). Subclasses can override this method if another implementation is needed.

Parameters:
i the specified index
val the value to set the element in the specified bank at
bank the specified bank the specified index in the data array
See also:
getElemFloat(int)

getElemFloat(int, int)

virtual jdouble java::awt::image::DataBuffer::getElemDouble ( jint  i,
jint  bank = 0 
) const [virtual]

Returns the requested data array element from the specified bank as a double.

The implementation in this class is to cast getElem(bank, i) to a double. Subclasses may override this method if another implementation is needed.

Parameters:
i the specified index
bank the specified bank
Returns:
a double value representing the element from the specified bank at the specified index in the data array.
See also:
setElemDouble(int, double)

setElemDouble(int, int, double)

virtual void java::awt::image::DataBuffer::setElemDouble ( jint  i,
jdouble  val,
jint  bank = 0 
) [virtual]

Sets the requested data array element in the specified bank from the given double.

The implementation in this class is to cast val to an int and call setElem(int, int). Subclasses can override this method if another implementation is needed.

Parameters:
i the specified index
val the value to set the element in the specified bank
bank the specified bank at the specified index of the data array
See also:
getElemDouble(int)

getElemDouble(int, int)


Member Data Documentation

jint java::awt::image::DataBuffer::dataType [protected]

The data type of this DataBuffer.

jint java::awt::image::DataBuffer::size [protected]

Usable size of all banks.

jint java::awt::image::DataBuffer::banks [protected]

The number of banks in this DataBuffer.

Array<jint> java::awt::image::DataBuffer::offsets [protected]

Offsets into all banks.

java::awt::image::DataBuffer::REGISTER_MEMBERS [protected]

Reimplemented from java::lang::Object.

Reimplemented in java::awt::image::DataBufferByte, java::awt::image::DataBufferInt, and java::awt::image::DataBufferShort.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:22 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3