Libraries/Graphics/src/include/Graphics/Types.h File Reference
#include <WString.h>
#include <Data/CStringArray.h>
#include <Data/BitSet.h>
#include <Data/Range.h>
#include <memory>
#include <cassert>
#include "Colors.h"
Include dependency graph for Libraries/Graphics/src/include/Graphics/Types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Graphics::Size
 Size of rectangular area (width x height) More...
 
struct  Graphics::TPoint< T >
 An (x, y) display coordinate. More...
 
struct  Graphics::Rect
 Location and size of rectangular area (x, y, w, h) More...
 
class  Graphics::Region
 Represents the intersection of two rectangles. More...
 
struct  Graphics::Location
 Identifies position within bounding rectangle. More...
 
class  Graphics::ColorRange
 
class  Graphics::Scale
 
struct  Graphics::GlyphMetrics
 Glyph metrics. More...
 

Namespaces

 Graphics
 

Macros

#define GRAPHICS_FONT_STYLE(XX)
 
#define XX(name, desc)   name,
 

Typedefs

using Graphics::AssetID = uint16_t
 Numeric identifiers for re-useable objects. More...
 
using Graphics::Point = TPoint< int16_t >
 
using Graphics::IntPoint = TPoint< int >
 
using Graphics::PointF = TPoint< float >
 
using Graphics::Range = TRange< uint16_t >
 
using Graphics::FontStyles = BitSet< uint16_t, FontStyle, 10 >
 

Enumerations

enum  Graphics::Orientation {
  Graphics::Orientation::normal, Graphics::Orientation::deg0 = normal, Graphics::Orientation::deg90, Graphics::Orientation::deg180,
  Graphics::Orientation::deg270
}
 Defines orientation of display. More...
 
enum  Graphics::Align {
  Graphics::Align::Near, Graphics::Align::Centre, Graphics::Align::Far, Graphics::Align::Left = Near,
  Graphics::Align::Top = Near, Graphics::Align::Center = Centre, Graphics::Align::Right = Far, Graphics::Align::Bottom = Far
}
 
enum  Graphics::Origin {
  Graphics::Origin::E, Graphics::Origin::NE, Graphics::Origin::N, Graphics::Origin::NW,
  Graphics::Origin::W, Graphics::Origin::SW, Graphics::Origin::S, Graphics::Origin::SE,
  Graphics::Origin::Centre, Graphics::Origin::TopLeft = NW, Graphics::Origin::Top = N, Graphics::Origin::TopRight = NE,
  Graphics::Origin::Left = W, Graphics::Origin::Center = Centre, Graphics::Origin::Right = E, Graphics::Origin::BottomLeft = SW,
  Graphics::Origin::Bottom = S, Graphics::Origin::BottomRight = SE
}
 Points on a compass. More...
 
enum  Graphics::FontStyle { Graphics::FontStyle::XX }
 

Functions

Origin Graphics::opposite (Origin o)
 Get the origin for the opposite side of the rectangle. More...
 
constexpr Size Graphics::rotate (Size size, Orientation orientation)
 
template<typename T , typename Q >
constexpr TPoint< T > Graphics::operator+ (TPoint< T > pt, const Q &other)
 
template<typename T , typename Q >
constexpr TPoint< T > Graphics::operator- (TPoint< T > pt, const Q &other)
 
template<typename T , typename Q >
constexpr TPoint< T > Graphics::operator* (TPoint< T > pt, const Q &other)
 
template<typename T >
constexpr TPoint< T > Graphics::operator* (TPoint< T > pt, const Size &other)
 
template<typename T , typename Q >
constexpr TPoint< T > Graphics::operator/ (TPoint< T > pt, const Q &other)
 
template<typename T >
constexpr TPoint< T > Graphics::operator/ (TPoint< T > pt, const Size &other)
 
template<typename T , typename Q >
constexpr TPoint< T > Graphics::operator% (TPoint< T > pt, const Q &other)
 
template<typename T >
Rect Graphics::operator+ (const Rect &rect, const T &other)
 
Rect Graphics::operator- (const Rect &rect, const Point &offset)
 
Rect Graphics::intersect (Rect r1, const Rect &r2)
 
Region Graphics::operator- (const Region &rgn, const Rect &r)
 
uint16_t Graphics::originToDegrees (Origin origin)
 Get corresponding angle for given origin. More...
 
Origin Graphics::degreesToOrigin (uint16_t angle)
 Get origin closest to given angle (expressed in degrees) More...
 
uint16_t Graphics::normaliseAngle (int angle)
 Make 0 <= angle < 360. More...
 
String toString (Graphics::Orientation orientation)
 
String toString (Graphics::Align align)
 
String toString (Graphics::Origin origin)
 
String toString (Graphics::FontStyle style)
 
template<typename T >
String toString (Graphics::TPoint< T > pt)
 
String toString (const Graphics::Rect &r)
 
String toString (const Graphics::Location &loc)
 
String toString (Graphics::Size sz)
 
String toString (Graphics::Scale scale)
 

Variables

static constexpr uint8_t Graphics::PIN_NONE {255}
 Undefined I/O pin value. More...
 

Macro Definition Documentation

◆ GRAPHICS_FONT_STYLE

#define GRAPHICS_FONT_STYLE (   XX)
Value:
XX(Bold, "") \
XX(Italic, "") \
XX(Underscore, "") \
XX(Overscore, "") \
XX(Strikeout, "") \
XX(DoubleUnderscore, "") \
XX(DoubleOverscore, "") \
XX(DoubleStrikeout, "") \
XX(DotMatrix, "Draw only top-left dot in scaled glyphs") \
XX(HLine, "Draw only top line in scaled glyphs") \
XX(VLine, "Draw only left line in scaled glyphs")

◆ XX

#define XX (   name,
  desc 
)    name,

Function Documentation

◆ toString() [1/9]

String toString ( const Graphics::Location loc)
inline

◆ toString() [2/9]

String toString ( const Graphics::Rect r)
inline

◆ toString() [3/9]

String toString ( Graphics::Align  align)

◆ toString() [4/9]

String toString ( Graphics::FontStyle  style)

◆ toString() [5/9]

String toString ( Graphics::Orientation  orientation)

◆ toString() [6/9]

String toString ( Graphics::Origin  origin)

◆ toString() [7/9]

String toString ( Graphics::Scale  scale)
inline

◆ toString() [8/9]

String toString ( Graphics::Size  sz)
inline

◆ toString() [9/9]

template<typename T >
String toString ( Graphics::TPoint< T >  pt)
inline
#define XX(name, desc)
Definition: Libraries/Graphics/src/include/Graphics/Types.h:847