Pico Graphics is a tiny graphics library for 16-bit RGB565 displays.
It supports drawing text, primitive and individual pixels and includes basic types such as `rect` and `point` brimming with methods to help you develop games and applications.
Create pen takes R, G and B values, clamps them to 5, 6 and 5 bits respectively and joins them into a `uint16_t` pen that represents a single 16-bit colour.
Creating your pens up front and storing them as `uint16_t` can speed up switching colours.
#### set_clip & remove_clip
```c++
void PicoGraphics::set_clip(const rect &r);
void PicoGraphics::remove_clip();
```
`set_clip` applies a clipping rectangle to the drawing surface. Any pixels outside of this rectangle will not be drawn. By default drawing operations are clipped to `bounds` since it's impossible to draw outside of the buffer.
`remove_clip` sets the surface clipping rectangle back to the surface `bounds`.
### Pixels
#### pixel
```c++
void PicoGraphics::pixel(const point &p);
```
`pixel` sets the pixel at `point p` to the current `pen`.
#### pixel_span
```c++
void PicoGraphics::pixel_span(const point &p, int32_t l)
```
`pixel_span` draws a horizontal line of pixels of length `int32_t l` starting at `point p`.
### Primitives
#### rectangle
```c++
void PicoGraphics::rectangle(const rect &r) ;
```
`rectangle` draws a filled rectangle described by `rect`.
#### circle
```c++
PicoGraphics::circle(const point &p, int32_t radius)
```
`circle` draws a filled circle centered on `point p` with radius `int32_t radius`.
The 6x6 and 6x8 pixel font characters are encoded in `font6_data.hpp` and `font8_data.hpp` along with their character widths so that text can be drawn variable-width.