table

package
v0.0.0-...-e89c278 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Green  = drawing.Color{R: 126, G: 190, B: 171, A: 255}
	Yellow = drawing.Color{R: 243, G: 191, B: 136, A: 255}
	Red    = drawing.Color{R: 240, G: 145, B: 153, A: 255}
	Gray   = drawing.Color{R: 243, G: 243, B: 242, A: 255}
	Purple = drawing.Color{R: 112, G: 88, B: 163, A: 255}
)
View Source
var FontList []*truetype.Font

Functions

func AddFontWithBuf

func AddFontWithBuf(fontBuf []byte) error

func AddFontWithPath

func AddFontWithPath(path string) error

func AddFontWithPathInFs

func AddFontWithPathInFs(path string, fsys fs.FS) error

func AddFount

func AddFount(f *truetype.Font)

func DrawFont

func DrawFont(dst *image.RGBA, src image.Image, x, y float64, label string, fontSize float64)

func DrawRectangleColor

func DrawRectangleColor(img *image.RGBA, color color.Color, x, y, wight, high float64)

func FontLen

func FontLen(str string) float64

Types

type Alignment

type Alignment int
const (
	AlignLeft Alignment = iota
	AlignCenter
	AlignRight
)

type Cell

type Cell interface {
	DrawImg(x, y float64, img *image.RGBA) error
	MinSize() *Size

	Size() *Size
	// contains filtered or unexported methods
}

type CellsLine

type CellsLine interface {
	Line
	RangeCell(func(idx int, cell Cell) error) error
	Cols() int32
}

type FlowCurve

type FlowCurve struct {
	// contains filtered or unexported fields
}

func NewFlowCurve

func NewFlowCurve() *FlowCurve

func (*FlowCurve) AddData

func (p *FlowCurve) AddData(data ...float64) *FlowCurve

func (*FlowCurve) DrawImg

func (p *FlowCurve) DrawImg(x, y float64, img *image.RGBA) error

func (*FlowCurve) IsFull

func (p *FlowCurve) IsFull() bool

func (*FlowCurve) MinSize

func (p *FlowCurve) MinSize() *Size

func (*FlowCurve) SetBgColor

func (p *FlowCurve) SetBgColor(color color.Color) *FlowCurve

func (*FlowCurve) SetFgColor

func (p *FlowCurve) SetFgColor(color color.Color) *FlowCurve

func (*FlowCurve) SetFull

func (p *FlowCurve) SetFull(i bool) *FlowCurve

func (*FlowCurve) Size

func (p *FlowCurve) Size() *Size

type FlowGraph

type FlowGraph interface {
	Cell

	AddData(data ...float64) FlowGraph
}

type FlowHistogram

type FlowHistogram struct {
	// contains filtered or unexported fields
}

func NewFlowHistogram

func NewFlowHistogram() *FlowHistogram

func (*FlowHistogram) AddData

func (p *FlowHistogram) AddData(data ...float64) *FlowHistogram

func (*FlowHistogram) DrawImg

func (p *FlowHistogram) DrawImg(x, y float64, img *image.RGBA) error

func (*FlowHistogram) IsFull

func (p *FlowHistogram) IsFull() bool

func (*FlowHistogram) MinSize

func (p *FlowHistogram) MinSize() *Size

func (*FlowHistogram) SetBgColor

func (p *FlowHistogram) SetBgColor(color color.Color) *FlowHistogram

func (*FlowHistogram) SetFgColor

func (p *FlowHistogram) SetFgColor(color color.Color) *FlowHistogram

func (*FlowHistogram) SetFull

func (p *FlowHistogram) SetFull(i bool) *FlowHistogram

func (*FlowHistogram) Size

func (p *FlowHistogram) Size() *Size

type FlowRate

type FlowRate struct {
	// contains filtered or unexported fields
}

func NewFlowRate

func NewFlowRate() *FlowRate

func (*FlowRate) AddData

func (p *FlowRate) AddData(data ...float64) *FlowRate

func (*FlowRate) DrawImg

func (p *FlowRate) DrawImg(x, y float64, img *image.RGBA) error

func (*FlowRate) IsFull

func (p *FlowRate) IsFull() bool

func (*FlowRate) MinSize

func (p *FlowRate) MinSize() *Size

func (*FlowRate) SetBgColor

func (p *FlowRate) SetBgColor(color color.Color) *FlowRate

