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

Class definition of the GVA renderer. More...

#include <renderer_gva.h>

Inheritance diagram for gva::RendererGva:
Inheritance graph
Collaboration diagram for gva::RendererGva:
Collaboration graph

Public Member Functions

 RendererGva (uint32_t width, uint32_t height)
 Construct a new Renderer Gva object.
 
 ~RendererGva () override=default
 Destroy the Renderer Gva object.
 
void DrawLabels (char *text, uint32_t fontSize, uint32_t x, uint32_t y)
 Draw all the labels on the screen.
 
void DrawFunctionLabels (uint32_t x, const std::array< FunctionKeys::Labels, 6 > &labels)
 Draw all the labels on the screen.
 
void DrawTopLabels (uint32_t y, const std::array< FunctionSelect::Labels, 8 > &labels)
 Draw the labels on the top of the screen.
 
void DrawControlLabels (const uint32_t y, const std::array< CommonTaskKeys::Labels, 8 > &labels)
 Draw the control labels on the bottom of the screen.
 
void DrawIcon (widget::IconType icon, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 Draw an icon.
 
void DrawButton (const std::string &keytext, uint32_t fontSize, uint32_t x, uint32_t y, uint32_t size)
 Draw keyboard buttons.
 
void DrawButton (const std::string &key_text, uint32_t font_size, uint32_t x, uint32_t y, uint32_t height, uint32_t width, widget::CellAlignType align)
 Draw keyboard buttons.
 
TouchGvaGetTouch ()
 Get the Touch object.
 
- Public Member Functions inherited from gva::RendererCairo
 RendererCairo (uint32_t width, uint32_t height)
 Construct a new Renderer Cairo object.
 
 ~RendererCairo () override
 Destroy the Renderer Cairo object.
 
HandleTypeInit (uint32_t width, uint32_t height, bool fullscreen=false)
 Initalise the renderer with display parameters.
 
void SetPixel (uint32_t x, uint32_t y) override
 
void SetColour (uint8_t red, uint8_t green, uint8_t blue) override
 Set the Colour object.
 
void SetColour (uint32_t rgb)
 Set the Colour object.
 
void SetColourForeground (ColourType colour)
 Set the Colour Foreground object.
 
void SetColourForeground (uint8_t red, uint8_t green, uint8_t blue) override
 Set the Colour Foreground object.
 
void SetColourForeground (uint32_t rgb)
 Set the Colour Foreground object.
 
void SetColourBackground (ColourType colour)
 Set the Colour Background attribute.
 
void SetColourBackground (uint8_t red, uint8_t green, uint8_t blue) override
 Set the Colour Background object.
 
void SetColourBackground (uint32_t rgb)
 Set the Colour Background object.
 
void SetLineType (uint32_t type)
 Set the Line Type object.
 
void SetLineThickness (uint32_t thickness, LineType fill)
 Set the Line Thickness object.
 
void SetLineThickness (uint32_t thickness, LineType fill, LineCapEnd end)
 Set the Line Thickness object.
 
uint32_t MovePen (int32_t x, int32_t y)
 
uint32_t DrawPen (uint32_t x, uint32_t y, bool close)
 
uint32_t DrawPen (uint32_t x, uint32_t y)
 
uint32_t MovePenRaw (int32_t x, int32_t y)
 
uint32_t DrawPenRaw (int32_t x, int32_t y)
 
void DrawArcRaw (uint32_t x, uint32_t y, uint32_t radius, uint32_t angle1, uint32_t angle2)
 
uint32_t DrawLine (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2) override
 
void Save ()
 Save the current state of the renderer.
 
void Restore ()
 Restore the last saved state of the renderer.
 
void Scale (double x, double y)
 Scale the renderer.
 
void Translate (uint32_t x, uint32_t y)
 Translate the renderer.
 
void Rotate (double radians)
 Rotate the renderer.
 
uint32_t ClosePath (bool fill)
 Close drawing path.
 
void DrawCircle (uint32_t x, uint32_t y, uint32_t radius, bool fill) override
 Draw a circle.
 
void DrawRectangle (uint32_t x, uint32_t y, uint32_t width, uint32_t height, bool fill) override
 Draw a rectangle.
 
void DrawRoundedRectangle (uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t corner, bool fill)
 Draw a rounded rectangle.
 
void DrawTriangle (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t x3, uint32_t y3, bool fill)
 Draw a triangle.
 
uint32_t DrawColor (ColourType colour)
 Set the Colour object to draw with.
 
uint32_t DrawColor (uint8_t r, uint8_t g, uint8_t b) override
 Set the Colour object to draw with.
 
uint32_t CurveTo (uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t x3, uint32_t y3)
 Adds a cubic Bézier spline to the path from the current point to position (x3 , y3 ) in user-space coordinates, using (x1 , y1 ) and (x2 , y2 ) as the control points. After this call the current point will be (x3 , y3 ).
 
uint32_t DrawColor (uint32_t rgb)
 Set the draw colour.
 
void SetTextFont (uint32_t slope, widget::WeightType weight, std::string_view font_name, double size)
 Set the Text Font object.
 
void Push ()
 Push the current state of the renderer.
 
void Pop ()
 Pop the last saved state of the renderer.
 
uint32_t GetTextWidth (std::string_view str, uint32_t fontSize) const
 Get the Text Width object.
 
uint32_t GetTextHeight (std::string_view str, uint32_t fontSize) const
 Get the Text Height object.
 
void DrawString (uint32_t x, uint32_t y, std::string_view text)
 Draw some text on the screen.
 
void DrawLabel (uint32_t x, uint32_t y, std::string_view text)
 Draw an on screen label.
 
void DrawTextCentre (uint32_t x, std::string_view text, uint32_t size)
 Draw some text on the screen and centre it.
 
uint32_t TextureRGB (uint32_t x, uint32_t y, unsigned char *buffer, std::string_view file) override
 Set a texture (file) to use as a bitmap.
 
uint32_t TextureRGB (uint32_t x, uint32_t y, unsigned char *buffer)
 Set a texture (file) to use as a bitmap.
 
uint32_t TextureRGB (uint32_t x, uint32_t y, cairo_surface_t *surface)
 Set a texture (cairo surface) to use as a bitmap.
 
void Draw ()
 Redraw the screen.
 
void Reset ()
 Redraw the screen.
 
void SetHeight (uint32_t height) const
 Set the Height object.
 
void SetWidth (uint32_t width) const
 Set the Width object.
 
uint32_t GetHeight () const
 Get the Height object.
 
uint32_t GetWidth () const
 Get the Width object.
 
void SetSurface (cairo_surface_t *surface)
 Set the Surface attribute, used by application.
 
void DrawSurface (cairo_t *cr)
 Draw the new cairo surface to the screen.
 
void Configure (uint32_t height, uint32_t width)
 Configure the surface to use new dimensions.
 
- Public Member Functions inherited from gva::Renderer
 Renderer (uint32_t width, uint32_t height)
 Construct a new Renderer object.
 
virtual ~Renderer ()=default
 Destroy the Renderer object.
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from gva::RendererCairo
static void DestroySurface ()
 Destroy the current cairo surface, usually called during shutdown.
 
- Static Public Member Functions inherited from gva::Renderer
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 Public Attributes inherited from gva::RendererCairo
static HandleType render_
 Class definition of the HandleType.
 
- Static Protected Attributes inherited from gva::Renderer
static uint32_t height_ = kMinimumHeight
 The height of the renderer.
 
static uint32_t width_ = kMinimumWidth
 The width of the renderer.
 

Detailed Description

Class definition of the GVA renderer.

Constructor & Destructor Documentation

◆ RendererGva()

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

Construct a new Renderer Gva object.

Parameters
width
height

Member Function Documentation

◆ DrawButton() [1/2]

void gva::RendererGva::DrawButton ( const std::string &  key_text,
uint32_t  font_size,
uint32_t  x,
uint32_t  y,
uint32_t  height,
uint32_t  width,
widget::CellAlignType  align 
)

Draw keyboard buttons.

Parameters
key_textThe button text
font_sizeThe font size to be used
xX pixel position
yY pixel position
heightHeight of button in pixels
widthWidth of button in pixels
alignThe text alignment

◆ DrawButton() [2/2]

void gva::RendererGva::DrawButton ( const std::string &  keytext,
uint32_t  fontSize,
uint32_t  x,
uint32_t  y,
uint32_t  size 
)

Draw keyboard buttons.

Parameters
keytextThe button text
fontSizeThe font size to be used
xX pixel position
yY pixel position
sizeSize in pixels

◆ DrawControlLabels()

void gva::RendererGva::DrawControlLabels ( const uint32_t  y,
const std::array< CommonTaskKeys::Labels, 8 > &  labels 
)

Draw the control labels on the bottom of the screen.

Parameters
yThe y pixel position
labelsThe labels

◆ DrawFunctionLabels()

void gva::RendererGva::DrawFunctionLabels ( uint32_t  x,
const std::array< FunctionKeys::Labels, 6 > &  labels 
)

Draw all the labels on the screen.

Parameters
xposition of the labels, useful for labels on left and right sides of the screen
labelsArray of labels to be rendered

◆ DrawIcon()

void gva::RendererGva::DrawIcon ( widget::IconType  icon,
uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)

Draw an icon.

Parameters
iconThe type of icon to be rendered
xX pixel position
yY pixel position
widthWidth of the icon
heightHeight of the icon

◆ DrawLabels()

void gva::RendererGva::DrawLabels ( char *  text,
uint32_t  fontSize,
uint32_t  x,
uint32_t  y 
)

Draw all the labels on the screen.

Parameters
textThe text to go in the label
fontSizeThe font size
xX Position on the screen
yY Position on the screen

◆ DrawTopLabels()

void gva::RendererGva::DrawTopLabels ( uint32_t  y,
const std::array< FunctionSelect::Labels, 8 > &  labels 
)

Draw the labels on the top of the screen.

Parameters
yThe y pixel position
labelsThe labels

◆ GetTouch()

TouchGva * gva::RendererGva::GetTouch ( )
inline

Get the Touch object.

Returns
TouchGva*

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