gpu

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BufPool = sync.Pool{New: func() any { return &bytes.Buffer{} }}
	PixPool = sync.Pool{New: func() any { return make([]byte, 0, 256*256*4) }}
)

Functions

func GetBuf

func GetBuf() *bytes.Buffer

func GetPix

func GetPix(n int) []byte

func PutBuf

func PutBuf(b *bytes.Buffer)

func PutPix

func PutPix(p []byte)

Types

type BlitOp

type BlitOp struct {
	SrcPixels  []byte
	SrcW, SrcH int
	DstX, DstY int
}

type HeatmapParams

type HeatmapParams struct {
	Freq       map[[2]int]int
	ImgW, ImgH int
	Radius     int
}

type MinimapTile

type MinimapTile struct {
	X, Y       int
	ColorIndex uint8
}

type OutfitTintParams

type OutfitTintParams struct {
	Base, Overlay          []byte
	Head, Body, Legs, Feet [3]uint8
	IsAddon                bool
}

type Renderer

type Renderer interface {
	Composite(dstW, dstH int, ops []BlitOp) ([]byte, error)
	TintOutfit(p OutfitTintParams) ([]byte, error)
	ResizeNN(src []byte, srcW, srcH, dstW, dstH int) ([]byte, error)
	ResizeCatmullRom(src []byte, srcW, srcH, dstW, dstH int) ([]byte, error)
	RenderHeatmap(p HeatmapParams) ([]byte, error)
	ApplyShadow(pixels []byte, w, h int, intensity float64) ([]byte, error)
	RenderMinimap(w, h int, tiles []MinimapTile) ([]byte, error)
	Close()
}

func New

func New() Renderer

func NewCPU

func NewCPU() Renderer

func NewMetal

func NewMetal() (Renderer, error)

Jump to

Keyboard shortcuts

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