mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-07-26 10:38:41 +00:00
c689c11838
* Unify the Rotation type, so that SetRotation can be used in
interfaces.
* Add Rotation() method to these displays, so that the current
rotation can be read.
* Change SetRotation() so that it can return an error (if the given
rotation isn't supported).
31 lines
597 B
Go
31 lines
597 B
Go
package drivers
|
|
|
|
import "image/color"
|
|
|
|
type Displayer interface {
|
|
// Size returns the current size of the display.
|
|
Size() (x, y int16)
|
|
|
|
// SetPizel modifies the internal buffer.
|
|
SetPixel(x, y int16, c color.RGBA)
|
|
|
|
// Display sends the buffer (if any) to the screen.
|
|
Display() error
|
|
}
|
|
|
|
// Rotation is how much a display has been rotated. Displays can be rotated, and
|
|
// sometimes also mirrored.
|
|
type Rotation uint8
|
|
|
|
// Clockwise rotation of the screen.
|
|
const (
|
|
Rotation0 = iota
|
|
Rotation90
|
|
Rotation180
|
|
Rotation270
|
|
Rotation0Mirror
|
|
Rotation90Mirror
|
|
Rotation180Mirror
|
|
Rotation270Mirror
|
|
)
|