img

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileType

type FileType uint
const (
	JPG FileType = iota
	GIF
	PNG
)

type Img

type Img struct {
	util.RenderObj
	File     FileType
	Animated bool
	Alpha    bool
	FilePath string
	Pixels   [][]Pixel
	Image    image.Image
	Fit      Scale
}

Image is an image file to be rendered to the Screen

func (*Img) Draw

func (i *Img) Draw()

Draw Renderable interface method

func (*Img) Hide

func (i *Img) Hide()

Hide Renderable interface method

func (*Img) Interrupt

func (i *Img) Interrupt() error

Interrupt Renderable interface method

func (*Img) RGBArray2Ascii

func (i *Img) RGBArray2Ascii(arr [][]Pixel) string

type Pixel

type Pixel struct {
	R   int
	G   int
	B   int
	A   int
	Str string
}

Pixel is an RGBA pixel value with a string

type QR

type QR struct {
	util.RenderObj
	Recovery qrcode.RecoveryLevel
	Size     int
	FGColor  string
	BGColor  string
	Value    string
	Content  string
}

QR is the type used by the QRFromxxx functions. for colors

func (*QR) BnWArray2Ascii

func (q *QR) BnWArray2Ascii(arr [][]Pixel, fg, bg string) (string, int, int)

func (*QR) Draw

func (q *QR) Draw()

func (*QR) Hide

func (q *QR) Hide()

func (*QR) Interrupt

func (q *QR) Interrupt() error

func (*QR) QRFromText

func (q *QR) QRFromText(s string) error

type Scale

type Scale uint
const (
	Fit Scale = iota
	FitHeight
	FitWidth
	Stretch
)

Jump to

Keyboard shortcuts

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