OpenGL representation of an Image as a framebuffer.
More...
#include <imagegl.h>
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:
utilgl::ViewportState>
SimpleState< GLboolean, GLboolean, GL_DEPTH_WRITEMASK, glGetBooleanv, glDepthMask > DepthMaskState
RAII object for OpenGL depth mask to enable/disable writing depth.
Definition openglutils.h:543
◆ 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]
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: