ome-qtwidgets  5.2.0
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:
+ Collaboration diagram for ome::qtwidgets::gl::Image2D:

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::FormatReaderreader
 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

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

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
readerthe image reader.
seriesthe image series.
parentthe parent of this object.

Member Function Documentation

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:

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

Get maximum limit for linear contrast.

Returns
the limits for three channels.

References texmax.

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

Get minimum limit for linear contrast.

Returns
the limits for three channels.

References texmin.

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:

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

Render the image.

Parameters
mvpthe model view projection matrix.

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

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

+ Here is the caller graph for this function:

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
maxthe limits for three channels.

References texmax.

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

+ Here is the caller graph for this function:

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
minthe limits for three channels.

References texmin.

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

+ Here is the caller graph for this function:

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

Set the plane to render.

Parameters
planethe 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:

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
xlimthe x axis limits (range).
ylimthe y axis limits (range).

References image_elements, image_texcoords, and image_vertices.

Referenced by create().

+ Here is the caller graph for this function:

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: