Basic Image AlgorithmS Library
2.8.0
|
Framebuffer object. More...
#include <OpenGLFramework/Base/glfFramebufferObject.hh>
Public Types | |
enum | BufferType { BUFFER_COLOR, BUFFER_DEPTH, BUFFER_STENCIL } |
Public Member Functions | |
void | AttachRenderbuffer (const glfRenderbuffer &renderbuffer, GLenum attachmentPoint) |
Attaches a renderbuffer to the framebuffer object. More... | |
void | AttachTexture (const glfTexture &texture, GLenum attachmentPoint, int attachedMipMapLevel=0, int zSlice=0, GLenum cubeMapSide=0) |
Attaches a texture to an attachment point which can be. More... | |
virtual void | Bind () const |
Makes this render target the currently used render target. More... | |
void | CheckComplete () const |
Checks whether the framebuffer object is supported in its current state. More... | |
void | ClearAccumBuffer (float red=0.0f, float green=0.0f, float blue=0.0f, float alpha=0.0f) |
Clears the accumulation buffer of the render target with the given color. More... | |
void | ClearColorBuffer (float red=0.0f, float green=0.0f, float blue=0.0f, float alpha=0.0f) |
Clears the color buffer of the render target with the given color. More... | |
void | ClearDepthBuffer (float depth=1.0f) |
Clears the depth buffer of the render target with the given value. More... | |
void | ClearStencilBuffer (int s=0) |
Clears the stencil buffer of the render target with the given value. More... | |
void | Create () |
Creates the framebuffer object. More... | |
void | GetSize (GLint &width, GLint &height) |
glfFramebufferObject () | |
void | ReadBuffer (BIAS::ImageBase &image, BufferType bufferType, int x, int y, int width, int height) |
Copies the contents of a buffer to an image. More... | |
void | ReleaseAttachment (GLenum attachmentPoint) |
Removes an attachment from the framebuffer object. More... | |
void | ResetDrawBuffers () |
void | SetDrawBuffers (const std::vector< GLenum > &drawbuffers) |
~glfFramebufferObject () | |
Static Public Member Functions | |
static void | Blit (glfFramebufferObject *source, glfFramebufferObject *target, GLbitfield bufferMask) |
Blits the attachments from source to target, requires EXT_framebuffer_blit extension. More... | |
static void | BlitColorBuffer (glfFramebufferObject *source, glfFramebufferObject *target, GLenum colorFilter) |
Blits the attachments from source to target, requires EXT_framebuffer_blit extension. More... | |
static GLint | MaxRenderTargets () |
Framebuffer object.
Definition at line 41 of file glfFramebufferObject.hh.
|
inherited |
Enumerator | |
---|---|
BUFFER_COLOR | |
BUFFER_DEPTH | |
BUFFER_STENCIL |
Definition at line 66 of file glfRenderTarget.hh.
glfFramebufferObject::glfFramebufferObject | ( | ) |
Definition at line 33 of file glfFramebufferObject.cpp.
glfFramebufferObject::~glfFramebufferObject | ( | ) |
Definition at line 51 of file glfFramebufferObject.cpp.
void glfFramebufferObject::AttachRenderbuffer | ( | const glfRenderbuffer & | renderbuffer, |
GLenum | attachmentPoint | ||
) |
Attaches a renderbuffer to the framebuffer object.
See glfFramebufferObject::AttachTexture for valid attachment points.
Definition at line 111 of file glfFramebufferObject.cpp.
References Bind(), and BIAS::glfRenderbuffer::GetRenderbufferID().
void glfFramebufferObject::AttachTexture | ( | const glfTexture & | texture, |
GLenum | attachmentPoint, | ||
int | attachedMipMapLevel = 0 , |
||
int | zSlice = 0 , |
||
GLenum | cubeMapSide = 0 |
||
) |
Attaches a texture to an attachment point which can be.
If the texture is a cube map, then cubeMapSide must be one of the following values: GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
Definition at line 74 of file glfFramebufferObject.cpp.
References Bind(), BIAS::glfTexture::GetTextureID(), and BIAS::glfTexture::GetTextureTarget().
Referenced by BIAS::SeparableBilateralFilter::Draw(), BIAS::FramebufferSetup::Execute(), BIAS::DistortionRendering::Init(), and BIAS::SeparableBilateralFilter::SetColorAndSourceAndDest().
|
virtual |
Makes this render target the currently used render target.
This must call glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ?)
.
Implements BIAS::glfRenderTarget.
Definition at line 224 of file glfFramebufferObject.cpp.
Referenced by AttachRenderbuffer(), AttachTexture(), BIAS::DistortionRendering::BeginRendering(), BIAS::DistortionRendering::Bind(), CheckComplete(), GetSize(), ReleaseAttachment(), and BIAS::TriangleMeshSplatRendering::Splat().
|
static |
Blits the attachments from source to target, requires EXT_framebuffer_blit extension.
source | is the source of the blit operation, i.e. the content copied. |
target | is the target of the blit operation. |
bufferMask | is the mask identifying the buffers that are copied, and can consists of GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT and GL_STENCIL_BUFFER_BIT. |
Definition at line 278 of file glfFramebufferObject.cpp.
|
static |
Blits the attachments from source to target, requires EXT_framebuffer_blit extension.
Copied content is only the color attachment.
source | is the source of the blit operation, i.e. the content copied. |
target | is the target of the blit operation. |
colorFilter | is either GL_LINEAR or GL_NEAREST. |
Definition at line 269 of file glfFramebufferObject.cpp.
void glfFramebufferObject::CheckComplete | ( | ) | const |
Checks whether the framebuffer object is supported in its current state.
If not, an exception is thrown. This method should be called before the framebuffer object is used as a render target.
Definition at line 148 of file glfFramebufferObject.cpp.
References Bind().
Referenced by BIAS::DistortionRendering::BeginRendering(), BIAS::FramebufferSetup::Execute(), BIAS::DistortionRendering::Init(), and BIAS::SeparableBilateralFilter::SetColorAndSourceAndDest().
|
inherited |
Clears the accumulation buffer of the render target with the given color.
The color (0,0,0,0) is the default clear color in OpenGL.
Definition at line 50 of file glfRenderTarget.cpp.
|
inherited |
Clears the color buffer of the render target with the given color.
The color (0,0,0,0) is the default clear color in OpenGL.
Definition at line 31 of file glfRenderTarget.cpp.
Referenced by BIAS::GLProjectionParametersBase::BeginDraw_(), BIAS::DistortionRendering::BeginRendering(), BIAS::OutputLensDistortion::Draw_(), BIAS::FramebufferSetup::Execute(), BIAS::DistortionRendering::Init(), and BIAS::TriangleMeshSplatRendering::Splat().
|
inherited |
Clears the depth buffer of the render target with the given value.
The value 1 is the default clear value for depth buffers in OpenGL.
Definition at line 41 of file glfRenderTarget.cpp.
Referenced by BIAS::GLProjectionParametersBase::BeginDraw_(), BIAS::DistortionRendering::BeginRendering(), BIAS::OutputLensDistortion::Draw_(), BIAS::FramebufferSetup::Execute(), BIAS::DistortionRendering::Init(), and BIAS::TriangleMeshSplatRendering::Splat().
|
inherited |
Clears the stencil buffer of the render target with the given value.
The value 0 is the default clear value for stencil buffers in OpenGL.
Definition at line 59 of file glfRenderTarget.cpp.
Referenced by BIAS::GLProjectionParametersBase::BeginDraw_(), and BIAS::DistortionRendering::BeginRendering().
void glfFramebufferObject::Create | ( | ) |
Creates the framebuffer object.
Before it can be used, you must attach one or several textures and check glfFramebufferObject::IsComplete.
Definition at line 60 of file glfFramebufferObject.cpp.
Referenced by BIAS::DistortionRendering::Init().
void glfFramebufferObject::GetSize | ( | GLint & | width, |
GLint & | height | ||
) |
Definition at line 306 of file glfFramebufferObject.cpp.
References Bind().
|
static |
Definition at line 261 of file glfFramebufferObject.cpp.
Referenced by BIAS::FramebufferSetup::Execute().
|
inherited |
Copies the contents of a buffer to an image.
Definition at line 68 of file glfRenderTarget.cpp.
References BIAS::ImageBase::GetImageData(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::Init(), BIAS::ImageBase::IsEmpty(), BIAS::ImageBase::Release(), BIAS::ImageBase::ST_char, BIAS::ImageBase::ST_float, BIAS::ImageBase::ST_int, BIAS::ImageBase::ST_shortint, BIAS::ImageBase::ST_unsignedchar, BIAS::ImageBase::ST_unsignedint, and BIAS::ImageBase::ST_unsignedshortint.
void glfFramebufferObject::ReleaseAttachment | ( | GLenum | attachmentPoint | ) |
Removes an attachment from the framebuffer object.
Definition at line 122 of file glfFramebufferObject.cpp.
References Bind().
Referenced by BIAS::FramebufferSetup::Execute().
void glfFramebufferObject::ResetDrawBuffers | ( | ) |
Definition at line 253 of file glfFramebufferObject.cpp.
void glfFramebufferObject::SetDrawBuffers | ( | const std::vector< GLenum > & | drawbuffers | ) |
Definition at line 237 of file glfFramebufferObject.cpp.
Referenced by BIAS::FramebufferSetup::Execute().