bioformats
5.1.2
|
2D flat (solid fill) shader program. More...
#include <ome/qtwidgets/glsl/v110/GLFlatShader2D.h>
Public Member Functions | |
GLFlatShader2D (QObject *parent=0) | |
Constructor. More... | |
~GLFlatShader2D () | |
Destructor. | |
void | enableCoords () |
Enable vertex coordinates. More... | |
void | disableCoords () |
Enable vertex coordinates. More... | |
void | setCoords (const GLfloat *offset, int tupleSize, int stride=0) |
Set vertex coordinates from array. More... | |
void | setCoords (QOpenGLBuffer &coords, const GLfloat *offset, int tupleSize, int stride=0) |
Set vertex coordinates from buffer object. More... | |
void | setColour (const glm::vec4 &colour) |
Set fill colour. More... | |
void | setOffset (const glm::vec2 &offset) |
Set xy offset in model space. More... | |
void | setModelViewProjection (const glm::mat4 &mvp) |
Set model view projection matrix. More... | |
Private Attributes | |
QOpenGLShader * | vshader |
The vertex shader. More... | |
QOpenGLShader * | fshader |
The fragment shader. More... | |
int | attr_coords |
Vertex coordinates attribute. More... | |
int | uniform_colour |
Fill colour uniform. | |
int | uniform_offset |
Model offset uniform. | |
int | uniform_mvp |
Model view projection uniform. More... | |
2D flat (solid fill) shader program.
|
explicit |
Constructor.
parent | the parent of this object. |
References attr_coords, fshader, uniform_colour, uniform_mvp, uniform_offset, and vshader.
void ome::qtwidgets::glsl::v110::GLFlatShader2D::disableCoords | ( | ) |
Enable vertex coordinates.
References attr_coords.
Referenced by ome::qtwidgets::gl::v20::Axis2D::render().
void ome::qtwidgets::glsl::v110::GLFlatShader2D::enableCoords | ( | ) |
Enable vertex coordinates.
References attr_coords.
Referenced by ome::qtwidgets::gl::v20::Axis2D::render().
void ome::qtwidgets::glsl::v110::GLFlatShader2D::setColour | ( | const glm::vec4 & | colour | ) |
Set fill colour.
colour | the RGBA fill colour. |
References uniform_colour.
Referenced by ome::qtwidgets::gl::v20::Axis2D::render().
void ome::qtwidgets::glsl::v110::GLFlatShader2D::setCoords | ( | const GLfloat * | offset, |
int | tupleSize, | ||
int | stride = 0 |
||
) |
Set vertex coordinates from array.
offset | data offset if using a buffer object otherwise the coordinate values. |
tupleSize | the tuple size of the data. |
stride | the stride of the data. |
References attr_coords.
Referenced by ome::qtwidgets::gl::v20::Axis2D::render(), and setCoords().
void ome::qtwidgets::glsl::v110::GLFlatShader2D::setCoords | ( | QOpenGLBuffer & | coords, |
const GLfloat * | offset, | ||
int | tupleSize, | ||
int | stride = 0 |
||
) |
Set vertex coordinates from buffer object.
coords | the coordinate values; null if using a buffer object. |
offset | the offset into the coords buffer. |
tupleSize | the tuple size of the data. |
stride | the stride of the data. |
References setCoords().
void ome::qtwidgets::glsl::v110::GLFlatShader2D::setModelViewProjection | ( | const glm::mat4 & | mvp | ) |
Set model view projection matrix.
mvp | the model view projection matrix. |
References uniform_mvp.
Referenced by ome::qtwidgets::gl::v20::Axis2D::render().
void ome::qtwidgets::glsl::v110::GLFlatShader2D::setOffset | ( | const glm::vec2 & | offset | ) |
Set xy offset in model space.
offset | the offset to apply to the model. |
References uniform_offset.
Referenced by ome::qtwidgets::gl::v20::Axis2D::render().
|
private |
Vertex coordinates attribute.
Referenced by disableCoords(), enableCoords(), GLFlatShader2D(), and setCoords().
|
private |
The fragment shader.
Referenced by GLFlatShader2D().
|
private |
Model view projection uniform.
Referenced by GLFlatShader2D(), and setModelViewProjection().
|
private |
The vertex shader.
Referenced by GLFlatShader2D().