Go to the documentation of this file.
38 #ifndef __BASE_PIXEL_HH__
39 #define __BASE_PIXEL_HH__
59 Pixel(uint8_t _red, uint8_t _green, uint8_t _blue)
71 return lhs.
red == rhs.
red &&
128 unsigned ro,
unsigned go,
unsigned bo,
129 unsigned rw,
unsigned gw,
unsigned bw,
169 uint32_t
readWord(
const uint8_t *
p)
const;
222 inline std::ostream &
229 #endif // __BASE_PIXEL_HH__
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)
float factor
Scaling factor when converting to the full range of an 8-bit color channel.
bool to_number(const std::string &value, Pixel &retval)
void fromPixel(uint8_t *rfb, const Pixel &pixel) const
Convert a pixel into a color word and store the resulting word in memory.
Configurable RGB pixel converter.
static const PixelConverter rgb565_be
Predefined 16-bit RGB565 (red in least significant bits, big endian) conversion helper.
Channel(unsigned offset, unsigned width)
uint8_t toPixel(uint32_t word) const
Get the value of a single color channel represented as an 8-bit number.
PixelConverter(unsigned length, unsigned ro, unsigned go, unsigned bo, unsigned rw, unsigned gw, unsigned bw, ByteOrder byte_order=ByteOrder::little)
static const PixelConverter rgba8888_le
Predefined 32-bit RGB (red in least significant bits, 8 bits/channel, little endian) conversion helpe...
Channel ch_g
Green channel conversion helper.
ByteOrder byte_order
Byte order when stored to memory.
Color channel conversion and scaling helper class.
Pixel toPixel(uint32_t word) const
Get the Pixel representation of a color word.
Pixel(uint8_t _red, uint8_t _green, uint8_t _blue)
void writeWord(uint8_t *p, uint32_t word) const
Write a word of a given length and endianness to memory.
unsigned length
Bytes per pixel when stored in memory (including padding)
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.
Internal gem5 representation of a Pixel.
Channel ch_b
Blue channel conversion helper.
bool operator==(const Pixel &lhs, const Pixel &rhs)
static const PixelConverter rgb565_le
Predefined 16-bit RGB565 (red in least significant bits, little endian) conversion helper.
std::ostream & operator<<(std::ostream &os, const Pixel &pxl)
unsigned offset
Offset in bits.
Channel ch_r
Red channel conversion helper.
uint32_t readWord(const uint8_t *p) const
Read a word of a given length and endianness from memory.
Pixel toPixel(const uint8_t *rfb) const
Get a Pixel representation by reading a word from memory.
std::string csprintf(const char *format, const Args &...args)
uint32_t fromPixel(const Pixel &pixel) const
Convert a Pixel into a color word.
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17