func (*FlowRate) SetFgColor

func (p *FlowRate) SetFgColor(color color.Color) *FlowRate

func (*FlowRate) SetFull

func (p *FlowRate) SetFull(i bool) *FlowRate

func (*FlowRate) Size

func (p *FlowRate) Size() *Size

type Line

type Line interface {
	DrawImg(x, y float64, img *image.RGBA) error
	MinSize() *Size

	Size() *Size
	// contains filtered or unexported methods
}

type LineOne

type LineOne interface {
	Line

	IsFull() bool
}

type LineTxt

type LineTxt struct {
	// contains filtered or unexported fields
}

func NewLineText

func NewLineText() *LineTxt

func (*LineTxt) DrawImg

func (p *LineTxt) DrawImg(x, y float64, img *image.RGBA) error

func (*LineTxt) IsFull

func (p *LineTxt) IsFull() bool

func (*LineTxt) MinSize

func (p *LineTxt) MinSize() *Size

func (*LineTxt) SetAlignment

func (p *LineTxt) SetAlignment(alignment Alignment) *LineTxt

func (*LineTxt) SetBgColor

func (p *LineTxt) SetBgColor(color color.Color) *LineTxt

func (*LineTxt) SetFgColor

func (p *LineTxt) SetFgColor(color color.Color) *LineTxt

func (*LineTxt) SetFontSize

func (p *LineTxt) SetFontSize(fontSize float64) *LineTxt

func (*LineTxt) SetText

func (p *LineTxt) SetText(format string, a ...interface{}) *LineTxt

func (*LineTxt) Size

func (p *LineTxt) Size() *Size

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

func NewRows

func NewRows() *Rows

func (*Rows) AddCell

func (p *Rows) AddCell(cell ...Cell) *Rows

func (*Rows) Cols

func (p *Rows) Cols() int32

func (*Rows) DrawImg

func (p *Rows) DrawImg(x, y float64, img *image.RGBA) error

func (*Rows) MinSize

func (p *Rows) MinSize() *Size

func (*Rows) RangeCell

func (p *Rows) RangeCell(f func(idx int, cell Cell) error) error

func (*Rows) Size

func (p *Rows) Size() *Size

type Size

type Size struct {
	Width, Height float64
	// contains filtered or unexported fields
}

func NewSize

func NewSize(width, height float64) *Size

func TextSize

func TextSize(label string, fontSize float64) *Size

func (*Size) AddHeight

func (p *Size) AddHeight(height float64) *Size

func (*Size) AddWidth

func (p *Size) AddWidth(width float64) *Size

func (Size) String

func (p Size) String() string

type Table

type Table struct {
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) AddLine

func (p *Table) AddLine(lines ...Line) *Table

func (*Table) SetSteganography

func (p *Table) SetSteganography(data interface{}) *Table

添加图片隐写

func (*Table) SetWmk

func (p *Table) SetWmk(data string) *Table

添加水印

func (*Table) ToBmp

func (p *Table) ToBmp() (*bytes.Buffer, error)

func (*Table) ToImg

func (p *Table) ToImg() (*bytes.Buffer, error)

func (*Table) ToJpg

func (p *Table) ToJpg() (*bytes.Buffer, error)

func (*Table) ToPng

func (p *Table) ToPng() (*bytes.Buffer, error)

func (*Table) ToTiff

func (p *Table) ToTiff() (*bytes.Buffer, error)

func (*Table) ToWebp

func (p *Table) ToWebp() (*bytes.Buffer, error)

type Text

type Text struct {
	// contains filtered or unexported fields
}

func NewText

func NewText(format string, a ...interface{}) *Text

func (*Text) DrawImg

func (p *Text) DrawImg(x, y float64, img *image.RGBA) error

func (*Text) MinSize

func (p *Text) MinSize() *Size

func (*Text) SetAlignment

func (p *Text) SetAlignment(alignment Alignment) *Text

func (*Text) SetBgColor

func (p *Text) SetBgColor(color color.Color) *Text

func (*Text) SetFgColor

func (p *Text) SetFgColor(color color.Color) *Text

func (*Text) SetFontSize

func (p *Text) SetFontSize(fontSize float64) *Text

func (*Text) SetText

func (p *Text) SetText(format string, a ...interface{}) *Text

func (*Text) Size

func (p *Text) Size() *Size

Jump to

Keyboard shortcuts

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