ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <pixelbuffer.h>

Collaboration diagram for Graphics::PixelBuffer:

List of all members.

Public Member Functions

 PixelBuffer ()
 Construct an empty PixelBuffer.
 PixelBuffer (const Graphics::PixelFormat &format, int buffersize, DisposeAfterUse::Flag dispose)
 Construct a PixelBuffer, allocating the internal buffer.
 PixelBuffer (const Graphics::PixelFormat &format, byte *buffer)
 Construct a PixelBuffer, using an already allocated buffer.
 PixelBuffer (const PixelBuffer &buf)
 Copy constructor.
 ~PixelBuffer ()
 Destroy the object.
void create (const Graphics::PixelFormat &format, int buffersize, DisposeAfterUse::Flag dispose)
 Initialize the buffer.
void create (int buffersize, DisposeAfterUse::Flag dispose)
 Initialize the buffer, using the already set pixel format.
void set (const Graphics::PixelFormat &format, byte *buffer)
 Initialize the buffer.
void free ()
 Delete the internal pixel buffer.
void clear (int length)
 Reset the value of the pixels.
void setPixelAt (int pixel, uint32 value)
 Set the value of the pixel at index 'pixel' to 'value',.
void setPixelAt (int pixel, const PixelBuffer &buf)
 Set the value of a pixel.
void setPixelAt (int thisPix, const PixelBuffer &buf, int otherPix)
 Set the value of a pixel.
void setPixelAt (int pixel, uint8 r, uint8 g, uint8 b)
 Set a pixel, from RGB values.
void setPixelAt (int pixel, uint8 a, uint8 r, uint8 g, uint8 b)
 Set a pixel, from ARGB values.
void copyBuffer (int from, int length, const PixelBuffer &buf)
 Copy some pixels from a buffer.
void copyBuffer (int thisFrom, int otherFrom, int length, const PixelBuffer &buf)
 Copy some pixels from a buffer.
void shiftBy (int amount)
 Shift the internal buffer of some pixels, losing some pixels at the start of the buffer.
uint32 getValueAt (int i) const
 Return the encoded value of the pixel at the given index.
void getRGBAt (int i, uint8 &r, uint8 &g, uint8 &b) const
 Return the RGB value of the pixel at the given index.
void getARGBAt (int i, uint8 &a, uint8 &r, uint8 &g, uint8 &b) const
 Return the ARGB value of the pixel at the given index.
bytegetRawBuffer () const
 Return the internal buffer.
bytegetRawBuffer (int pixel) const
 Return the internal buffer, pointing at the wanted pixel.
const PixelFormatgetFormat () const
 Return the pixel format used.
PixelBufferoperator= (const PixelBuffer &buf)
 Copy a PixelBuffer object.
PixelBufferoperator= (byte *buffer)
 Set the internal buffer to an already allocated array.
 operator bool () const
 Check if the interal buffer is allocated.

Static Public Member Functions

template<int format>
static PixelBuffer createBuffer (int buffersize, DisposeAfterUse::Flag dispose)
 Create a PixelBuffer.
template<int format>
static PixelBuffer createBuffer (byte *buffer)
 Create a PixelBuffer.

Private Attributes

byte_buffer
Graphics::PixelFormat _format
DisposeAfterUse::Flag _dispose

Detailed Description

Definition at line 35 of file pixelbuffer.h.


Constructor & Destructor Documentation

Graphics::PixelBuffer::PixelBuffer (  ) 

Construct an empty PixelBuffer.

Definition at line 27 of file pixelbuffer.cpp.

Graphics::PixelBuffer::PixelBuffer ( const Graphics::PixelFormat format,
int  buffersize,
DisposeAfterUse::Flag  dispose 
)

Construct a PixelBuffer, allocating the internal buffer.

Parameters:
format The format of the pixels in this buffer.
buffersize The number of pixels the buffer will store.
dispose If YES the internal buffer will be deleted when this object is destroyed,

Definition at line 33 of file pixelbuffer.cpp.

Graphics::PixelBuffer::PixelBuffer ( const Graphics::PixelFormat format,
byte buffer 
)

Construct a PixelBuffer, using an already allocated buffer.

Parameters:
format The format of the pixels in this buffer.
buffer The raw buffer containing the pixels.

Definition at line 39 of file pixelbuffer.cpp.

Graphics::PixelBuffer::PixelBuffer ( const PixelBuffer buf  ) 

Copy constructor.

The internal buffer will NOT be duplicated, it will be shared between the instances.

Definition at line 46 of file pixelbuffer.cpp.

Graphics::PixelBuffer::~PixelBuffer (  ) 

Destroy the object.

Definition at line 50 of file pixelbuffer.cpp.


Member Function Documentation

void Graphics::PixelBuffer::clear ( int  length  ) 

Reset the value of the pixels.

Parameters:
length The length of the buffer, in pixels.

Definition at line 85 of file pixelbuffer.cpp.

void Graphics::PixelBuffer::copyBuffer ( int  from,
int  length,
const PixelBuffer buf 
) [inline]

Copy some pixels from a buffer.

The pixels will be converted, storing the same ARGB value.

Parameters:
from The starting index.
length The number of pixels to copy.
buf The source buffer.

Definition at line 182 of file pixelbuffer.h.

void Graphics::PixelBuffer::copyBuffer ( int  thisFrom,
int  otherFrom,
int  length,
const PixelBuffer buf 
)

Copy some pixels from a buffer.

The pixels will be converted, storing the same ARGB value.

Parameters:
thisFrom The starting index.
otherFrom The starting index in the source buffer.
length The number of pixels to copy.
buf The source buffer.

Definition at line 89 of file pixelbuffer.cpp.

