![]() |
Blue Brain BioExplorer
|
This class represents a frame buffer for an engine specific code. It provides an API for utilizing and manipulating the frame buffer in various ways. More...
#include <FrameBuffer.h>
Public Member Functions | |
PLATFORM_API | FrameBuffer (const std::string &name, const Vector2ui &frameSize, FrameBufferFormat frameBufferFormat) |
FrameBuffer constructor. More... | |
virtual PLATFORM_API void | map ()=0 |
Map the buffer for reading with get*Buffer(). More... | |
virtual PLATFORM_API void | unmap ()=0 |
Unmap the buffer for reading with get*Buffer(). More... | |
virtual PLATFORM_API const uint8_t * | getColorBuffer () const =0 |
Get the Color Buffer object. More... | |
virtual PLATFORM_API const float * | getFloatBuffer () const =0 |
Get the Float Buffer object. More... | |
virtual PLATFORM_API void | resize (const Vector2ui &frameSize)=0 |
Resize the framebuffer to the new size. More... | |
virtual PLATFORM_API void | clear () |
Clear the framebuffer. More... | |
virtual PLATFORM_API Vector2ui | getSize () const |
Get the Size object. More... | |
virtual PLATFORM_API void | setAccumulation (const bool accumulation) |
Enable/disable accumulation state on the framebuffer. More... | |
virtual PLATFORM_API void | setFormat (FrameBufferFormat frameBufferFormat) |
Set a new framebuffer format. More... | |
virtual PLATFORM_API void | setSubsampling (const size_t) |
Set a new subsampling with a factor from 1 to x of the current size. More... | |
virtual PLATFORM_API void | createPixelOp (const std::string &) |
Create and set a pixelop (pre/post filter) on the framebuffer. More... | |
virtual PLATFORM_API void | updatePixelOp (const PropertyMap &) |
Update the current pixelop with the given properties. More... | |
PLATFORM_API size_t | getColorDepth () const |
Get the Color Depth object. More... | |
PLATFORM_API const Vector2ui & | getFrameSize () const |
Get the Frame Size object. More... | |
PLATFORM_API bool | getAccumulation () const |
Get the Accumulation object. More... | |
PLATFORM_API FrameBufferFormat | getFrameBufferFormat () const |
Get the Frame Buffer Format object. More... | |
PLATFORM_API const std::string & | getName () const |
Get the Name object. More... | |
PLATFORM_API void | incrementAccumFrames () |
Increment the accumulation frames. More... | |
PLATFORM_API size_t | numAccumFrames () const |
Get the number of accumulation frames. More... | |
PLATFORM_API freeimage::ImagePtr | getImage () |
Get the Image object. More... | |
PLATFORM_API void | setAccumulationType (const AccumulationType accumulationType) |
Set the Accumulation Type object. More... | |
PLATFORM_API AccumulationType | getAccumulationType () const |
Get the Accumulation Type object. More... | |
![]() | |
BaseObject ()=default | |
virtual | ~BaseObject ()=default |
BaseObject (const BaseObject &) | |
BaseObject & | operator= (const BaseObject &rhs) |
bool | isModified () const |
void | resetModified () |
void | markModified (const bool triggerCallback=true) |
void | onModified (const ModifiedCallback &callback) |
void | clearModifiedCallback () |
Protected Attributes | |
const std::string | _name |
Vector2ui | _frameSize |
FrameBufferFormat | _frameBufferFormat |
bool | _accumulation {true} |
AccumulationType | _accumulationType {AccumulationType::linear} |
std::atomic_size_t | _accumFrames {0} |
Additional Inherited Members | |
![]() | |
using | ModifiedCallback = std::function< void(const BaseObject &)> |
![]() | |
template<typename T > | |
void | _updateValue (T &member, const T &newValue, const bool triggerCallback=true) |
template<class T > | |
bool | _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0) |
template<class T > | |
bool | _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0) |
This class represents a frame buffer for an engine specific code. It provides an API for utilizing and manipulating the frame buffer in various ways.
Definition at line 38 of file FrameBuffer.h.
core::FrameBuffer::FrameBuffer | ( | const std::string & | name, |
const Vector2ui & | frameSize, | ||
FrameBufferFormat | frameBufferFormat | ||
) |
FrameBuffer constructor.
Construct a new FrameBuffer object
name | The name of the frame buffer. |
frameSize | The initial size of the frame buffer. |
frameBufferFormat | The format of the frame buffer. |
Definition at line 27 of file FrameBuffer.cpp.
|
inlinevirtual |
Clear the framebuffer.
Reimplemented in core::engine::ospray::OSPRayFrameBuffer.
Definition at line 90 of file FrameBuffer.h.
|
inlinevirtual |
Create and set a pixelop (pre/post filter) on the framebuffer.
name | The name of the pixelOp. |
Reimplemented in core::engine::ospray::OSPRayFrameBuffer.
Definition at line 125 of file FrameBuffer.h.
|
inline |
Get the Accumulation object.
Definition at line 153 of file FrameBuffer.h.
|
inline |
Get the Accumulation Type object.
Definition at line 204 of file FrameBuffer.h.
|
pure virtual |
Get the Color Buffer object.
Implemented in core::engine::ospray::OSPRayFrameBuffer, and core::engine::optix::OptiXFrameBuffer.
size_t core::FrameBuffer::getColorDepth | ( | ) | const |
Get the Color Depth object.
Definition at line 34 of file FrameBuffer.cpp.
|
pure virtual |
Get the Float Buffer object.
Implemented in core::engine::ospray::OSPRayFrameBuffer, and core::engine::optix::OptiXFrameBuffer.
|
inline |
Get the Frame Buffer Format object.
Definition at line 160 of file FrameBuffer.h.
|
inline |
Get the Frame Size object.
Definition at line 146 of file FrameBuffer.h.
freeimage::ImagePtr core::FrameBuffer::getImage | ( | ) |
Get the Image object.
Definition at line 49 of file FrameBuffer.cpp.
|
inline |
Get the Name object.
Definition at line 167 of file FrameBuffer.h.
|
inlinevirtual |
Get the Size object.
Reimplemented in core::engine::ospray::OSPRayFrameBuffer.
Definition at line 97 of file FrameBuffer.h.
|
inline |
Increment the accumulation frames.
Definition at line 173 of file FrameBuffer.h.
|
pure virtual |
Map the buffer for reading with get*Buffer().
Implemented in core::engine::ospray::OSPRayFrameBuffer, and core::engine::optix::OptiXFrameBuffer.
|
inline |
Get the number of accumulation frames.
Definition at line 180 of file FrameBuffer.h.
|
pure virtual |
Resize the framebuffer to the new size.
frameSize | The frame buffer size to be set. |
Implemented in core::engine::optix::OptiXFrameBuffer, and core::engine::ospray::OSPRayFrameBuffer.
|
inlinevirtual |
Enable/disable accumulation state on the framebuffer.
accumulation | The accumulation state to be set. |
Reimplemented in core::engine::ospray::OSPRayFrameBuffer, and core::engine::optix::OptiXFrameBuffer.
Definition at line 104 of file FrameBuffer.h.
|
inline |
Set the Accumulation Type object.
accumulationType | The accumulation type to be set. |
Definition at line 194 of file FrameBuffer.h.
|
inlinevirtual |
Set a new framebuffer format.
frameBufferFormat | The new frame buffer format to be set. |
Reimplemented in core::engine::ospray::OSPRayFrameBuffer.
Definition at line 111 of file FrameBuffer.h.
|
inlinevirtual |
Set a new subsampling with a factor from 1 to x of the current size.
size_t | The size to be set. |
Reimplemented in core::engine::ospray::OSPRayFrameBuffer.
Definition at line 118 of file FrameBuffer.h.
|
pure virtual |
Unmap the buffer for reading with get*Buffer().
Implemented in core::engine::ospray::OSPRayFrameBuffer, and core::engine::optix::OptiXFrameBuffer.
|
inlinevirtual |
Update the current pixelop with the given properties.
properties | The properties to be updated. |
Reimplemented in core::engine::ospray::OSPRayFrameBuffer.
Definition at line 132 of file FrameBuffer.h.
|
protected |
Definition at line 212 of file FrameBuffer.h.
|
protected |
Definition at line 210 of file FrameBuffer.h.
|
protected |
Definition at line 211 of file FrameBuffer.h.
|
protected |
Definition at line 209 of file FrameBuffer.h.
|
protected |
Definition at line 208 of file FrameBuffer.h.
|
protected |
Definition at line 207 of file FrameBuffer.h.