Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
BIAS::glfFramebufferObject Class Reference

Framebuffer object. More...

#include <OpenGLFramework/Base/glfFramebufferObject.hh>

+ Inheritance diagram for BIAS::glfFramebufferObject:
+ Collaboration diagram for BIAS::glfFramebufferObject:

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 ()
 

Detailed Description

Framebuffer object.

Author
jkollmann
Examples:
ExampleMultisampleBlit.cpp, ExamplePlainPerPixelProcessing.cpp, and ExampleTemplateSpecializedBatch.cpp.

Definition at line 41 of file glfFramebufferObject.hh.

Member Enumeration Documentation

Enumerator
BUFFER_COLOR 
BUFFER_DEPTH 
BUFFER_STENCIL 

Definition at line 66 of file glfRenderTarget.hh.

Constructor & Destructor Documentation

glfFramebufferObject::glfFramebufferObject ( )

Definition at line 33 of file glfFramebufferObject.cpp.

glfFramebufferObject::~glfFramebufferObject ( )

Definition at line 51 of file glfFramebufferObject.cpp.

Member Function Documentation

void glfFramebufferObject::AttachRenderbuffer ( const glfRenderbuffer renderbuffer,
GLenum  attachmentPoint 
)

Attaches a renderbuffer to the framebuffer object.

See glfFramebufferObject::AttachTexture for valid attachment points.

Examples:
ExampleMultisampleBlit.cpp.

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.

  • GL_COLOR_ATTACHMENT0_EXT .. GL_COLOR_ATTACHMENT<MAX_COLOR_ATTACH>_EXT
  • GL_DEPTH_ATTACHMENT_EXT
  • GL_STENCIL_ATTACHMENT_EXT

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

Examples:
ExampleMultisampleBlit.cpp, ExamplePlainPerPixelProcessing.cpp, and ExampleTemplateSpecializedBatch.cpp.

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().

void glfFramebufferObject::Bind ( ) const
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().

void glfFramebufferObject::Blit ( glfFramebufferObject source,
glfFramebufferObject target,
GLbitfield  bufferMask 
)
static

Blits the attachments from source to target, requires EXT_framebuffer_blit extension.

Parameters
sourceis the source of the blit operation, i.e. the content copied.
targetis the target of the blit operation.
bufferMaskis 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.
Attention
the filter operation applied is GL_NEAREST.

Definition at line 278 of file glfFramebufferObject.cpp.

void glfFramebufferObject::BlitColorBuffer ( glfFramebufferObject source,
glfFramebufferObject target,
GLenum  colorFilter 
)
static

Blits the attachments from source to target, requires EXT_framebuffer_blit extension.

Copied content is only the color attachment.

Parameters
sourceis the source of the blit operation, i.e. the content copied.
targetis the target of the blit operation.
colorFilteris 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.

Examples:
ExampleMultisampleBlit.cpp, ExamplePlainPerPixelProcessing.cpp, and ExampleTemplateSpecializedBatch.cpp.

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().

void glfRenderTarget::ClearAccumBuffer ( float  red = 0.0f,
float  green = 0.0f,
float  blue = 0.0f,
float  alpha = 0.0f 
)
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.

void glfRenderTarget::ClearColorBuffer ( float  red = 0.0f,
float  green = 0.0f,
float  blue = 0.0f,
float  alpha = 0.0f 
)
inherited
void glfRenderTarget::ClearDepthBuffer ( float  depth = 1.0f)
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.

Examples:
ExampleRenderingContext.cpp.

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().

void glfRenderTarget::ClearStencilBuffer ( int  s = 0)
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.

Examples:
ExampleMultisampleBlit.cpp, ExamplePlainPerPixelProcessing.cpp, and ExampleTemplateSpecializedBatch.cpp.

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().

GLint glfFramebufferObject::MaxRenderTargets ( )
static

Definition at line 261 of file glfFramebufferObject.cpp.

Referenced by BIAS::FramebufferSetup::Execute().

void glfRenderTarget::ReadBuffer ( BIAS::ImageBase image,
BufferType  bufferType,
int  x,
int  y,
int  width,
int  height 
)
inherited
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().


The documentation for this class was generated from the following files: