BALL::VIEW::FrameBufferFormat Class Reference

#include <BALL/VIEW/RENDERING/renderTarget.h>

List of all members.


Public Member Functions

 FrameBufferFormat ()
 FrameBufferFormat (const unsigned int width, const unsigned int height, const PixelFormat &pixelFormat)
 FrameBufferFormat (const unsigned int width, const unsigned int height, const unsigned int pitch, const PixelFormat &pixelFormat)
 FrameBufferFormat (const FrameBufferFormat &format)
const FrameBufferFormatoperator= (const FrameBufferFormat &format)
bool operator== (const FrameBufferFormat &format) const
bool operator!= (const FrameBufferFormat &format) const
bool isValid () const
unsigned int getWidth () const
void setWidth (unsigned int width)
unsigned int getHeight () const
void setHeight (unsigned int height)
unsigned int getPitch () const
void setPitch (unsigned int pitch)
const PixelFormatgetPixelFormat () const
void setPixelFormat (const PixelFormat &pixelFormat)
size_t computeSize () const
void resize (const unsigned int newWidth, const unsigned int newHeight)
const FrameBufferFormat resized (const unsigned int newWidth, const unsigned int newHeight) const

Private Attributes

unsigned int width
unsigned int height
unsigned int pitch
PixelFormat pixelFormat

Detailed Description

This is used by the RenderTarget to specify in which formats it can provide buffers.


Constructor & Destructor Documentation

BALL::VIEW::FrameBufferFormat::FrameBufferFormat (  )  [inline]

Constructs empty invalid framebuffer format

Referenced by resized().

BALL::VIEW::FrameBufferFormat::FrameBufferFormat ( const unsigned int  width,
const unsigned int  height,
const PixelFormat pixelFormat 
) [inline]
BALL::VIEW::FrameBufferFormat::FrameBufferFormat ( const unsigned int  width,
const unsigned int  height,
const unsigned int  pitch,
const PixelFormat pixelFormat 
) [inline]
BALL::VIEW::FrameBufferFormat::FrameBufferFormat ( const FrameBufferFormat format  )  [inline]

Member Function Documentation

size_t BALL::VIEW::FrameBufferFormat::computeSize (  )  const [inline]

Computes size of the framebuffer with this format: size = pitch * height

References getHeight(), getPitch(), and isValid().

unsigned int BALL::VIEW::FrameBufferFormat::getHeight (  )  const [inline]

Returns height of buffers in this format, in pixels.

References height.

Referenced by computeSize(), and BALL::VIEW::operator<<().

unsigned int BALL::VIEW::FrameBufferFormat::getPitch (  )  const [inline]

Returns actual line width of buffers in this format, in bytes

References pitch.

Referenced by computeSize(), and BALL::VIEW::operator<<().

const PixelFormat& BALL::VIEW::FrameBufferFormat::getPixelFormat (  )  const [inline]

Returns pixel format of buffers in this format

References pixelFormat.

Referenced by BALL::VIEW::operator<<().

unsigned int BALL::VIEW::FrameBufferFormat::getWidth (  )  const [inline]

Returns width of writeable area of buffers in this format, in pixels.

References width.

Referenced by BALL::VIEW::operator<<().

bool BALL::VIEW::FrameBufferFormat::isValid (  )  const [inline]

References height, pitch, and width.

Referenced by computeSize().

bool BALL::VIEW::FrameBufferFormat::operator!= ( const FrameBufferFormat format  )  const [inline]

References height, pitch, pixelFormat, and width.

const FrameBufferFormat& BALL::VIEW::FrameBufferFormat::operator= ( const FrameBufferFormat format  )  [inline]

References height, pitch, pixelFormat, and width.

bool BALL::VIEW::FrameBufferFormat::operator== ( const FrameBufferFormat format  )  const [inline]

References height, pitch, pixelFormat, and width.

void BALL::VIEW::FrameBufferFormat::resize ( const unsigned int  newWidth,
const unsigned int  newHeight 
) [inline]

Modify width and height of this format

References height, and width.

const FrameBufferFormat BALL::VIEW::FrameBufferFormat::resized ( const unsigned int  newWidth,
const unsigned int  newHeight 
) const [inline]

Returns new FrameBufferFormat where width and height are replaced by specified values.

References FrameBufferFormat(), pitch, and pixelFormat.

void BALL::VIEW::FrameBufferFormat::setHeight ( unsigned int  height  )  [inline]

Sets height of buffers in this format, in pixels.

void BALL::VIEW::FrameBufferFormat::setPitch ( unsigned int  pitch  )  [inline]

Sets actual line width of buffers in this format, in bytes

void BALL::VIEW::FrameBufferFormat::setPixelFormat ( const PixelFormat pixelFormat  )  [inline]

Sets pixel format of buffers in this format

void BALL::VIEW::FrameBufferFormat::setWidth ( unsigned int  width  )  [inline]

Sets width of writeable area of buffers in this format, in pixels.


Member Data Documentation

unsigned int BALL::VIEW::FrameBufferFormat::height [private]

Height of buffers in this format, in pixels.

Referenced by getHeight(), isValid(), operator!=(), operator=(), operator==(), and resize().

unsigned int BALL::VIEW::FrameBufferFormat::pitch [private]

Actual line width of this buffer. You can compute the beginning of a line as firstPixel + pitch * lineNr. Unlike width and height, the pitch is measured in bytes. This may be needed in cases where the pitch is not a multiple of the byte size of a single pixel.

Referenced by FrameBufferFormat(), getPitch(), isValid(), operator!=(), operator=(), operator==(), and resized().

unsigned int BALL::VIEW::FrameBufferFormat::width [private]

Width of writeable area of this buffer, in pixels.

Referenced by getWidth(), isValid(), operator!=(), operator=(), operator==(), and resize().