22 #ifndef GRAPHICS_PIXELBUFFER_H 23 #define GRAPHICS_PIXELBUFFER_H 25 #include "common/types.h" 26 #include "common/endian.h" 27 #include "common/textconsole.h" 29 #include "graphics/pixelformat.h" 88 void create(
int buffersize, DisposeAfterUse::Flag dispose);
108 void clear(uint length);
116 ((uint16 *) _buffer)[pixel] = value;
120 #if defined(SCUMM_BIG_ENDIAN) 121 _buffer[pixel + 0] = (value >> 16) & 0xFF;
122 _buffer[pixel + 1] = (value >> 8) & 0xFF;
123 _buffer[pixel + 2] = value & 0xFF;
124 #elif defined(SCUMM_LITTLE_ENDIAN) 125 _buffer[pixel + 0] = value & 0xFF;
126 _buffer[pixel + 1] = (value >> 8) & 0xFF;
127 _buffer[pixel + 2] = (value >> 16) & 0xFF;
131 ((uint32 *) _buffer)[pixel] = value;
152 if (_format == buf._format) {
199 return ((uint16 *) _buffer)[i];
202 #if defined(SCUMM_BIG_ENDIAN) 203 return (_buffer[i + 0] << 16) | (_buffer[i + 1] << 8) | _buffer[i + 2];
204 #elif defined(SCUMM_LITTLE_ENDIAN) 205 return _buffer[i + 0] | (_buffer[i + 1] << 8) | (_buffer[i + 2] << 16);
208 return ((uint32 *) _buffer)[i];
252 inline operator bool()
const {
return (_buffer); }
257 DisposeAfterUse::Flag _dispose;
PixelBuffer & operator=(const PixelBuffer &buf)
void getARGBAt(int i, uint8 &a, uint8 &r, uint8 &g, uint8 &b) const
Definition: pixelbuffer.h:219
void setPixelAt(int pixel, const PixelBuffer &buf)
Definition: pixelbuffer.h:143
void shiftBy(int amount)
Definition: pixelbuffer.h:191
byte * getRawBuffer(int pixel) const
Definition: pixelbuffer.h:228
const PixelFormat & getFormat() const
Definition: pixelbuffer.h:233
void setPixelAt(int pixel, uint8 r, uint8 g, uint8 b)
Definition: pixelbuffer.h:163
void setPixelAt(int pixel, uint32 value)
Definition: pixelbuffer.h:113
void setPixelAt(int pixel, uint8 a, uint8 r, uint8 g, uint8 b)
Definition: pixelbuffer.h:167
Definition: pixelbuffer.h:42
void copyBuffer(int from, int length, const PixelBuffer &buf)
Definition: pixelbuffer.h:176
void setPixelAt(int thisPix, const PixelBuffer &buf, int otherPix)
Definition: pixelbuffer.h:151
Definition: formatinfo.h:28
void create(const Graphics::PixelFormat &format, int buffersize, DisposeAfterUse::Flag dispose)
void getRGBAt(int i, uint8 &r, uint8 &g, uint8 &b) const
Definition: pixelbuffer.h:215
uint32 getValueAt(int i) const
Definition: pixelbuffer.h:196
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
byte * getRawBuffer() const
Definition: pixelbuffer.h:224