OpenGL representation of an Image as a framebuffer.
More...
#include <modules/opengl/image/imagegl.h>
|
| ActiveState | activate (ImageType imageType=ImageType::AllLayers) |
| | Store the current "state" and activate the FBO.
|
| void | activateBuffer (ImageType imageType=ImageType::AllLayers) |
| | Active the FBO.
|
| virtual ImageGL * | clone () const override |
| bool | copyRepresentationsTo (ImageGL *target) const |
| | Copies this instance into the target using a copy shader.
|
| virtual bool | copyRepresentationsTo (ImageRepresentation *target) const override |
| | Copies this instance into the target using a copy shader.
|
|
void | deactivateBuffer () |
| | Deactivate the framebuffer (bind 0).
|
|
LayerGL * | getColorLayerGL (size_t idx=0) |
|
const LayerGL * | getColorLayerGL (size_t idx=0) const |
|
LayerGL * | getDepthLayerGL () |
|
const LayerGL * | getDepthLayerGL () const |
| virtual size2_t | getDimensions () const override |
|
FrameBufferObject * | getFBO () |
|
const FrameBufferObject * | getFBO () const |
|
LayerGL * | getLayerGL (LayerType, size_t idx=0) |
|
const LayerGL * | getLayerGL (LayerType, size_t idx=0) const |
|
size_t | getNumberOfColorLayers () const |
|
GLenum | getPickingAttachmentID () const |
|
LayerGL * | getPickingLayerGL () |
|
const LayerGL * | getPickingLayerGL () const |
| virtual std::type_index | getTypeIndex () const override final |
|
| ImageGL (const ImageGL &rhs) |
| virtual bool | isValid () const override |
| virtual size_t | priority () const override |
| virtual dvec4 | readPixel (size2_t pos, LayerType layer, size_t index=0) const override |
| virtual void | update (bool editable) override |
| bool | updateFrom (const ImageGL *source) |
| | Copies source into this instance using Blitting and PBOs if needed.
|
|
virtual const Image * | getOwner () const override |
| virtual Image * | getOwner () override |
|
| ImageRepresentation (const ImageRepresentation &rhs)=default |
|
ImageRepresentation & | operator= (const ImageRepresentation &that)=default |
| virtual void | setOwner (Image *image) override |
|
|
DataGroupRepresentation & | operator= (const DataGroupRepresentation &that)=default |
|
Image * | owner_ = nullptr |
OpenGL representation of an Image as a framebuffer.
Handles attaching all the image layers to the framebuffer
- See also
- Image, ImageRepresentation
◆ ActiveState
| using inviwo::ImageGL::ActiveState |
Initial value:
A FrameBufferObject activation RAII utility, will store the current FBO and restore that in the destr...
Definition framebufferobject.h:339
SimpleState< GLboolean, GLboolean, GL_DEPTH_WRITEMASK, glGetBooleanv, glDepthMask > DepthMaskState
RAII object for OpenGL depth mask to enable/disable writing depth.
Definition openglutils.h:543
RAII object for OpenGL bool states.
Definition openglutils.h:122
RAII object for OpenGL viewports.
Definition openglutils.h:313
◆ activate()
| ActiveState inviwo::ImageGL::activate |
( |
ImageType | imageType = ImageType::AllLayers | ) |
|
Store the current "state" and activate the FBO.
Stores the currently bound FBO, the current depth test, depth mask, and viewport. Binds the framebuffer. Sets the draw buffers. Color layer 0 will be at location 0, if picking is included in the imageType the picking layer will be at location 1. Any additional layers will be at the following locations. If imageType contains depth the depth test is enabled and the depth mask is set to true, otherwise the depth test is disabled and the depth mask is set to false. Finally the viewport is the to the image dimensions.
- Parameters
-
| imageType | The layers that should be active. |
- Returns
- An RAII object that will restore the old state on destruction.
◆ activateBuffer()
| void inviwo::ImageGL::activateBuffer |
( |
ImageType | imageType = ImageType::AllLayers | ) |
|
Active the FBO.
Binds the framebuffer, and set the draw buffers. Color layer 0 will be at location 0, if picking is included in the imageType the picking layer will be at location 1. Any additional layers will be at the following locations. If imageType contains depth the depth test is enabled and the depth mask is set to true, otherwise the depth test is disabled and the depth mask is set to false. Finally the viewport is the to the image dimensions.
- Note
- In the case of nested calls where the state needs to be maintained
- See also
- activate(ImageType)
- Parameters
-
| imageType | The layers that should be active. |
◆ clone()
| virtual ImageGL * inviwo::ImageGL::clone |
( |
| ) |
const |
|
overridevirtual |
◆ copyRepresentationsTo() [1/2]
| bool inviwo::ImageGL::copyRepresentationsTo |
( |
ImageGL * | target | ) |
const |
Copies this instance into the target using a copy shader.
The image content is scaled to the target dimensions. If the aspects are different the target image will get padding to preserve the aspect of the source content.
- Parameters
-
| target | image to copy into. |
- Returns
- true
◆ copyRepresentationsTo() [2/2]
| virtual bool inviwo::ImageGL::copyRepresentationsTo |
( |
ImageRepresentation * | target | ) |
const |
|
overridevirtual |
Copies this instance into the target using a copy shader.
The image content is scaled to the target dimensions. If the aspects are different the target image will get padding to preserve the aspect of the source content.
- Parameters
-
| target | image to copy into. |
- Returns
- true
Implements inviwo::ImageRepresentation.
◆ getDimensions()
| virtual size2_t inviwo::ImageGL::getDimensions |
( |
| ) |
const |
|
overridevirtual |
◆ getTypeIndex()
| virtual std::type_index inviwo::ImageGL::getTypeIndex |
( |
| ) |
const |
|
finaloverridevirtual |
◆ isValid()
| virtual bool inviwo::ImageGL::isValid |
( |
| ) |
const |
|
overridevirtual |
◆ priority()
| virtual size_t inviwo::ImageGL::priority |
( |
| ) |
const |
|
overridevirtual |
Returns a number representing the general efficiency of the representation. Larger value means more efficient representation. Used for selection which representation to operate on when resizing for example.
Implements inviwo::ImageRepresentation.
◆ readPixel()
| virtual dvec4 inviwo::ImageGL::readPixel |
( |
size2_t | pos, |
|
|
LayerType | layer, |
|
|
size_t | index = 0 ) const |
|
overridevirtual |
Read a single pixel value out of the specified layer at pos. Should only be used to read single values not entire images.
Implements inviwo::ImageRepresentation.
◆ update()
| virtual void inviwo::ImageGL::update |
( |
bool | editable | ) |
|
|
overridevirtual |
◆ updateFrom()
| bool inviwo::ImageGL::updateFrom |
( |
const ImageGL * | source | ) |
|
Copies source into this instance using Blitting and PBOs if needed.
Does not care about aspect ratios, copies the source image into the this instance using "nearest" interpolation. If some layers are not attached to the FBO they will be copied using PBO instead.
- Parameters
-
- Returns
- true
The documentation for this class was generated from the following file:
- modules/opengl/include/modules/opengl/image/imagegl.h