13#ifndef HMICORE_RENDERER_H_
14#define HMICORE_RENDERER_H_
69 Renderer(uint32_t width, uint32_t height);
83 virtual void SetPixel(uint32_t x, uint32_t y) = 0;
92 virtual void SetColour(uint8_t red, uint8_t green, uint8_t blue) = 0;
149 virtual uint32_t
DrawLine(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2) = 0;
159 virtual void DrawCircle(uint32_t x, uint32_t y, uint32_t radius,
bool fill) = 0;
170 virtual void DrawRectangle(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2,
bool fill) = 0;
180 virtual uint32_t
DrawColor(uint8_t r, uint8_t g, uint8_t b) = 0;
191 virtual uint32_t
TextureRGB(uint32_t x, uint32_t y,
unsigned char* buffer, std::string_view file) = 0;
209 static uint32_t
PackRgb(uint8_t r, uint8_t g, uint8_t b);
217 uint32_t
UnpackRed(uint32_t rgb)
const {
return (rgb & 0xff0000) >> 16; }
225 uint32_t
UnpackGreen(uint32_t rgb)
const {
return (rgb & 0xff00) >> 8; }
233 uint32_t
UnpackBlue(uint32_t rgb)
const {
return rgb & 0xff; }
Class definition of the Renderer Cairo.
Definition renderer_cairo.h:82
Class defining the renderer.
Definition renderer.h:61
static uint32_t height_
The height of the renderer.
Definition renderer.h:245
virtual void DrawCircle(uint32_t x, uint32_t y, uint32_t radius, bool fill)=0
Draw a circle, set filled to true to have solid circle.
virtual void SetColour(uint8_t red, uint8_t green, uint8_t blue)=0
Set the Colour attribute.
virtual void DrawRectangle(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, bool fill)=0
Draw a rectangle, set filled to true to have solid rectangle.
RgbUnpackedType UnpackRgb(uint64_t rgb) const
Unpack red, green and blue values.
Definition renderer.cc:27
virtual uint32_t DrawColor(uint8_t r, uint8_t g, uint8_t b)=0
Set the draw colour.
uint32_t UnpackRed(uint32_t rgb) const
Unpack a red value.
Definition renderer.h:217
virtual ~Renderer()=default
Destroy the Renderer object.
uint32_t UnpackBlue(uint32_t rgb) const
Unpack a blue value.
Definition renderer.h:233
virtual uint32_t TextureRGB(uint32_t x, uint32_t y, unsigned char *buffer, std::string_view file)=0
Set the background texture to and RGB buffer (No Alpha channel)
virtual void SetPixel(uint32_t x, uint32_t y)=0
Set the Pixel attribute.
static void SetWidth(uint32_t width)
Set the Width attribute.
Definition renderer.h:131
static uint32_t PackRgb(ColourType colour)
Pack the colour to RGB.
Definition renderer.cc:35
uint32_t UnpackGreen(uint32_t rgb) const
Unpack a green value.
Definition renderer.h:225
virtual void SetColourBackground(uint8_t red, uint8_t green, uint8_t blue)=0
Set the Colour Background attribute.
static uint32_t width_
The width of the renderer.
Definition renderer.h:247
static void SetHeight(uint32_t height)
Set the Height attribute.
Definition renderer.h:138
virtual uint32_t DrawLine(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2)=0
Draw a straight line.
virtual void SetColourForeground(uint8_t red, uint8_t green, uint8_t blue)=0
Set the Colour Foreground attribute.
static uint32_t GetWidth()
Get the Width attribute.
Definition renderer.h:117
static uint32_t GetHeight()
Get the Height attribute.
Definition renderer.h:124
const gva::ColourType kHmiGrey
The RGB values for dark red.
Definition renderer.h:28
const gva::ColourType kHmiLightBlue
The RGB values for dark red.
Definition renderer.h:46
const gva::ColourType kHmiDarkGreen
The RGB values for dark red.
Definition renderer.h:36
const gva::ColourType kHmiYellow
The RGB values for dark red.
Definition renderer.h:50
const gva::ColourType kHmiBlue
The RGB values for dark red.
Definition renderer.h:40
const gva::ColourType kHmiWhite
The RGB values for white.
Definition renderer.h:24
const gva::ColourType kHmiAmber
The RGB values for amber.
Definition renderer.h:22
const gva::ColourType kHmiBlack
The RGB values for dark red.
Definition renderer.h:48
const gva::ColourType kHmiDarkGreen2
The RGB values for dark red.
Definition renderer.h:38
const gva::ColourType kHmiRed
The RGB values for red.
Definition renderer.h:26
const gva::ColourType kHmiGreen
The RGB values for dark red.
Definition renderer.h:34
const gva::ColourType kHmiCyan
The RGB values for dark red.
Definition renderer.h:42
const gva::ColourType kHmiDarkGrey
The RGB values for dark red.
Definition renderer.h:32
const gva::ColourType kHmiNone
The RGB values for dark red.
Definition renderer.h:54
const gva::ColourType kHmiMediumGrey
The RGB values for dark red.
Definition renderer.h:30
const gva::ColourType kHmiOrange
The RGB values for dark red.
Definition renderer.h:52
const gva::ColourType kHmiDarkBlue
The RGB values for dark red.
Definition renderer.h:44
Struct for the colour.
Definition gva.h:553
Struct for RGB values.
Definition gva.h:581