Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
gva::Renderer Class Referenceabstract

Class defining the renderer. More...

#include <renderer.h>

Inheritance diagram for gva::Renderer:
Inheritance graph
Collaboration diagram for gva::Renderer:
Collaboration graph

Public Member Functions

 Renderer (uint32_t width, uint32_t height)
 Construct a new Renderer object.
 
virtual ~Renderer ()=default
 Destroy the Renderer object.
 
virtual void SetPixel (uint32_t x, uint32_t y)=0
 Set the Pixel attribute.
 
virtual void SetColour (uint8_t red, uint8_t green, uint8_t blue)=0
 Set the Colour attribute.
 
virtual void SetColourForeground (uint8_t red, uint8_t green, uint8_t blue)=0
 Set the Colour Foreground attribute.
 
virtual void SetColourBackground (uint8_t red, uint8_t green, uint8_t blue)=0
 Set the Colour Background attribute.
 
virtual uint32_t DrawLine (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2)=0
 Draw a straight line.
 
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 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.
 
virtual uint32_t DrawColor (uint8_t r, uint8_t g, uint8_t b)=0
 Set the draw colour.
 
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)
 
uint32_t UnpackRed (uint32_t rgb) const
 Unpack a red value.
 
uint32_t UnpackGreen (uint32_t rgb) const
 Unpack a green value.
 
uint32_t UnpackBlue (uint32_t rgb) const
 Unpack a blue value.
 
RgbUnpackedType UnpackRgb (uint64_t rgb) const
 Unpack red, green and blue values.
 

Static Public Member Functions

static uint32_t GetWidth ()
 Get the Width attribute.
 
static uint32_t GetHeight ()
 Get the Height attribute.
 
static void SetWidth (uint32_t width)
 Set the Width attribute.
 
static void SetHeight (uint32_t height)
 Set the Height attribute.
 
static uint32_t PackRgb (ColourType colour)
 Pack the colour to RGB.
 
static uint32_t PackRgb (uint8_t r, uint8_t g, uint8_t b)
 Pack three red, green, blue values.
 

Static Protected Attributes

static uint32_t height_ = kMinimumHeight
 The height of the renderer.
 
static uint32_t width_ = kMinimumWidth
 The width of the renderer.
 

Friends

class RendererCairo
 The Cairo renderer.
 

Detailed Description

Class defining the renderer.

Constructor & Destructor Documentation

◆ Renderer()

gva::Renderer::Renderer ( uint32_t  width,
uint32_t  height 
)

Construct a new Renderer object.

Parameters
width
height

Member Function Documentation

◆ DrawCircle()

virtual void gva::Renderer::DrawCircle ( uint32_t  x,
uint32_t  y,
uint32_t  radius,
bool  fill 
)
pure virtual

Draw a circle, set filled to true to have solid circle.

Parameters
xThe X position
yThe Y position
radiusThe radius of the circle
fillSet to true to have a solid circle

Implemented in gva::RendererCairo.

◆ DrawColor()

virtual uint32_t gva::Renderer::DrawColor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)
pure virtual

Set the draw colour.

Parameters
rThe red value
gThe green value
bThe blue value
Returns
uint32_t

Implemented in gva::RendererCairo.

◆ DrawLine()

virtual uint32_t gva::Renderer::DrawLine ( uint32_t  x1,
uint32_t  y1,
uint32_t  x2,
uint32_t  y2 
)
pure virtual

Draw a straight line.

Parameters
x1The start X position
y1The start Y position
x2The end X position
y2The end Y position
Returns
uint32_t

Implemented in gva::RendererCairo.

◆ DrawRectangle()

virtual void gva::Renderer::DrawRectangle ( uint32_t  x1,
uint32_t  y1,
uint32_t  x2,
uint32_t  y2,
bool  fill 
)
pure virtual

Draw a rectangle, set filled to true to have solid rectangle.

Parameters
x1The start X position
y1The start Y position
x2The end X position
y2The end Y position
fillSet to true to have a solid rectangle

Implemented in gva::RendererCairo.

◆ GetHeight()

static uint32_t gva::Renderer::GetHeight ( )
inlinestatic

Get the Height attribute.

Returns
uint32_t

◆ GetWidth()

static uint32_t gva::Renderer::GetWidth ( )
inlinestatic

Get the Width attribute.

Returns
uint32_t

◆ PackRgb() [1/2]

uint32_t gva::Renderer::PackRgb ( ColourType  colour)
static

Pack the colour to RGB.

Parameters
colourThe value to pack
Returns
uint32_t

◆ PackRgb() [2/2]

uint32_t gva::Renderer::PackRgb ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)
static

Pack three red, green, blue values.

Parameters
rThe red value
gThe green value
bThe blue value
Returns
uint64_t The packed value

◆ SetColour()

virtual void gva::Renderer::SetColour ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
pure virtual

Set the Colour attribute.

Parameters
red
green
blue

Implemented in gva::RendererCairo.

◆ SetColourBackground()

virtual void gva::Renderer::SetColourBackground ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
pure virtual

Set the Colour Background attribute.

Parameters
red
green
blue

Implemented in gva::RendererCairo.

◆ SetColourForeground()

virtual void gva::Renderer::SetColourForeground ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
pure virtual

Set the Colour Foreground attribute.

Parameters
red
green
blue

Implemented in gva::RendererCairo.

◆ SetHeight()

static void gva::Renderer::SetHeight ( uint32_t  height)
inlinestatic

Set the Height attribute.

Parameters
heightThe height of the renderer

◆ SetPixel()

virtual void gva::Renderer::SetPixel ( uint32_t  x,
uint32_t  y 
)
pure virtual

Set the Pixel attribute.

Parameters
x
y

Implemented in gva::RendererCairo.

◆ SetWidth()

static void gva::Renderer::SetWidth ( uint32_t  width)
inlinestatic

Set the Width attribute.

Parameters
widthThe width of the renderer

◆ TextureRGB()

virtual uint32_t gva::Renderer::TextureRGB ( uint32_t  x,
uint32_t  y,
unsigned char *  buffer,
std::string_view  file 
)
pure virtual

Set the background texture to and RGB buffer (No Alpha channel)

Parameters
xThe X position
yThe Y position
bufferThe RGB buffer
fileThe file name
Returns
uint32_t The number of bytes written

Implemented in gva::RendererCairo.

◆ UnpackBlue()

uint32_t gva::Renderer::UnpackBlue ( uint32_t  rgb) const
inline

Unpack a blue value.

Parameters
rgb
Returns
uint32_t

◆ UnpackGreen()

uint32_t gva::Renderer::UnpackGreen ( uint32_t  rgb) const
inline

Unpack a green value.

Parameters
rgb
Returns
uint32_t

◆ UnpackRed()

uint32_t gva::Renderer::UnpackRed ( uint32_t  rgb) const
inline

Unpack a red value.

Parameters
rgb
Returns
uint32_t

◆ UnpackRgb()

RgbUnpackedType gva::Renderer::UnpackRgb ( uint64_t  rgb) const

Unpack red, green and blue values.

Parameters
rgb
Returns
RgbUnpackedType

The documentation for this class was generated from the following files: