util

package
v0.0.0-...-17e2f5f Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Util

type Util struct {
}

func (*Util) DrawColourBars

func (_ *Util) DrawColourBars(gc *draw2dimg.GraphicContext, bounds util.Rectangle, cols ...color.Color) (float64, float64)

func (*Util) DrawColourBarsVertical

func (_ *Util) DrawColourBarsVertical(gc *draw2dimg.GraphicContext, bounds util.Rectangle, cols ...color.Color) (float64, float64)

func (*Util) DrawStringCenter

func (_ *Util) DrawStringCenter(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64

func (*Util) DrawStringLeft

func (_ *Util) DrawStringLeft(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64

func (*Util) DrawStringRight

func (_ *Util) DrawStringRight(gc *draw2dimg.GraphicContext, x, y float64, s string, a ...interface{}) float64

func (*Util) FitString

func (_ *Util) FitString(l, t, r, b, sl, st, sr, sb float64) (float64, float64, float64, float64)

func (*Util) FloatToA

func (_ *Util) FloatToA(v float64) string

func (*Util) GetImageFiles

func (_ *Util) GetImageFiles(dir string) ([]string, error)

GetImageFiles returns a list of image files from a directory. The results will be images which are supported and who's names are timestamps. The result will be sorted in the correct order.

func (*Util) GetStringBounds

func (_ *Util) GetStringBounds(gc *draw2dimg.GraphicContext, s string) util.Rectangle

func (*Util) NewGraphicContext

func (_ *Util) NewGraphicContext(img draw.Image) *draw2dimg.GraphicContext

func (*Util) ParseTime

func (_ *Util) ParseTime(s string) time.Time

func (*Util) ParseTimeIn

func (_ *Util) ParseTimeIn(s string, loc *time.Location) time.Time

func (*Util) Rect

func (_ *Util) Rect(x1, y1, x2, y2 float64) util.Rectangle

func (*Util) Sequence

func (_ *Util) Sequence(interval int, sourceFiles []string) *frames.FrameSet

func (*Util) SequenceIn

func (_ *Util) SequenceIn(interval int, sourceFiles []string, loc *time.Location) *frames.FrameSet

func (*Util) StringSize

func (_ *Util) StringSize(gc *draw2dimg.GraphicContext, s string, a ...interface{}) util.Rectangle

func (*Util) TimeFromFileName

func (_ *Util) TimeFromFileName(s string) time.Time

func (*Util) TimeFromFileNameIn

func (_ *Util) TimeFromFileNameIn(s string, loc *time.Location) time.Time

Jump to

Keyboard shortcuts

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