Home -> IFrameBufferOutput -> ReadBufferData

Description

The ReadBufferData method attempts to read captured framebuffer image data and write it to the target CPU buffer. The read covers the captured region configured on the output object, after any cropping has been applied.

Typed overloads are provided for common vector formats, and the raw overload allows the requested output image and data format to be specified explicitly. The renderer converts from the captured attachment format into the requested output format where supported.

Applications should call this only after the capture has completed. Use WaitForOutputCaptureComplete when reading output from recently submitted frame work.

Usage

template<class T> SuccessToken ReadBufferData(std::vector<T>& targetBuffer, const V2UInt32& imageOffsetInPixels = V2UInt32(0, 0), const V2UInt32& imageRegionInPixels = V2UInt32(0, 0)) const;
SuccessToken ReadBufferData(void* targetBuffer, size_t targetBufferSizeInBytes, ITextureBuffer::SourceImageFormat imageFormat, ITextureBuffer::SourceDataFormat dataFormat, const V2UInt32& imageOffsetInPixels = V2UInt32(0, 0), const V2UInt32& imageRegionInPixels = V2UInt32(0, 0)) const;

Argument list

targetBuffer [std::vector<T> or void*]
The destination memory to receive the captured data.
targetBufferSizeInBytes [size_t]
The size, in bytes, of the destination memory.
imageFormat [ITextureBuffer::SourceImageFormat]
The image channel layout requested for the destination data.
dataFormat [ITextureBuffer::SourceDataFormat]
The data encoding requested for the destination data.
imageOffsetInPixels [const V2UInt32]
The top-left pixel offset of the region to read.
imageRegionInPixels [const V2UInt32]
The pixel dimensions of the region to read. A zero value requests the remaining captured image from the offset.

Return value

[SuccessToken]
True if the operation succeeded, false otherwise. An assertion will be raised in debug builds if the result is not tested.

See also