render

package
v0.0.0-...-3aeeb67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package render provides functionality to render images suitable for display on a limited size screen.

This package was originally developed with the Inky pHAT device in mind; its display is 212x104 pixels and supports up to three colors depending on the particular model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubwayClock

func SubwayClock(update models.FeedUpdate, stopID string, northLabel string, southLabel string) *image.RGBA

SubwayClock renders an image suitable for display as a subway clock. The output will be an image, 212 x 104, that has two sections: one for the stop in the "southbound" direction on the top section and one for the "northbound" direction in the bottom row.

Each section will be labelled with the input text labels. Below the text, this function will render the minutes until the next few trains will arrive, rounded up to the nearest minute.

If a train is about to arrive, it may render 0. Depending on the last update time, it is possible that some trains may have already departed. In that case, those trains will be skipped.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL