ome-qtwidgets
5.2.0
|
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::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 | |
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. | |
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::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().
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::files::dimension_size_type | plane | ) |
Set the plane to render.
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().
|
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.