50 : pixels(
width * height),
51 _width(
width), _height(height)
57 : _width(0), _height(0)
101 static const Pixel black(0, 0, 0);
128 reinterpret_cast<const Bytef *
>(
pixels.data()),
std::vector< Pixel > pixels
Frame buffer backing store.
FrameBuffer()
Create an empty (0x0) frame buffer.
uint64_t getHash() const
Create a hash of the image that can be used for quick comparisons.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
unsigned _height
Height in pixels.
unsigned height() const
Frame buffer height in pixels.
void copyOut(uint8_t *fb, const PixelConverter &conv) const
Store the contents of this frame buffer in an external buffer of the same width and height as this fr...
void clear()
Fill the frame buffer with black pixels.
void fill(const Pixel &pixel)
Fill the frame buffer with a single pixel value.
void copyIn(const uint8_t *fb, const PixelConverter &conv)
Fill the frame buffer with pixel data from an external buffer of the same width and height as this fr...
unsigned _width
Width in pixels.
void resize(unsigned width, unsigned height)
Resize the frame buffer.
static const FrameBuffer dummy
Static "dummy" frame buffer.
const Pixel & pixel(unsigned x, unsigned y) const
Get a pixel from an (x, y) coordinate.
void serialize(CheckpointOut &cp) const override
Serialize an object.
unsigned width() const
Frame buffer width in pixels.
unsigned area() const
Total number of pixels in frame buffer.
Configurable RGB pixel converter.
Pixel toPixel(uint32_t word) const
Get the Pixel representation of a color word.
unsigned length
Bytes per pixel when stored in memory (including padding)
uint32_t fromPixel(const Pixel &pixel) const
Convert a Pixel into a color word.
#define UNSERIALIZE_CONTAINER(member)
#define SERIALIZE_CONTAINER(member)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)
Internal gem5 representation of a Pixel.