painter

package
v0.0.0-...-fe96c7b Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufPainter

type BufPainter struct {
	OnInit func(InitOP)
	// contains filtered or unexported fields
}

func New

func New() (*BufPainter, error)

func (*BufPainter) HandleOP

func (p *BufPainter) HandleOP(op interface{}) error

func (*BufPainter) HandleRaw

func (p *BufPainter) HandleRaw(msg []byte) error

func (*BufPainter) Height

func (p *BufPainter) Height() int

func (*BufPainter) ImageData

func (p *BufPainter) ImageData() []byte

func (*BufPainter) Init

func (p *BufPainter) Init(op InitOP)

func (*BufPainter) Line

func (p *BufPainter) Line(op LineOP)

func (*BufPainter) Set

func (p *BufPainter) Set(buf []byte)

func (*BufPainter) Text

func (p *BufPainter) Text(op TextOP)

func (*BufPainter) Width

func (p *BufPainter) Width() int

type FontCache

type FontCache map[string]*truetype.Font

func (FontCache) Load

func (f FontCache) Load(fd draw2d.FontData) (*truetype.Font, error)

func (*FontCache) Store

func (f *FontCache) Store(fd draw2d.FontData, tf *truetype.Font)

type InitOP

type InitOP struct {
	Width, Height int
	Data          []byte
}

This ops will be marshalled with the wrapper struct

type LineOP

type LineOP struct {
	Color  color.RGBA
	Width  float64
	X1, Y1 float64
	X2, Y2 float64
}

type Message

type Message struct {
	Payload interface{}
}

OP Wrapper

func (Message) MarshalJSON

func (m Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(raw []byte) error

type TextOP

type TextOP struct {
	Color color.RGBA
	Size  float64
	X, Y  float64
	Text  string
}

Directories

Path Synopsis
Package font -- Generated by folder2go (http://github.com/gohxs/folder2go)
Package font -- Generated by folder2go (http://github.com/gohxs/folder2go)

Jump to

Keyboard shortcuts

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