Versions in this module Expand all Collapse all v0 v0.1.0 Mar 4, 2026 Changes in this version + var ErrInvalidItem = errors.New("invalid item") + var ErrInvalidLayout = errors.New("invalid layout") + var ErrInvalidOptions = errors.New("invalid options") + var ErrLayoutRequired = errors.New("layout is required") + var ErrPlacementFailed = errors.New("placement failed") + var ErrSourceImageMissing = errors.New("source image is missing") + var ErrSourceNotFound = errors.New("source not found") + var ErrSourceSizeMismatch = errors.New("source size mismatch") + func Render(layout *Layout, sources []Source) (image.Image, error) + type Atlas struct + Image image.Image + Layout Layout + func Pack(sprites []Sprite, opts Options) (*Atlas, error) + type Heuristic int + const HeuristicBestAreaFit + const HeuristicBestLongSideFit + const HeuristicBestShortSideFit + const HeuristicBottomLeft + const HeuristicContactPoint + const HeuristicFirstFit + type Item struct + Height int + ID string + Width int + type Layout struct + Height int + Placements []Placement + Width int + func Plan(items []Item, opts Options) (*Layout, error) + type Options struct + AllowRotate bool + AspectPenalty float64 + ForceSquare bool + Heuristic Heuristic + MaxSize int + MinSize int + Padding int + PreferHeight bool + func DefaultOptions() Options + type Placement struct + Height int + ID string + Rotated bool + Width int + X int + Y int + type Source struct + ID string + Image image.Image + type Sprite struct + Height int + ID string + Image image.Image + Width int