bioformats  5.1.8
Public Member Functions | Private Attributes | List of all members
ome::qtwidgets::glsl::v110::GLImageShader2D Class Reference

2D image shader program (simple, up to three channels). More...

#include <ome/qtwidgets/glsl/v110/GLImageShader2D.h>

+ Inheritance diagram for ome::qtwidgets::glsl::v110::GLImageShader2D:
+ Collaboration diagram for ome::qtwidgets::glsl::v110::GLImageShader2D:

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.
 

Detailed Description

2D image shader program (simple, up to three channels).

Constructor & Destructor Documentation

ome::qtwidgets::glsl::v110::GLImageShader2D::GLImageShader2D ( QObject *  parent = 0)
explicit

Constructor.

Parameters
parentthe parent of this object.

References attr_coords, attr_texcoords, fshader, uniform_corr, uniform_lut, uniform_max, uniform_min, uniform_mvp, uniform_texture, and vshader.

Member Function Documentation

void ome::qtwidgets::glsl::v110::GLImageShader2D::setCoords ( const GLfloat *  offset = 0,
int  tupleSize = 2,
int  stride = 0 
)

Set vertex coordinates from array.

Parameters
offsetdata offset if using a buffer object otherwise the coordinate values.
tupleSizethe tuple size of the data.
stridethe stride of the data.

References attr_coords.

Referenced by ome::qtwidgets::gl::v20::Image2D::render(), and setCoords().

+ Here is the caller graph for this function:

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.

Parameters
coordsthe coordinate values; null if using a buffer object.
offsetthe offset into the coords buffer.
tupleSizethe tuple size of the data.
stridethe 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.

Parameters
corrthe RGB channel correction multipliers.

References uniform_corr.

Referenced by ome::qtwidgets::gl::v20::Image2D::render().

+ Here is the caller graph for this function:

void ome::qtwidgets::glsl::v110::GLImageShader2D::setLUT ( int  texunit)

Set the LUT to use.

Parameters
texunitthe texture unit to use.

References uniform_lut.

Referenced by ome::qtwidgets::gl::v20::Image2D::render().

+ Here is the caller graph for this function:

void ome::qtwidgets::glsl::v110::GLImageShader2D::setMax ( const glm::vec3 &  max)

Set maximum limits for linear contrast.

Parameters
maxthe RGB channel limits.

References uniform_max.

Referenced by ome::qtwidgets::gl::v20::Image2D::render().

+ Here is the caller graph for this function:

void ome::qtwidgets::glsl::v110::GLImageShader2D::setMin ( const glm::vec3 &  min)

Set minimum limits for linear contrast.

Parameters
minthe RGB channel limits.

References uniform_min.

Referenced by ome::qtwidgets::gl::v20::Image2D::render().

+ Here is the caller graph for this function:

void ome::qtwidgets::glsl::v110::GLImageShader2D::setModelViewProjection ( const glm::mat4 &  mvp)

Set model view projection matrix.

Parameters
mvpthe model view projection matrix.

References uniform_mvp.

Referenced by ome::qtwidgets::gl::v20::Image2D::render().

+ Here is the caller graph for this function:

void ome::qtwidgets::glsl::v110::GLImageShader2D::setTexCoords ( const GLfloat *  offset = 0,
int  tupleSize = 2,
int  stride = 0 
)

Set texture coordinates from array.

Parameters
offsetdata offset if using a buffer object otherwise the coordinate values.
tupleSizethe tuple size of the data.
stridethe stride of the data.

References attr_texcoords.

Referenced by ome::qtwidgets::gl::v20::Image2D::render(), and setTexCoords().

+ Here is the caller graph for this function:

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.

Parameters
coordsthe coordinate values; null if using a buffer object.
offsetthe offset into the coords buffer.
tupleSizethe tuple size of the data.
stridethe stride of the data.

References setTexCoords().

void ome::qtwidgets::glsl::v110::GLImageShader2D::setTexture ( int  texunit)

Set the texture to render.

Parameters
texunitthe texture unit to use.

References uniform_texture.

Referenced by ome::qtwidgets::gl::v20::Image2D::render().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following files: