bioformats
5.1.8
|
2D (xy) image renderer. More...
#include <ome/qtwidgets/gl/Image2D.h>
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::bioformats::FormatReader > reader, ome::bioformats::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::bioformats::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 | |
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::bioformats::FormatReader > | reader |
The image reader. | |
ome::bioformats::dimension_size_type | series |
The image series. | |
ome::bioformats::dimension_size_type | plane |
The current image plane. | |
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.
|
explicit |
Create a 2D image.
The size and position will be taken from the specified image.
reader | the image reader. |
series | the image series. |
parent | the parent of this object. |
|
virtual |
Create GL buffers.
References ome::bioformats::bitsPerPixel(), ome::qtwidgets::gl::check_gl(), ome::bioformats::FormatReader::getBitsPerPixel(), ome::bioformats::FormatReader::getPixelType(), ome::bioformats::FormatReader::getSeries(), ome::bioformats::FormatReader::getSizeX(), ome::bioformats::FormatReader::getSizeY(), lut(), lutid, ome::bioformats::FormatReader::setSeries(), setSize(), and texcorr.
Referenced by ome::qtwidgets::GLView2D::initialize().
const glm::vec3 & ome::qtwidgets::gl::Image2D::getMax | ( | ) | const |
const glm::vec3 & ome::qtwidgets::gl::Image2D::getMin | ( | ) | const |
unsigned int ome::qtwidgets::gl::Image2D::lut | ( | ) |
|
pure virtual |
Render the image.
mvp | the model view projection matrix. |
Implemented in ome::qtwidgets::gl::v20::Image2D.
Referenced by ome::qtwidgets::GLView2D::render().
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.
max | the limits for three channels. |
References texmax.
Referenced by ome::qtwidgets::GLView2D::timerEvent().
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.
min | the limits for three channels. |
References texmin.
Referenced by ome::qtwidgets::GLView2D::timerEvent().
void ome::qtwidgets::gl::Image2D::setPlane | ( | ome::bioformats::dimension_size_type | plane | ) |
Set the plane to render.
plane | the plane number. |
References ome::bioformats::FormatReader::getSeries(), ome::bioformats::FormatReader::openBytes(), plane, ome::bioformats::FormatReader::setSeries(), and ome::bioformats::VariantPixelBuffer::vbuffer().
Referenced by ome::qtwidgets::GLView2D::timerEvent().
|
protectedvirtual |
Set the size of the x and y dimensions.
xlim | the x axis limits (range). |
ylim | the y axis limits (range). |
References image_elements, image_texcoords, and image_vertices.
Referenced by create().
unsigned int ome::qtwidgets::gl::Image2D::texture | ( | ) |
Get texture ID.
This is the identifier of the texture for the plane being rendered.
References textureid.