Dynamic table allocator for GL types (run-time resolution of type). More...
#include <HdlDynamicData.hpp>
Inherited by Glip::CoreGL::HdlDynamicTableSpecial< T >.
Public Member Functions | |
const GLenum & | getGLType (void) const |
Get the type of the current data as the GL identifier. More... | |
bool | isFloatingPointType (void) const |
Test if the data is floatting point. More... | |
bool | isIntegerType (void) const |
Test if the data is integer. More... | |
const int & | getNumRows (void) const |
Get the number of rows of the data. More... | |
const int & | getNumColumns (void) const |
Get the number of columns of the data. More... | |
const int & | getNumSlices (void) const |
Get the number of slices of the data. More... | |
int | getNumElements (void) const |
Get the number of elements of the table (rows times columns times slices). More... | |
const int & | getAlignment (void) const |
Get the data alignment. More... | |
virtual size_t | getElementSize (void) const =0 |
Get the size of one element, in bytes. More... | |
size_t | getSliceSize (void) const |
Get the size of one slice, in bytes. More... | |
size_t | getRowSize (void) const |
Get the size of one row, in bytes. More... | |
size_t | getSize (void) const |
Get the size of whole table, in bytes. More... | |
bool | isProxy (void) const |
Test if the table is actually a proxy. More... | |
bool | isNormalized (void) const |
Test if the table is normalized. More... | |
bool | isInside (const int &j, const int &i, const int &d) const |
Test if the coordinates are for a valid element inside the table. More... | |
int | getIndex (const int &j, const int &i, const int &d) const |
Get the linear index corresponding to these coordinates. More... | |
size_t | getOffset (const int &j, const int &i, const int &d) const |
Get the distance in memory, from the beginning of the table to the targeted element. More... | |
size_t | getRowOffset (const int &i) const |
Get the offset for the beginning of a row. More... | |
virtual float | getf (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get the value at coordinates (j, i, d) casted to float. More... | |
virtual void | setf (const float &value, const int &j=0, const int &i=0, const int &d=0)=0 |
Set the value at coordinates (j, i, d) from a float value. More... | |
virtual double | getd (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get the value at coordinates (j, i, d) casted to double. More... | |
virtual void | setd (const double &value, const int &j=0, const int &i=0, const int &d=0)=0 |
Set the value at coordinates (j, i, d) from a double value. More... | |
virtual long long | getl (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get the value at coordinates (j, i, d) casted to long long. More... | |
virtual void | setl (const long long &value, const int &j=0, const int &i=0, const int &d=0)=0 |
Set the value at coordinates (j, i, d) from an integer value. More... | |
virtual int | geti (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get the value at coordinates (j, i, d) casted to int. More... | |
virtual void | seti (const int &value, const int &j=0, const int &i=0, const int &d=0)=0 |
Set the value at coordinates (j, i, d) from an integer value. More... | |
virtual unsigned char | getb (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get the value at coordinates (j, i, d) casted to unsigned char. More... | |
virtual void | setb (const unsigned char &value, const int &j=0, const int &i=0, const int &d=0)=0 |
Set the value at coordinates (j, i, d) from an unsigned char value. More... | |
virtual float | getNormalized (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get the value at coordinates (j, i, d) in a normalized range. More... | |
virtual void | setNormalized (const float &value, const int &j=0, const int &i=0, const int &d=0)=0 |
Set the value at coordinates (j, i, d) from a normalized value. More... | |
virtual void * | get (const int &j=0, const int &i=0, const int &d=0) const =0 |
Get direct pointer to the data. More... | |
virtual void | set (void *value, const int &j=0, const int &i=0, const int &d=0) const =0 |
Set data, assuming the same underlying type. More... | |
virtual float | readf (size_t offset) const =0 |
Reading a floatting point value from the given position. More... | |
virtual void | writef (const float &value, size_t offset)=0 |
Write a floatting point value at the given position. More... | |
virtual double | readd (size_t offset) const =0 |
Reading a floatting point value from the given position. More... | |
virtual void | writed (const double &value, size_t offset)=0 |
Write a floatting point value at the given position. More... | |
virtual long long | readl (size_t offset) const =0 |
Reading an integer value from the given position. More... | |
virtual void | writel (const long long &value, size_t offset)=0 |
Write an integer value at the given position. More... | |
virtual int | readi (size_t offset) const =0 |
Reading an integer value from the given position. More... | |
virtual void | writei (const int &value, size_t offset)=0 |
Write an integer value at the given position. More... | |
virtual unsigned char | readb (size_t offset) const =0 |
Reading an integer value from the given position. More... | |
virtual void | writeb (const unsigned char &value, size_t offset)=0 |
Write an integer value at the given position. More... | |
virtual float | readNormalized (size_t offset) const =0 |
Reading an integer value from the given position. More... | |
virtual void | writeNormalized (const float &value, size_t offset)=0 |
Write a normalized value at the given position. More... | |
virtual void | write (const void *value, size_t offset)=0 |
Write a shapeless value at the given position (presumed within the table and of the same type). More... | |
void | writeBytes (const void *value, size_t length, size_t offset) |
Write a shapeless value array at the given position. More... | |
virtual const void * | getPtr (void) const =0 |
Get the pointer to the data (const). More... | |
virtual void * | getPtr (void)=0 |
Get the pointer to the data. More... | |
virtual const void * | getRowPtr (int i) const =0 |
Get the pointer to the begin of the targeted row (const). More... | |
virtual void * | getRowPtr (int i)=0 |
Get the pointer to the begin of the targeted row. More... | |
virtual const HdlDynamicTable & | operator= (const HdlDynamicTable &cpy)=0 |
Copy the value from another HdlDynamicData object. Type MUST match, will raise an exception otherwise. More... | |
void | memset (unsigned char c) |
Clear the array. More... | |
Static Public Member Functions | |
static HdlDynamicTable * | build (const GLenum &type, const int &_columns, const int &_rows, const int &_slices, bool _normalized=false, int _alignment=1) |
Build dynamic data from a GL data identifier (see supported types in main description of HdlDynamicData). More... | |
static HdlDynamicTable * | buildProxy (void *buffer, const GLenum &type, const int &_columns, const int &_rows, const int &_slices, bool _normalized=false, int _alignment=1) |
Build dynamic data proxy from a GL data identifier and a buffer pointer (see supported types in main description of HdlDynamicData). More... | |
static HdlDynamicTable * | copy (const HdlDynamicTable &cpy) |
Copy dynamic data. More... | |
Dynamic table allocator for GL types (run-time resolution of type).
Supported types : GL_BOOL, GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_DOUBLE. The indexing is row major and the slices are interleaved ("RGBRGBRGB..." image-like). Most of the accessors do NOT perform tests on coordinate validity.
Example :
|
static |
Build dynamic data from a GL data identifier (see supported types in main description of HdlDynamicData).
type | The required GL type. |
_columns | The number of columns of the table. |
_rows | The number of rows of the table. |
_slices | The number of slices of the table. |
_normalized | True if the data is normalized. |
_alignment | Data alignment (per row, should be either 1, 4, or 8). |
|
static |
Build dynamic data proxy from a GL data identifier and a buffer pointer (see supported types in main description of HdlDynamicData).
buffer | The original data (will not be deleted, the user must guarantee that this object is destroyed when the original data is). |
type | The required GL type. |
_columns | The number of columns of the table. |
_rows | The number of rows of the table. |
_slices | The number of slices of the table. |
_normalized | True if the data is normalized. |
_alignment | Data alignment (per row, should be either 1, 4, or 8). |
|
static |
Copy dynamic data.
cpy | The original element to be copied. |
|
pure virtual |
Get direct pointer to the data.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
const int & HdlDynamicTable::getAlignment | ( | void | ) | const |
Get the data alignment.
|
pure virtual |
Get the value at coordinates (j, i, d) casted to unsigned char.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Get the value at coordinates (j, i, d) casted to double.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Get the size of one element, in bytes.
|
pure virtual |
Get the value at coordinates (j, i, d) casted to float.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
const GLenum & HdlDynamicTable::getGLType | ( | void | ) | const |
Get the type of the current data as the GL identifier.
|
pure virtual |
Get the value at coordinates (j, i, d) casted to int.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
int HdlDynamicTable::getIndex | ( | const int & | i, |
const int & | j, | ||
const int & | d | ||
) | const |
Get the linear index corresponding to these coordinates.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Get the value at coordinates (j, i, d) casted to long long.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Get the value at coordinates (j, i, d) in a normalized range.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
const int & HdlDynamicTable::getNumColumns | ( | void | ) | const |
Get the number of columns of the data.
int HdlDynamicTable::getNumElements | ( | void | ) | const |
Get the number of elements of the table (rows times columns times slices).
const int & HdlDynamicTable::getNumRows | ( | void | ) | const |
Get the number of rows of the data.
const int & HdlDynamicTable::getNumSlices | ( | void | ) | const |
Get the number of slices of the data.
size_t HdlDynamicTable::getOffset | ( | const int & | j, |
const int & | i, | ||
const int & | d | ||
) | const |
Get the distance in memory, from the beginning of the table to the targeted element.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Get the pointer to the data (const).
|
pure virtual |
Get the pointer to the data.
size_t HdlDynamicTable::getRowOffset | ( | const int & | i | ) | const |
Get the offset for the beginning of a row.
i | The index of the row. |
|
pure virtual |
Get the pointer to the begin of the targeted row (const).
i | The row index. |
|
pure virtual |
Get the pointer to the begin of the targeted row.
i | The row index. |
size_t HdlDynamicTable::getRowSize | ( | void | ) | const |
Get the size of one row, in bytes.
size_t HdlDynamicTable::getSize | ( | void | ) | const |
Get the size of whole table, in bytes.
size_t HdlDynamicTable::getSliceSize | ( | void | ) | const |
Get the size of one slice, in bytes.
bool HdlDynamicTable::isFloatingPointType | ( | void | ) | const |
Test if the data is floatting point.
Test if the data is unsigned.
Test if the data is boolean.
bool HdlDynamicTable::isInside | ( | const int & | i, |
const int & | j, | ||
const int & | d | ||
) | const |
Test if the coordinates are for a valid element inside the table.
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
bool HdlDynamicTable::isIntegerType | ( | void | ) | const |
Test if the data is integer.
bool HdlDynamicTable::isNormalized | ( | void | ) | const |
Test if the table is normalized.
bool HdlDynamicTable::isProxy | ( | void | ) | const |
Test if the table is actually a proxy.
void HdlDynamicTable::memset | ( | unsigned char | c | ) |
Clear the array.
c | Character to be used to clear the array. |
|
pure virtual |
Copy the value from another HdlDynamicData object. Type MUST match, will raise an exception otherwise.
cpy | The object to be copied. |
|
pure virtual |
Reading an integer value from the given position.
offset | Offset in the table. |
|
pure virtual |
Reading a floatting point value from the given position.
offset | Offset in the table. |
|
pure virtual |
Reading a floatting point value from the given position.
offset | Offset in the table. |
|
pure virtual |
Reading an integer value from the given position.
offset | Offset in the table. |
|
pure virtual |
Reading an integer value from the given position.
offset | Offset in the table. |
|
pure virtual |
Reading an integer value from the given position.
offset | Offset in the table. |
|
pure virtual |
Set data, assuming the same underlying type.
value | The new value (assumed to be of the same type). |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Set the value at coordinates (j, i, d) from an unsigned char value.
value | The new value. |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Set the value at coordinates (j, i, d) from a double value.
value | The new value. |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Set the value at coordinates (j, i, d) from a float value.
value | The new value. |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Set the value at coordinates (j, i, d) from an integer value.
value | The new value. |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Set the value at coordinates (j, i, d) from an integer value.
value | The new value. |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Set the value at coordinates (j, i, d) from a normalized value.
value | The new value. |
j | The index of the column. |
i | The index of the row. |
d | The index of the slice. |
|
pure virtual |
Write a shapeless value at the given position (presumed within the table and of the same type).
value | Shapeless value (of the same type as for the table). |
offset | Offset in the table. |
|
pure virtual |
Write an integer value at the given position.
value | Integer value to write. |
offset | Offset in the table. |
void HdlDynamicTable::writeBytes | ( | const void * | value, |
size_t | length, | ||
size_t | offset | ||
) |
Write a shapeless value array at the given position.
value | Shapeless value. |
length | The amount of data to write (in bytes). |
offset | Offset in the table. |
|
pure virtual |
Write a floatting point value at the given position.
value | Floatting point value to write. |
offset | Offset in the table. |
|
pure virtual |
Write a floatting point value at the given position.
value | Floatting point value to write. |
offset | Offset in the table. |
|
pure virtual |
Write an integer value at the given position.
value | Integer value to write. |
offset | Offset in the table. |
|
pure virtual |
Write an integer value at the given position.
value | Integer value to write. |
offset | Offset in the table. |
|
pure virtual |
Write a normalized value at the given position.
value | Normalized value to write. |
offset | Offset in the table. |