void Graphics::PixelBuffer::create ( int  buffersize,
DisposeAfterUse::Flag  dispose 
)

Initialize the buffer, using the already set pixel format.

Note:
If the pixel format was not set before the results are undefined.
Parameters:
buffersize The number of pixels the buffer will store.
dispose If YES the internal buffer will be deleted when this object is destroyed,

Definition at line 64 of file pixelbuffer.cpp.

void Graphics::PixelBuffer::create ( const Graphics::PixelFormat format,
int  buffersize,
DisposeAfterUse::Flag  dispose 
)

Initialize the buffer.

Parameters:
format The format of the pixels.
buffersize The number of pixels the buffer will store.
dispose If YES the internal buffer will be deleted when this object is destroyed,

Definition at line 55 of file pixelbuffer.cpp.

template<int format>
static PixelBuffer Graphics::PixelBuffer::createBuffer ( byte buffer  )  [inline, static]

Create a PixelBuffer.

Convenience syntax for PixelBuffer(createPixelFormat<format>(), buffer).

Definition at line 51 of file pixelbuffer.h.

template<int format>
static PixelBuffer Graphics::PixelBuffer::createBuffer ( int  buffersize,
DisposeAfterUse::Flag  dispose 
) [inline, static]

Create a PixelBuffer.

Convenience syntax for PixelBuffer(createPixelFormat<format>(), buffersize, dispose).

Definition at line 42 of file pixelbuffer.h.

void Graphics::PixelBuffer::free (  ) 

Delete the internal pixel buffer.

Definition at line 80 of file pixelbuffer.cpp.

void Graphics::PixelBuffer::getARGBAt ( int  i,
uint8 a,
uint8 r,
uint8 g,
uint8 b 
) const [inline]

Return the ARGB value of the pixel at the given index.

Definition at line 225 of file pixelbuffer.h.

const PixelFormat& Graphics::PixelBuffer::getFormat (  )  const [inline]

Return the pixel format used.

Definition at line 239 of file pixelbuffer.h.

byte* Graphics::PixelBuffer::getRawBuffer (  )  const [inline]

Return the internal buffer.

Definition at line 230 of file pixelbuffer.h.

byte* Graphics::PixelBuffer::getRawBuffer ( int  pixel  )  const [inline]

Return the internal buffer, pointing at the wanted pixel.

Definition at line 234 of file pixelbuffer.h.

void Graphics::PixelBuffer::getRGBAt ( int  i,
uint8 r,
uint8 g,
uint8 b 
) const [inline]

Return the RGB value of the pixel at the given index.

Definition at line 221 of file pixelbuffer.h.

uint32 Graphics::PixelBuffer::getValueAt ( int  i  )  const [inline]

Return the encoded value of the pixel at the given index.

Definition at line 202 of file pixelbuffer.h.

Graphics::PixelBuffer::operator bool (  )  const [inline]

Check if the interal buffer is allocated.

Returns:
true if allocated.

Definition at line 258 of file pixelbuffer.h.

PixelBuffer & Graphics::PixelBuffer::operator= ( const PixelBuffer buf  ) 

Copy a PixelBuffer object.

The internal buffer will NOT be duplicated, it will be shared between the instances.

Definition at line 101 of file pixelbuffer.cpp.

PixelBuffer & Graphics::PixelBuffer::operator= ( byte buffer  ) 

Set the internal buffer to an already allocated array.

Parameters:
buffer The pointer to the array.

Definition at line 109 of file pixelbuffer.cpp.

void Graphics::PixelBuffer::set ( const Graphics::PixelFormat format,
byte buffer 
)

Initialize the buffer.

Parameters:
format The format of the pixels in this buffer.
buffer The raw buffer containing the pixels.

Definition at line 72 of file pixelbuffer.cpp.

void Graphics::PixelBuffer::setPixelAt ( int  thisPix,
const PixelBuffer buf,
int  otherPix 
) [inline]

Set the value of a pixel.

The pixel will be converted from a pixel in another PixelBuffer.

Parameters:
thisPix The index of the pixel to set.
buf The buffer storing the source pixel.
otherPix The index of the source pixel in 'buf'.

Definition at line 157 of file pixelbuffer.h.

void Graphics::PixelBuffer::setPixelAt ( int  pixel,
uint8  a,
uint8  r,
uint8  g,
uint8  b 
) [inline]

Set a pixel, from ARGB values.

Definition at line 173 of file pixelbuffer.h.

void Graphics::PixelBuffer::setPixelAt ( int  pixel,
uint8  r,
uint8  g,
uint8  b 
) [inline]

Set a pixel, from RGB values.

Definition at line 169 of file pixelbuffer.h.

void Graphics::PixelBuffer::setPixelAt ( int  pixel,
uint32  value 
) [inline]

Set the value of the pixel at index 'pixel' to 'value',.

Definition at line 124 of file pixelbuffer.h.

void Graphics::PixelBuffer::setPixelAt ( int  pixel,
const PixelBuffer buf 
) [inline]

Set the value of a pixel.

The pixel will be converted from a pixel in another PixelBuffer, at the same index.

Parameters:
pixel The index of the pixel to set.
buf The buffer storing the source pixel.

Definition at line 149 of file pixelbuffer.h.

void Graphics::PixelBuffer::shiftBy ( int  amount  )  [inline]

Shift the internal buffer of some pixels, losing some pixels at the start of the buffer.

The pixels lost will NOT be deleted.

Definition at line 197 of file pixelbuffer.h.


Member Data Documentation

Definition at line 261 of file pixelbuffer.h.


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


Generated on Sat Mar 23 2019 05:07:23 for ResidualVM by doxygen 1.7.1
curved edge   curved edge