ome-qtwidgets 5.3.2

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

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

`#include <ome/qtwidgets/glsl/v330/V330GLImageShader2D.h>`

Inheritance diagram for ome::qtwidgets::glsl::v330::GLImageShader2D:
[legend]
Collaboration diagram for ome::qtwidgets::glsl::v330::GLImageShader2D:
[legend]

## 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

## § GLImageShader2D()

ome::qtwidgets::glsl::v330::GLImageShader2D::GLImageShader2D | ( | QObject * | parent = `0` | ) |
| explicit

Constructor.

Parameters

  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.

## Member Function Documentation

## § setCoords() [1/2]

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

Set vertex coordinates from array.

Parameters

  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::v33::Image2D::render(), and setCoords().

Here is the caller graph for this function:

## § setCoords() [2/2]

void ome::qtwidgets::glsl::v330::GLImageShader2D::setCoords | ( | QOpenGLBuffer & | coords,
|  | const GLfloat * | offset = `0`,
|  | int | tupleSize = `2`,
|  | int | stride = `0`
| ) |  |

Set vertex coordinates from buffer object.

Parameters

  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().

## § setCorrection()

void ome::qtwidgets::glsl::v330::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

  corr | the RGB channel correction multipliers.

References uniform_corr.

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

Here is the caller graph for this function:

## § setLUT()

void ome::qtwidgets::glsl::v330::GLImageShader2D::setLUT | ( | int | texunit | ) |

Set the LUT to use.

Parameters

  texunit | the texture unit to use.

References uniform_lut.

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

Here is the caller graph for this function:

## § setMax()

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

Set maximum limits for linear contrast.

Parameters

  max | the RGB channel limits.

References uniform_max.

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

Here is the caller graph for this function:

## § setMin()

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

Set minimum limits for linear contrast.

Parameters

  min | the RGB channel limits.

References uniform_min.

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

Here is the caller graph for this function:

## § setModelViewProjection()

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

Set model view projection matrix.

Parameters

  mvp | the model view projection matrix.

References uniform_mvp.

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

Here is the caller graph for this function:

## § setTexCoords() [1/2]

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

Set texture coordinates from array.

Parameters

  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::v33::Image2D::render(), and setTexCoords().

Here is the caller graph for this function:

## § setTexCoords() [2/2]

void ome::qtwidgets::glsl::v330::GLImageShader2D::setTexCoords | ( | QOpenGLBuffer & | coords,
|  | const GLfloat * | offset = `0`,
|  | int | tupleSize = `2`,
|  | int | stride = `0`
| ) |  |

Set texture coordinates from buffer object.

Parameters

  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().

## § setTexture()

void ome::qtwidgets::glsl::v330::GLImageShader2D::setTexture | ( | int | texunit | ) |

Set the texture to render.

Parameters

  texunit | the texture unit to use.

References uniform_texture.

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

Here is the caller graph for this function:

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

- ome/qtwidgets/glsl/v330/V330GLImageShader2D.h
- ome/qtwidgets/glsl/v330/V330GLImageShader2D.cpp