graphics

package
v0.0.0-...-c19e608 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AAFactor = 1.5
)

Variables

View Source
var (
	BrushImage = ebiten.NewImage(1, 1)
)
View Source
var (
	GammaExp = 1. / 2.2
)

Functions

func AppendRectVerticesIndices

func AppendRectVerticesIndices(vertices []ebiten.Vertex, indices []uint16, index int, opts *RectOpts) ([]ebiten.Vertex, []uint16)

func ColorAsFloat32RGB

func ColorAsFloat32RGB(clr color.Color) float32

func ItemShader

func ItemShader() *ebiten.Shader

Types

type ColorFilling

type ColorFilling byte
const (
	ColorFillingVertical ColorFilling = iota
	ColorFillingDistance
	ColorFillingNone
)

type Content

type Content interface {
	Draw(dst *ebiten.Image)
}

type ContentPrimitive

type ContentPrimitive struct {
	Z       int
	Clip    image.Rectangle
	Content Content
}

type ItemPrimitive

type ItemPrimitive struct {
	Z int
	// First vec4
	Shape          Shape
	ColorMin       color.Color
	ColorMax       color.Color
	ColorMinFactor float32
	// Second vec4
	ColorFilling ColorFilling
	Rounding     float32
	BorderColor  color.Color
	BorderWidth  float32
	// CPU
	MarginLeft   float32
	MarginRight  float32
	MarginTop    float32
	MarginBottom float32

	// Extras
	ColorAlpha float32
}

type Pipeline

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

func NewPipeline

func NewPipeline(bounds image.Rectangle) *Pipeline

func (*Pipeline) Add

func (pp *Pipeline) Add(item *ItemPrimitive, area image.Rectangle)

func (*Pipeline) AddContent

func (pp *Pipeline) AddContent(c *ContentPrimitive)

func (*Pipeline) Clear

func (pp *Pipeline) Clear()

func (*Pipeline) Draw

func (pp *Pipeline) Draw(screen *ebiten.Image, offset image.Point)

func (*Pipeline) EnsureLayers

func (pp *Pipeline) EnsureLayers(z int)

type RectOpts

type RectOpts struct {
	DstX, DstY          float32
	SrcX, SrcY          float32
	DstWidth, DstHeight float32
	SrcWidth, SrcHeight float32
	R, G, B, A          float32
}

type Shape

type Shape byte
const (
	ShapeBox Shape = iota
	ShapeEllipse
	ShapeRhombus
	ShapeOctogon
	ShapeNone
)

Jump to

Keyboard shortcuts

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