Class for managing pixel buffers.
|
| Graphics::PixelBuffer::PixelBuffer () |
|
| Graphics::PixelBuffer::PixelBuffer (const Graphics::PixelFormat &format, int buffersize, DisposeAfterUse::Flag dispose) |
|
| Graphics::PixelBuffer::PixelBuffer (const Graphics::PixelFormat &format, byte *buffer) |
|
| Graphics::PixelBuffer::PixelBuffer (const PixelBuffer &buf) |
|
| Graphics::PixelBuffer::~PixelBuffer () |
|
void | Graphics::PixelBuffer::create (const Graphics::PixelFormat &format, int buffersize, DisposeAfterUse::Flag dispose) |
|
void | Graphics::PixelBuffer::create (int buffersize, DisposeAfterUse::Flag dispose) |
|
void | Graphics::PixelBuffer::set (const Graphics::PixelFormat &format, byte *buffer) |
|
void | Graphics::PixelBuffer::free () |
|
void | Graphics::PixelBuffer::clear (uint length) |
|
void | Graphics::PixelBuffer::setPixelAt (int pixel, uint32 value) |
|
void | Graphics::PixelBuffer::setPixelAt (int pixel, const PixelBuffer &buf) |
|
void | Graphics::PixelBuffer::setPixelAt (int thisPix, const PixelBuffer &buf, int otherPix) |
|
void | Graphics::PixelBuffer::setPixelAt (int pixel, uint8 r, uint8 g, uint8 b) |
|
void | Graphics::PixelBuffer::setPixelAt (int pixel, uint8 a, uint8 r, uint8 g, uint8 b) |
|
void | Graphics::PixelBuffer::copyBuffer (int from, int length, const PixelBuffer &buf) |
|
void | Graphics::PixelBuffer::copyBuffer (int thisFrom, int otherFrom, int length, const PixelBuffer &buf) |
|
void | Graphics::PixelBuffer::shiftBy (int amount) |
|
uint32 | Graphics::PixelBuffer::getValueAt (int i) const |
|
void | Graphics::PixelBuffer::getRGBAt (int i, uint8 &r, uint8 &g, uint8 &b) const |
|
void | Graphics::PixelBuffer::getARGBAt (int i, uint8 &a, uint8 &r, uint8 &g, uint8 &b) const |
|
byte * | Graphics::PixelBuffer::getRawBuffer () const |
|
byte * | Graphics::PixelBuffer::getRawBuffer (int pixel) const |
|
const PixelFormat & | Graphics::PixelBuffer::getFormat () const |
|
PixelBuffer & | Graphics::PixelBuffer::operator= (const PixelBuffer &buf) |
|
PixelBuffer & | Graphics::PixelBuffer::operator= (byte *buffer) |
|
| Graphics::PixelBuffer::operator bool () const |
|
◆ PixelBuffer() [1/4]
Graphics::PixelBuffer::PixelBuffer |
( |
| ) |
|
◆ PixelBuffer() [2/4]
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, |
◆ PixelBuffer() [3/4]
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. |
◆ PixelBuffer() [4/4]
Graphics::PixelBuffer::PixelBuffer |
( |
const PixelBuffer & |
buf | ) |
|
Copy constructor. The internal buffer will NOT be duplicated, it will be shared between the instances.
◆ ~PixelBuffer()
Graphics::PixelBuffer::~PixelBuffer |
( |
| ) |
|
◆ create() [1/2]
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, |
◆ create() [2/2]
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, |
◆ set()
Initialize the buffer.
- Parameters
-
format | The format of the pixels in this buffer. |
buffer | The raw buffer containing the pixels. |
◆ free()
void Graphics::PixelBuffer::free |
( |
| ) |
|
Delete the internal pixel buffer.
◆ clear()
void Graphics::PixelBuffer::clear |
( |
uint |
length | ) |
|
Reset the value of the pixels.
- Parameters
-
length | The length of the buffer, in pixels. |
◆ setPixelAt() [1/5]
void Graphics::PixelBuffer::setPixelAt |
( |
int |
pixel, |
|
|
uint32 |
value |
|
) |
| |
|
inline |
Set the value of the pixel at index 'pixel' to 'value',
◆ setPixelAt() [2/5]
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. |
◆ setPixelAt() [3/5]
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'. |
◆ setPixelAt() [4/5]
void Graphics::PixelBuffer::setPixelAt |
( |
int |
pixel, |
|
|
uint8 |
r, |
|
|
uint8 |
g, |
|
|
uint8 |
b |
|
) |
| |
|
inline |
Set a pixel, from RGB values.
◆ setPixelAt() [5/5]
void Graphics::PixelBuffer::setPixelAt |
( |
int |
pixel, |
|
|
uint8 |
a, |
|
|
uint8 |
r, |
|
|
uint8 |
g, |
|
|
uint8 |
b |
|
) |
| |
|
inline |
Set a pixel, from ARGB values.
◆ copyBuffer() [1/2]
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. |
◆ copyBuffer() [2/2]
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. |
◆ shiftBy()
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.
◆ getValueAt()
uint32 Graphics::PixelBuffer::getValueAt |
( |
int |
i | ) |
const |
|
inline |
Return the encoded value of the pixel at the given index.
◆ getRGBAt()
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.
◆ getARGBAt()
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.
◆ getRawBuffer() [1/2]
byte* Graphics::PixelBuffer::getRawBuffer |
( |
| ) |
const |
|
inline |
Return the internal buffer.
◆ getRawBuffer() [2/2]
byte* Graphics::PixelBuffer::getRawBuffer |
( |
int |
pixel | ) |
const |
|
inline |
Return the internal buffer, pointing at the wanted pixel.
◆ getFormat()
const PixelFormat& Graphics::PixelBuffer::getFormat |
( |
| ) |
const |
|
inline |
Return the pixel format used.
◆ operator=() [1/2]
Copy a PixelBuffer object. The internal buffer will NOT be duplicated, it will be shared between the instances.
◆ operator=() [2/2]
PixelBuffer& Graphics::PixelBuffer::operator= |
( |
byte * |
buffer | ) |
|
Set the internal buffer to an already allocated array.
- Parameters
-
buffer | The pointer to the array. |
◆ operator bool()
Graphics::PixelBuffer::operator bool |
( |
| ) |
const |
|
inline |
Check if the interal buffer is allocated.
- Returns
- true if allocated.