Beatmup
|
Real-valued matrix usable by GPU. More...
Public Member Functions | |
Matrix (GraphicPipeline &gpu, int width, int height, const bool floatingPoint) | |
Matrix (GraphicPipeline &gpu, int width, int height, const float *values, const bool floatingPoint) | |
Creates a matrix in GPU memory. More... | |
void | bind (GraphicPipeline &gpu, int textureUnit) const |
int | getMatrixWidth () const |
int | getMatrixHeight () const |
float | getScale () const |
float | getOffset () const |
const int | getWidth () const |
Width of the texture in pixels. More... | |
const int | getHeight () const |
Height of the texture in pixels. More... | |
const int | getDepth () const |
Depth of the texture in pixels. More... | |
const TextureFormat | getTextureFormat () const |
Returns the texture format specifying how the shader must interpret the data. More... | |
Public Member Functions inherited from Beatmup::GL::TextureHandler | |
~TextureHandler () | |
float | getAspectRatio () const |
Aspect ratio of the texture. More... | |
float | getInvAspectRatio () const |
Inverse of the aspect ratio of the texture. More... | |
const bool | isFloatingPoint () const |
const int | getNumberOfChannels () const |
Returns number of channels containing in the texture. More... | |
bool | hasValidHandle () const |
Returns true if the texture handle points to a valid texture. More... | |
Public Member Functions inherited from Beatmup::Object | |
virtual | ~Object () |
Private Member Functions | |
void | prepare (GraphicPipeline &gpu, bool) |
Private Attributes | |
const TextureFormat | format |
const int | texWidth |
const int | texHeight |
texture size More... | |
const int | width |
const int | height |
matrix size More... | |
float | mapScale |
scaling applied to the matrix coefficients to optimize the fixed-point range use More... | |
float | mapOffset |
offset applied to the matrix coefficients after scaling to optimize the fixed-point range use More... | |
Friends | |
class | LinearMapping |
Additional Inherited Members | |
Public Types inherited from Beatmup::GL::TextureHandler | |
enum | TextureFormat { Rx8 , RGBx8 , RGBAx8 , Rx32f , RGBx32f , RGBAx32f , OES_Ext } |
Texture format, specifies how the texture should be interpreted on the shader side. More... | |
Static Public Member Functions inherited from Beatmup::GL::TextureHandler | |
static const char * | textureFormatToString (const TextureFormat &) |
Static Public Attributes inherited from Beatmup::GL::TextureHandler | |
static const int | TEXTURE_FORMAT_BYTES_PER_PIXEL [] |
size of a texel in bytes for different texture formats More... | |
Protected Member Functions inherited from Beatmup::GL::TextureHandler | |
TextureHandler () | |
virtual void | prepare (GraphicPipeline &gpu) |
Prepares (eventually uploads) texture data on GPU. More... | |
void | invalidate (RecycleBin &) |
Forces disposing the texture data, e.g. More... | |
Protected Attributes inherited from Beatmup::GL::TextureHandler | |
handle_t | textureHandle |
Real-valued matrix usable by GPU.
Definition at line 163 of file linear_mapping.cpp.
Beatmup::GL::LinearMapping::Matrix::Matrix | ( | GraphicPipeline & | gpu, |
int | width, | ||
int | height, | ||
const bool | floatingPoint | ||
) |
Definition at line 212 of file linear_mapping.cpp.
Beatmup::GL::LinearMapping::Matrix::Matrix | ( | GraphicPipeline & | gpu, |
int | width, | ||
int | height, | ||
const float * | values, | ||
const bool | floatingPoint | ||
) |
Creates a matrix in GPU memory.
The memory layout depends on the data format. For floating point data four consecutive rows are packed into color channels. The first texture row looks like this ("x,y" for "col,row" in the input matrix): r 0,0 1,0 2,0 3,0 4,0 ... g 0,1 1,1 2,1 3,1 4,1 ... b 0,2 1,2 2,2 3,2 4,2 ... a 0,3 1,3 2,3 3,3 4,3 ... In 16-bit fixed point case, two consecutive columns are packed into color channels, alternating the least and most significant bytes: r 0,0L 0,0M 0,1L 0,1M ... g 1,0L 1,0M 1,1L 1,1M ... b 2,0L 2,0M 2,1L 2,1M ... a 3,0L 3,0M 3,1L 3,1M ...
[in] | gpu | A graphic pipeline instance |
[in] | width | Matrix width (number of columns) |
[in] | height | Matrix height (number of rows) |
[in] | values | Matrix coefficients in scanline order (rows) |
[in] | floatingPoint | If true , the matrix coefficients are stored in floating point format (16-bit fixed point otherwise). |
Definition at line 258 of file linear_mapping.cpp.
|
private |
Definition at line 347 of file linear_mapping.cpp.
void Beatmup::GL::LinearMapping::Matrix::bind | ( | GraphicPipeline & | gpu, |
int | textureUnit | ||
) | const |
Definition at line 352 of file linear_mapping.cpp.
|
inline |
Definition at line 200 of file linear_mapping.cpp.
|
inline |
Definition at line 201 of file linear_mapping.cpp.
|
inline |
Definition at line 202 of file linear_mapping.cpp.
|
inline |
Definition at line 203 of file linear_mapping.cpp.
|
inlinevirtual |
Width of the texture in pixels.
Implements Beatmup::GL::TextureHandler.
Definition at line 205 of file linear_mapping.cpp.
|
inlinevirtual |
Height of the texture in pixels.
Implements Beatmup::GL::TextureHandler.
Definition at line 206 of file linear_mapping.cpp.
|
inlinevirtual |
Depth of the texture in pixels.
Implements Beatmup::GL::TextureHandler.
Definition at line 207 of file linear_mapping.cpp.
|
inlinevirtual |
Returns the texture format specifying how the shader must interpret the data.
Implements Beatmup::GL::TextureHandler.
Definition at line 208 of file linear_mapping.cpp.
|
friend |
Definition at line 164 of file linear_mapping.cpp.
|
private |
Definition at line 166 of file linear_mapping.cpp.
|
private |
Definition at line 167 of file linear_mapping.cpp.
|
private |
texture size
Definition at line 167 of file linear_mapping.cpp.
|
private |
Definition at line 168 of file linear_mapping.cpp.
|
private |
matrix size
Definition at line 168 of file linear_mapping.cpp.
|
private |
scaling applied to the matrix coefficients to optimize the fixed-point range use
Definition at line 169 of file linear_mapping.cpp.
|
private |
offset applied to the matrix coefficients after scaling to optimize the fixed-point range use
Definition at line 170 of file linear_mapping.cpp.