ome-qtwidgets 5.3.2

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ome::qtwidgets::gl::Image2D Class Referenceabstract

2D (xy) image renderer. More...

`#include <ome/qtwidgets/gl/Image2D.h>`

Inheritance diagram for ome::qtwidgets::gl::Image2D:
[legend]
Collaboration diagram for ome::qtwidgets::gl::Image2D:
[legend]

## Public Types
enum | RangePolicy { StorageRange, BPPRange, PlaneRange, ImageRange }
| Range of min/max adjustment for linear contrast. More...

## Public Member Functions
| Image2D (ome::compat::shared_ptr< ome::files::FormatReader > reader, ome::files::dimension_size_type series, QObject *parent=0)
| Create a 2D image. More...
virtual | ~Image2D ()=0
| Destructor.
virtual void | create ()
| Create GL buffers. More...
void | setPlane (ome::files::dimension_size_type plane)
| Set the plane to render. More...
const glm::vec3 & | getMin () const
| Get minimum limit for linear contrast. More...
void | setMin (const glm::vec3 &min)
| Set minimum limit for linear contrast. More...
const glm::vec3 & | getMax () const
| Get maximum limit for linear contrast. More...
void | setMax (const glm::vec3 &max)
| Set maximum limit for linear contrast. More...
virtual void | render (const glm::mat4 &mvp)=0
| Render the image. More...
unsigned int | texture ()
| Get texture ID. More...
unsigned int | lut ()
| Get LUT ID. More...

## Protected Member Functions
virtual void | setSize (const glm::vec2 &xlim, const glm::vec2 &ylim)
| Set the size of the x and y dimensions. More...

## Protected Attributes
QOpenGLVertexArrayObject | vertices
| The vertex array.
QOpenGLBuffer | image_vertices
| The image vertices.
QOpenGLBuffer | image_texcoords
| The image texture coordinates.
QOpenGLBuffer | image_elements
| The image elements.
unsigned int | textureid
| The identifier of the texture owned and used by this object.
unsigned int | lutid
| The identifier of the LUTs owned and used by this object.
glm::vec3 | texmin
| Linear contrast minimum limits.
glm::vec3 | texmax
| Linear contrast maximum limits.
glm::vec3 | texcorr
| Linear contrast correction multipliers.
ome::compat::shared_ptr< ome::files::FormatReader > | reader
| The image reader.
ome::files::dimension_size_type | series
| The image series.
ome::files::dimension_size_type | plane
| The current image plane.

## Detailed Description

2D (xy) image renderer.

Draws the specified image, using a user-selectable plane.

The render is greyscale with a per-channel min/max for linear contrast.

## Member Enumeration Documentation

## § RangePolicy

enum ome::qtwidgets::gl::Image2D::RangePolicy

Range of min/max adjustment for linear contrast.

Enumerator
StorageRange | Range of storage type.
BPPRange | Range of pixel type and bits per pixel.
PlaneRange | Range of samples on the current plane.
ImageRange | Range of samples in the current image.

## Constructor & Destructor Documentation

## § Image2D()

ome::qtwidgets::gl::Image2D::Image2D | ( | ome::compat::shared_ptr< ome::files::FormatReader > | reader,
|  | ome::files::dimension_size_type | series,
|  | QObject * | parent = `0`
| ) |  |
| explicit

Create a 2D image.

The size and position will be taken from the specified image.

Parameters

  reader | the image reader.
  series | the image series.
  parent | the parent of this object.

## Member Function Documentation

## § create()

void ome::qtwidgets::gl::Image2D::create | ( |  | ) |
| virtual

Create GL buffers.

Note
  Requires a valid GL context. Must be called before rendering.

References ome::files::bitsPerPixel(), ome::qtwidgets::gl::check_gl(), ome::files::FormatReader::getBitsPerPixel(), ome::files::FormatReader::getPixelType(), ome::files::FormatReader::getSeries(), ome::files::FormatReader::getSizeX(), ome::files::FormatReader::getSizeY(), lut(), lutid, ome::files::FormatReader::setSeries(), setSize(), and texcorr.

Referenced by ome::qtwidgets::GLView2D::initialize().

Here is the caller graph for this function:

## § getMax()

const glm::vec3 & ome::qtwidgets::gl::Image2D::getMax | ( |  | ) | const

Get maximum limit for linear contrast.

Returns
  the limits for three channels.

References texmax.

## § getMin()

const glm::vec3 & ome::qtwidgets::gl::Image2D::getMin | ( |  | ) | const

Get minimum limit for linear contrast.

Returns
  the limits for three channels.

References texmin.

## § lut()

unsigned int ome::qtwidgets::gl::Image2D::lut | ( |  | ) |

Get LUT ID.

This is the identifier of the LUT for the plane being rendered.

Returns
  the LUT ID.

References lutid.

Referenced by create().

Here is the caller graph for this function:

## § render()

virtual void ome::qtwidgets::gl::Image2D::render | ( | const glm::mat4 & | mvp | ) |
| pure virtual

Render the image.

Parameters

  mvp | the model view projection matrix.

Implemented in ome::qtwidgets::gl::v33::Image2D.

Referenced by ome::qtwidgets::GLView2D::render().

Here is the caller graph for this function:

## § setMax()

void ome::qtwidgets::gl::Image2D::setMax | ( | const glm::vec3 & | max | ) |

Set maximum limit for linear contrast.

Note that depending upon the image type, not all channels may be used.

Parameters

  max | the limits for three channels.

References texmax.

Referenced by ome::qtwidgets::GLView2D::timerEvent().

Here is the caller graph for this function:

## § setMin()

void ome::qtwidgets::gl::Image2D::setMin | ( | const glm::vec3 & | min | ) |

Set minimum limit for linear contrast.

Note that depending upon the image type, not all channels may be used.

Parameters

  min | the limits for three channels.

References texmin.

Referenced by ome::qtwidgets::GLView2D::timerEvent().

Here is the caller graph for this function:

## § setPlane()

void ome::qtwidgets::gl::Image2D::setPlane | ( | ome::files::dimension_size_type | plane | ) |

Set the plane to render.

Parameters

  plane | the plane number.

References ome::files::FormatReader::getSeries(), ome::files::FormatReader::openBytes(), plane, ome::files::FormatReader::setSeries(), and ome::files::VariantPixelBuffer::vbuffer().

Referenced by ome::qtwidgets::GLView2D::timerEvent().

Here is the caller graph for this function:

## § setSize()

void ome::qtwidgets::gl::Image2D::setSize | ( | const glm::vec2 & | xlim,
|  | const glm::vec2 & | ylim
| ) |  |
| protectedvirtual

Set the size of the x and y dimensions.

Parameters

  xlim | the x axis limits (range).
  ylim | the y axis limits (range).

References image_elements, image_texcoords, image_vertices, and vertices.

Referenced by create().

Here is the caller graph for this function:

## § texture()

unsigned int ome::qtwidgets::gl::Image2D::texture | ( |  | ) |

Get texture ID.

This is the identifier of the texture for the plane being rendered.

Returns
  the texture ID.

References textureid.

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

- ome/qtwidgets/gl/Image2D.h
- ome/qtwidgets/gl/Image2D.cpp