public

Inheritance Graph

graph BT
	PBO
	PBO --> ReferenceCounter
	click PBO "classRendering_1_1PBO"
	click ReferenceCounter "classUtil_1_1ReferenceCounter"

Description

Representation of an OpenGL pixel buffer object ( PBO ).

Note: This implementation only supports asynchronous reading of pixel data from OpenGL to the application.

See also: http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt

Author: Benjamin Eikel

Date: 2011-06-12

Public Functions

   
   
  PBO()
   
uint32_t getWidth() const
   
uint32_t getHeight() const
   
void asynchronousReadPixels(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
   
bool fillTexture( Texture * texture) const

Documentation

function
Rendering::PBO::PBO

public
   
   
PBO( )

Defined in Rendering/PBO.h:44


function
Rendering::PBO::getWidth

public const inline
   
   
uint32_t getWidth( ) const

Defined in Rendering/PBO.h:46


function
Rendering::PBO::getHeight

public const inline
   
   
uint32_t getHeight( ) const

Defined in Rendering/PBO.h:50


function
Rendering::PBO::asynchronousReadPixels

public
     
     
void asynchronousReadPixels( uint32_t x,
  uint32_t y,
  uint32_t width,
  uint32_t height
)    

Activate the pixel buffer object and callglReadPixels. The call returns immediately and the pixel data is stored inside the pixel buffer object. The calling thread should continue processing before callingfillTexture.

See also: glReadPixels

Parameters

x
X coordinate of the lower left pixel.
y
Y coordinate of the lower left pixel.
width
Horizontal dimension of the rectangle to read.
height
Vertical dimension of the rectangle to read.

Defined in Rendering/PBO.h:65


function
Rendering::PBO::fillTexture

public const
     
     
bool fillTexture( Texture * texture ) const

Copy the data of this pixel buffer object into the given texture. The calling thread should wait a certain time before calling this function after callingasynchronousReadPixels. Otherwise there is no benefit in callingglReadPixelswithout using a pixel buffer object.

Parameters

texture
A 2D texture with the same values for width and height as for the last call toasynchronousReadPixels. The format has to beGL_BGRAand the type has to beGL_UNSIGNED_BYTE.

Returns

trueif the data was copied successfully,falseif the size or data format of the texture did not match or there is no data.

Defined in Rendering/PBO.h:76