OpenGL representation of an Image as a framebuffer.
More...
#include <imagegl.h>
|
|
| ImageGL (const ImageGL &rhs) |
| virtual ImageGL * | clone () const override |
| ActiveState | activate (ImageType imageType=ImageType::AllLayers) |
| | Store the current "state" and activate the FBO.
|
| void | activateBuffer (ImageType imageType=ImageType::AllLayers) |
| | Active the FBO.
|
|
void | deactivateBuffer () |
| | Deactivate the framebuffer (bind 0).
|
| virtual size2_t | getDimensions () const override |
| virtual bool | copyRepresentationsTo (ImageRepresentation *target) const override |
| | Copies this instance into the target using a copy shader.
|
| virtual size_t | priority () const override |
| bool | copyRepresentationsTo (ImageGL *target) const |
| | Copies this instance into the target using a copy shader.
|
| bool | updateFrom (const ImageGL *source) |
| | Copies source into this instance using Blitting and PBOs if needed.
|
|
FrameBufferObject * | getFBO () |
|
const FrameBufferObject * | getFBO () const |
|
LayerGL * | getLayerGL (LayerType, size_t idx=0) |
|
const LayerGL * | getLayerGL (LayerType, size_t idx=0) const |
|
LayerGL * | getColorLayerGL (size_t idx=0) |
|
LayerGL * | getDepthLayerGL () |
|
LayerGL * | getPickingLayerGL () |
|
const LayerGL * | getColorLayerGL (size_t idx=0) const |
|
const LayerGL * | getDepthLayerGL () const |
|
const LayerGL * | getPickingLayerGL () const |
|
size_t | getNumberOfColorLayers () const |
|
GLenum | getPickingAttachmentID () const |
| virtual dvec4 | readPixel (size2_t pos, LayerType layer, size_t index=0) const override |
| virtual std::type_index | getTypeIndex () const override final |
| virtual bool | isValid () const override |
| virtual void | update (bool editable) override |
|
| ImageRepresentation (const ImageRepresentation &rhs)=default |
|
ImageRepresentation & | operator= (const ImageRepresentation &that)=default |
| virtual void | setOwner (Image *image) override |
| virtual Image * | getOwner () override |
|
virtual const Image * | getOwner () const 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 |
◆ 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: