![]() |
CamSim
0.0.0
A rasterization-based simulator for various types of cameras
|
Provides convenient access to data stored in a texture. More...
Public Member Functions | |
| TexData () | |
| Constructor. More... | |
| TexData (int w, int h, int channels, int type, const QByteArray &packedData, const QList< QString > &names=QList< QString >()) | |
| Constructor for data given in main memory instead of texture memory. More... | |
| TexData (unsigned int tex, int cubeSide, int arrayLayer, int retrievalFormat, const QList< QString > &names=QList< QString >(), unsigned int pbo=0) | |
| Constructor for texture tex. Its data is retrieved immediately so that the OpenGL texture handle can be reused or deleted. See setTexture() for details. More... | |
| void | setTexture (unsigned int tex, int cubeSide, int arrayLayer, int retrievalFormat, const QList< QString > &names=QList< QString >(), unsigned int pbo=0) |
| Set the texture tex to use. Its data is retrieved immediately so that the OpenGL texture handle can be reused or deleted. More... | |
| int | width () const |
| Returns the texture width. More... | |
| int | height () const |
| Returns the texture height. More... | |
| int | channels () const |
| Returns the number of channels in the texture. More... | |
| const QString & | channelName (int channel) const |
| Returns the name of the given channel (may be empty) More... | |
| int | type () const |
| Returns the data type (depends on the retrieval format with which this object was created). Currently GL_UNSIGNED_BYTE, GL_UNSIGNED_INT, or GL_FLOAT. More... | |
| size_t | typeSize () const |
| Returns the size of the data type. More... | |
| size_t | packedElementSize () const |
| Returns the size of one packed texture element (consisting of one or more components, depending on the channels (see packedData) More... | |
| size_t | packedLineSize () const |
| Returns the size of one line of packed data (see packedData) More... | |
| size_t | packedDataSize () const |
| Returns the size of the packed data (see packedData) More... | |
| const void * | packedData () const |
| Return a pointer to the packed data. More... | |
| const void * | element (int x, int y, int c=0) const |
| Return a pointer to the data element with coordinates x and y and the channel number c. More... | |
| size_t | planarElementSize () const |
| Returns the size of one planar texture element (consisting of only one components). This is the same as typeSize(). See planarData. More... | |
| size_t | planarLineSize () const |
| Returns the size of one line of planar data (see planarData) More... | |
| size_t | planarColumnSize () const |
| Returns the size of one column of planar data (see planarData) More... | |
| size_t | planarDataSize () const |
| Returns the size of the planar data (see planarData) More... | |
| QByteArray | planarDataArray (int channel) const |
| Return the planar data for the given channel as a byte array. More... | |
| QByteArray | transposedPlanarDataArray (int channel) const |
| Return the transposed planar data for the given channel as a byte array. More... | |
Provides convenient access to data stored in a texture.
| CamSim::TexData::TexData | ( | ) |
Constructor.
| CamSim::TexData::TexData | ( | int | w, |
| int | h, | ||
| int | channels, | ||
| int | type, | ||
| const QByteArray & | packedData, | ||
| const QList< QString > & | names = QList< QString >() |
||
| ) |
Constructor for data given in main memory instead of texture memory.
| CamSim::TexData::TexData | ( | unsigned int | tex, |
| int | cubeSide, | ||
| int | arrayLayer, | ||
| int | retrievalFormat, | ||
| const QList< QString > & | names = QList< QString >(), |
||
| unsigned int | pbo = 0 |
||
| ) |
Constructor for texture tex. Its data is retrieved immediately so that the OpenGL texture handle can be reused or deleted. See setTexture() for details.
|
inline |
Returns the name of the given channel (may be empty)
|
inline |
Returns the number of channels in the texture.
|
inline |
Return a pointer to the data element with coordinates x and y and the channel number c.
|
inline |
Returns the texture height.
|
inline |
Return a pointer to the packed data.
Packed means that for every texture element all channels are stored together (in planar format, they are separated).
|
inline |
Returns the size of the packed data (see packedData)
|
inline |
Returns the size of one packed texture element (consisting of one or more components, depending on the channels (see packedData)
|
inline |
Returns the size of one line of packed data (see packedData)
|
inline |
Returns the size of one column of planar data (see planarData)
| QByteArray CamSim::TexData::planarDataArray | ( | int | channel | ) | const |
Return the planar data for the given channel as a byte array.
Planar means that the data contains only the given channel.
|
inline |
Returns the size of the planar data (see planarData)
|
inline |
Returns the size of one planar texture element (consisting of only one components). This is the same as typeSize(). See planarData.
|
inline |
Returns the size of one line of planar data (see planarData)
| void CamSim::TexData::setTexture | ( | unsigned int | tex, |
| int | cubeSide, | ||
| int | arrayLayer, | ||
| int | retrievalFormat, | ||
| const QList< QString > & | names = QList< QString >(), |
||
| unsigned int | pbo = 0 |
||
| ) |
Set the texture tex to use. Its data is retrieved immediately so that the OpenGL texture handle can be reused or deleted.
If cubeSide is greater than or equal to zero, then tex is assumed to be a cube map and the specified cube side is used. Otherwise (cubeSide is less than zero), tex is assumed to be a standard 2D texture.
If arrayLayer is greater than or equal to zero, then tex is assumed to be an array texture and the specified layer is used. Otherwise (arrayLayer is less than zero), tex is assumed to be a standard 2D texture.
Retrieval of data is done in the format suggested by retrievalFormat, which can be one of GL_R8, GL_RG8 GL_RGB8, GL_RGBA8, GL_R32F, GL_RG32F, GL_RGB32F, GL_RGBA32F, GL_R32UI, GL_RG32UI, GL_RGB32UI, GL_RGBA32UI.
Optionally each channel in the texture can be assigned a name. This will be used by the Exporter class, depending on the file format. For example, for Matlab *.mat files, the name will be used as the corresponding variable name.
Optionally a pixel buffer object (pbo) is used to transfer the data, for potentially better performance.
| QByteArray CamSim::TexData::transposedPlanarDataArray | ( | int | channel | ) | const |
Return the transposed planar data for the given channel as a byte array.
Planar means that the data contains only the given channel.
|
inline |
Returns the data type (depends on the retrieval format with which this object was created). Currently GL_UNSIGNED_BYTE, GL_UNSIGNED_INT, or GL_FLOAT.
| size_t CamSim::TexData::typeSize | ( | ) | const |
Returns the size of the data type.
|
inline |
Returns the texture width.
1.8.16