libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiPath Struct Reference

A closed outline made of straight lines and cubic Beziers, in whatever units the caller likes. More...

#include <GuiGeometry.h>

Public Types

enum  CMD : uint8_t { MOVE = 'M' , LINE = 'L' , CUBIC = 'C' , CLOSE = 'Z' }
 

Public Member Functions

bool empty () const
 Checks whether the path has no commands.
 
GuiPath & moveTo (float x, float y)
 
GuiPath & lineTo (float x, float y)
 
GuiPath & cubicTo (float x1, float y1, float x2, float y2, float x, float y)
 
GuiPath & close ()
 

Public Attributes

std::vector< uint8_t > cmds
 One CMD per segment.
 
std::vector< float > pts
 x, y pairs, as many as the commands consume.
 

Detailed Description

A closed outline made of straight lines and cubic Beziers, in whatever units the caller likes.

It is how a silhouette that is not a handful of rounded rectangles is stored (the controller outlines converted from SVG are lists of these). Commands: MOVE starts a contour (1 point), LINE draws to a point (1), CUBIC draws a cubic Bezier (3: two control points, then the end), CLOSE ends the contour (0). Points are stored flat as x, y pairs.

Definition at line 81 of file GuiGeometry.h.

Member Enumeration Documentation

◆ CMD

enum GuiPath::CMD : uint8_t

Definition at line 82 of file GuiGeometry.h.

Member Function Documentation

◆ close()

GuiPath & GuiPath::close ( )
inline

Definition at line 96 of file GuiGeometry.h.

◆ cubicTo()

GuiPath & GuiPath::cubicTo ( float x1,
float y1,
float x2,
float y2,
float x,
float y )
inline

Definition at line 90 of file GuiGeometry.h.

◆ empty()

bool GuiPath::empty ( ) const
inline

Checks whether the path has no commands.

Definition at line 87 of file GuiGeometry.h.

◆ lineTo()

GuiPath & GuiPath::lineTo ( float x,
float y )
inline

Definition at line 89 of file GuiGeometry.h.

◆ moveTo()

GuiPath & GuiPath::moveTo ( float x,
float y )
inline

Definition at line 88 of file GuiGeometry.h.

Member Data Documentation

◆ cmds

std::vector<uint8_t> GuiPath::cmds

One CMD per segment.

Definition at line 83 of file GuiGeometry.h.

◆ pts

std::vector<float> GuiPath::pts

x, y pairs, as many as the commands consume.

Definition at line 84 of file GuiGeometry.h.


The documentation for this struct was generated from the following file: