rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
ui_icons.c File Reference

The menu icons, drawn from primitives rather than stored as bitmaps. More...

#include "ui_icons.h"
#include <math.h>
#include "ui_theme.h"

Functions

static void ring (gfx_canvas_t *c, int cx, int cy, int outer, int thick, gfx_color_t color)
 A ring of thick circles inward from radius outer.
void ui_icon_motor (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The motor glyph: a stator ring and its hub.
void ui_icon_servo (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The servo glyph: a case and its horn.
void ui_icon_chart (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The chart glyph: a trace over its axes.
void ui_icon_record (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The record glyph: a recorder with its tray.
void ui_icon_chip (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The chip glyph: a package and its pins.
void ui_icon_sliders (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The settings glyph: three sliders.
void ui_icon_battery (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The battery glyph: a cell with its terminal and three bars.
void ui_icon_balance (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The balance glyph: a disc with an off-centre mass and two correction ticks.
void ui_icon_supply (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The supply glyph: a bench supply's front.
void ui_icon_list (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The pin list glyph: three rows, each a pin and its line.
void ui_icon_board (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The board glyph: a board from above with its pads.
void ui_icon_wifi (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 The Wi-Fi glyph: arcs over a dot.
void ui_icon_folder (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 A folder: its tab and its body.
void ui_icon_file (gfx_canvas_t *c, int x, int y, int size, gfx_color_t color)
 A page of a file, its corner folded.

Detailed Description

The menu icons, drawn from primitives rather than stored as bitmaps.

Each icon is a few rings, capsules and strokes scaled to the requested size. A drawn icon is sharp at any size and needs no image data in flash. Every icon is drawn centred on the point it is given, inside a box of size x size px around it.

SPDX-License-Identifier: MIT

Function Documentation

◆ ring()

void ring ( gfx_canvas_t * c,
int cx,
int cy,
int outer,
int thick,
gfx_color_t color )
static

A ring of thick circles inward from radius outer.

Parameters
cthe canvas
cxthe centre, x
cythe centre, y
outerthe outer radius, px
thickthe ring's width, px
colorthe colour

◆ ui_icon_balance()

void ui_icon_balance ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The balance glyph: a disc with an off-centre mass and two correction ticks.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_battery()

void ui_icon_battery ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The battery glyph: a cell with its terminal and three bars.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_board()

void ui_icon_board ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The board glyph: a board from above with its pads.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_chart()

void ui_icon_chart ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The chart glyph: a trace over its axes.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_chip()

void ui_icon_chip ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The chip glyph: a package and its pins.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_file()

void ui_icon_file ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

A page of a file, its corner folded.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_folder()

void ui_icon_folder ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

A folder: its tab and its body.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_list()

void ui_icon_list ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The pin list glyph: three rows, each a pin and its line.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_motor()

void ui_icon_motor ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The motor glyph: a stator ring and its hub.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_record()

void ui_icon_record ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The record glyph: a recorder with its tray.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_servo()

void ui_icon_servo ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The servo glyph: a case and its horn.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_sliders()

void ui_icon_sliders ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The settings glyph: three sliders.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_supply()

void ui_icon_supply ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The supply glyph: a bench supply's front.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour

◆ ui_icon_wifi()

void ui_icon_wifi ( gfx_canvas_t * c,
int x,
int y,
int size,
gfx_color_t color )

The Wi-Fi glyph: arcs over a dot.

Parameters
cthe canvas
xthe icon's centre, x
ythe icon's centre, y
sizethe box's side, px
colorthe colour