bioformats
5.1.8
|
2D image shader program (simple, up to three channels). More...
#include <ome/qtwidgets/glsl/v110/GLImageShader2D.h>
Public Member Functions | |
GLImageShader2D (QObject *parent=0) | |
Constructor. More... | |
~GLImageShader2D () | |
Destructor. | |
void | enableCoords () |
Enable vertex coordinates. | |
void | disableCoords () |
Disable vertex coordinates. | |
void | setCoords (const GLfloat *offset=0, int tupleSize=2, int stride=0) |
Set vertex coordinates from array. More... | |
void | setCoords (QOpenGLBuffer &coords, const GLfloat *offset=0, int tupleSize=2, int stride=0) |
Set vertex coordinates from buffer object. More... | |
void | enableTexCoords () |
Enable texture coordinates. | |
void | disableTexCoords () |
Disable texture coordinates. | |
void | setTexCoords (const GLfloat *offset=0, int tupleSize=2, int stride=0) |
Set texture coordinates from array. More... | |
void | setTexCoords (QOpenGLBuffer &coords, const GLfloat *offset=0, int tupleSize=2, int stride=0) |
Set texture coordinates from buffer object. More... | |
void | setTexture (int texunit) |
Set the texture to render. More... | |
void | setMin (const glm::vec3 &min) |
Set minimum limits for linear contrast. More... | |
void | setMax (const glm::vec3 &max) |
Set maximum limits for linear contrast. More... | |
void | setCorrection (const glm::vec3 &corr) |
Set correction multipliers to normalise pixel intensity. More... | |
void | setLUT (int texunit) |
Set the LUT to use. More... | |
void | setModelViewProjection (const glm::mat4 &mvp) |
Set model view projection matrix. More... | |
Private Attributes | |
QOpenGLShader * | vshader |
The vertex shader. | |
QOpenGLShader * | fshader |
The fragment shader. | |
int | attr_coords |
Vertex coordinates attribute. | |
int | attr_texcoords |
Texture coordinates attribute. | |
int | uniform_mvp |
Model view projection uniform. | |
int | uniform_texture |
Texture uniform. | |
int | uniform_lut |
LUT uniform. | |
int | uniform_min |
Minimum limits for linear contrast uniform. | |
int | uniform_max |
Maximum limits for linear contrast uniform. | |
int | uniform_corr |
Correction multiplier for linear contrast uniform. | |
2D image shader program (simple, up to three channels).
|
explicit |
Constructor.
parent | the parent of this object. |
References attr_coords, attr_texcoords, fshader, uniform_corr, uniform_lut, uniform_max, uniform_min, uniform_mvp, uniform_texture, and vshader.
void ome::qtwidgets::glsl::v110::GLImageShader2D::setCoords | ( | const GLfloat * | offset = 0 , |
int | tupleSize = 2 , |
||
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::Image2D::render(), and setCoords().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setCoords | ( | QOpenGLBuffer & | coords, |
const GLfloat * | offset = 0 , |
||
int | tupleSize = 2 , |
||
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::GLImageShader2D::setCorrection | ( | const glm::vec3 & | corr | ) |
Set correction multipliers to normalise pixel intensity.
Use to correct the pixel value limits to the storage size limits, for example when using data with 12 bits per sample with a 16-bit storage type it will require multiplying by 2^(16-12) = 2^4 = 16. To leave uncorrected, e.g. for float and complex types, and integer types where the bits per sample is the same as the storage size, set to 1.0.
corr | the RGB channel correction multipliers. |
References uniform_corr.
Referenced by ome::qtwidgets::gl::v20::Image2D::render().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setLUT | ( | int | texunit | ) |
Set the LUT to use.
texunit | the texture unit to use. |
References uniform_lut.
Referenced by ome::qtwidgets::gl::v20::Image2D::render().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setMax | ( | const glm::vec3 & | max | ) |
Set maximum limits for linear contrast.
max | the RGB channel limits. |
References uniform_max.
Referenced by ome::qtwidgets::gl::v20::Image2D::render().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setMin | ( | const glm::vec3 & | min | ) |
Set minimum limits for linear contrast.
min | the RGB channel limits. |
References uniform_min.
Referenced by ome::qtwidgets::gl::v20::Image2D::render().
void ome::qtwidgets::glsl::v110::GLImageShader2D::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::Image2D::render().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setTexCoords | ( | const GLfloat * | offset = 0 , |
int | tupleSize = 2 , |
||
int | stride = 0 |
||
) |
Set texture 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_texcoords.
Referenced by ome::qtwidgets::gl::v20::Image2D::render(), and setTexCoords().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setTexCoords | ( | QOpenGLBuffer & | coords, |
const GLfloat * | offset = 0 , |
||
int | tupleSize = 2 , |
||
int | stride = 0 |
||
) |
Set texture 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 setTexCoords().
void ome::qtwidgets::glsl::v110::GLImageShader2D::setTexture | ( | int | texunit | ) |
Set the texture to render.
texunit | the texture unit to use. |
References uniform_texture.
Referenced by ome::qtwidgets::gl::v20::Image2D::render().