Home -> IFrameBufferOutput

Declaration

class IFrameBufferOutput;

Description

The IFrameBufferOutput interface represents an object which is capable of retrieving the output of a single framebuffer target, such as a colour, depth, or stencil buffer, and returning the contained data to the application. This is useful for creating screenshots, or potentially for recording a video of every rendered frame produced. Multiple IFrameBufferOutput objects can be attached to the one IFrameBuffer, to capture multiple output targets, or potentially to capture the same output target into multiple IFrameBufferOutput objects. It is also possible to attach an IFrameBufferOutput object to intermediate framebuffers, which aren't displayed directly to the screen, but are used to write to textures that are fed into later stages of rendering. This can be useful for debugging issues during development.

ImportantImportant

Please be aware that due to the inherent overhead in reading back resulting buffer contents from the hardware, attaching an IFrameBufferOutput object may have a significant impact on render times, so it is advisable to only leave an IFrameBufferOutput object attached for the shortest time required.

Members

Initialization methods

Name Description
Public member Delete
Schedules the object for deletion. After calling this method, the object will be destroyed after the current frame completes drawing.

Configuration methods

Name Description
Public member SetDetachAfterCapture
Specifies whether this IFrameBufferOutput object will be detached after capturing a single image.
Public member SetFrameBufferCaptureRegion
Specifies the region of the bound framebuffer image to capture

Data methods

Name Description
Public member HasCapturedOutput
Returns true if there is image data ready to be read from the output buffer
Public member ClearCapturedOutput
Relases the captured image data. Note that this doesn't need to be called to capture a new frame.
Public member GetImageDimensions
Returns the size in pixels of the image data in the output buffer
Public member GetCroppedImageDimensions
Returns the resulting image size if the specified offset and maximum region size are applied to the actual image data in the output buffer. This can be used to appropriately size a buffer to pass into the ReadBufferData method.
Public member GetOptimalImageFormat
Returns the SourceImageFormat that most closely matches the format of the captured image data.
Public member GetOptimalDataFormat
Returns the SourceDataFormat that most closely matches the format of the captured image data.
Public member ReadBufferData
Attempts to read the requested portion of the captured image output and write it to the target buffer

See also