38#ifndef __BASE_PIXEL_HH__
39#define __BASE_PIXEL_HH__
63 Pixel(uint8_t _red, uint8_t _green, uint8_t _blue)
75 return lhs.
red == rhs.
red &&
133 unsigned ro,
unsigned go,
unsigned bo,
134 unsigned rw,
unsigned gw,
unsigned bw,
174 uint32_t
readWord(
const uint8_t *
p)
const;
181 void writeWord(uint8_t *
p, uint32_t word)
const;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Configurable RGB pixel converter.
static const PixelConverter rgb565_be
Predefined 16-bit RGB565 (red in least significant bits, big endian) conversion helper.
ByteOrder byte_order
Byte order when stored to memory.
static const PixelConverter rgba8888_le
Predefined 32-bit RGB (red in least significant bits, 8 bits/channel, little endian) conversion helpe...
Pixel toPixel(uint32_t word) const
Get the Pixel representation of a color word.
Channel ch_b
Blue channel conversion helper.
PixelConverter(unsigned length, unsigned ro, unsigned go, unsigned bo, unsigned rw, unsigned gw, unsigned bw, ByteOrder byte_order=ByteOrder::little)
unsigned depth
Number of bits used to represent one pixel value (excluding padding).
static const PixelConverter rgba8888_be
Predefined 32-bit RGB (red in least significant bits, 8 bits/channel, big endian) conversion helper.
static const PixelConverter rgb565_le
Predefined 16-bit RGB565 (red in least significant bits, little endian) conversion helper.
unsigned length
Bytes per pixel when stored in memory (including padding)
void writeWord(uint8_t *p, uint32_t word) const
Write a word of a given length and endianness to memory.
Channel ch_r
Red channel conversion helper.
void fromPixel(uint8_t *rfb, const Pixel &pixel) const
Convert a pixel into a color word and store the resulting word in memory.
uint32_t readWord(const uint8_t *p) const
Read a word of a given length and endianness from memory.
uint32_t fromPixel(const Pixel &pixel) const
Convert a Pixel into a color word.
Pixel toPixel(const uint8_t *rfb) const
Get a Pixel representation by reading a word from memory.
Channel ch_g
Green channel conversion helper.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
bool to_number(const std::string &value, Pixel &retval)
static bool operator==(const PCStateBase &a, const PCStateBase &b)
static std::ostream & operator<<(std::ostream &os, const DummyMatRegContainer &d)
std::string csprintf(const char *format, const Args &...args)
Color channel conversion and scaling helper class.
float factor
Scaling factor when converting to the full range of an 8-bit color channel.
uint8_t toPixel(uint32_t word) const
Get the value of a single color channel represented as an 8-bit number.
unsigned offset
Offset in bits.
uint32_t fromPixel(uint8_t ch) const
Convert an 8-bit representation of a color into an external format.
unsigned mask
Bit mask (after shifting)
Channel(unsigned offset, unsigned width)
Internal gem5 representation of a Pixel.
Pixel(uint8_t _red, uint8_t _green, uint8_t _blue)