svg

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte, renderOptions onixsvg.Options, textureOptions graphics.TextureOptions) (*graphics.Texture, error)

func DecodeAtScale

func DecodeAtScale(data []byte, scale int, textureOptions graphics.TextureOptions) (*graphics.Texture, error)

DecodeAtScale rasterizes an SVG at a higher physical resolution without changing its logical dimensions when used by sprites and nine-slice borders.

Types

type Decoder

type Decoder struct{}

Decoder retains twice the intrinsic resolution and uses mipmaps when reduced.

func (Decoder) DecodeImage

func (Decoder) DecodeImage(data []byte, options graphics.TextureOptions) (*graphics.Texture, error)

func (Decoder) ImageExtension

func (Decoder) ImageExtension() string

type DoubleRasterScale

type DoubleRasterScale struct{}

DoubleRasterScale rasterizes SVG textures at twice their logical dimensions.

func (DoubleRasterScale) SVGTextureRasterScale

func (DoubleRasterScale) SVGTextureRasterScale(_, _ int) int

type RasterScale

type RasterScale interface {
	SVGTextureRasterScale(width, height int) int
}

RasterScale selects a physical resolution multiplier from intrinsic dimensions. The texture keeps the SVG's intrinsic size as its logical sprite size.

type ScaledDecoder

type ScaledDecoder[S RasterScale] struct{}

ScaledDecoder rasterizes SVG files at the scale selected by S and enables mipmaps so minification integrates thin contours instead of undersampling them.

func (ScaledDecoder[S]) DecodeImage

func (ScaledDecoder[S]) DecodeImage(data []byte, options graphics.TextureOptions) (*graphics.Texture, error)

func (ScaledDecoder[S]) ImageExtension

func (ScaledDecoder[S]) ImageExtension() string

Jump to

Keyboard shortcuts

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