canvas

package
v0.0.0-...-ba0b20d Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFile

func DecodeFile(path string) (image.Image, error)

DecodeFile decodes a raster image file into an image.Image.

Types

type Buffer

type Buffer = core.Buffer

func DecodeImageToBuffer

func DecodeImageToBuffer(path string, reqSize int, opts ...DecodeOptions) (*Buffer, error)

DecodeImageToBuffer decodes raster formats directly and rasterizes SVG files. reqSize is used for SVG rasterization. If <= 0, a size is inferred from SVG metadata.

func DecodeSVGToBuffer

func DecodeSVGToBuffer(path string, reqSize int, opts ...DecodeOptions) (*Buffer, error)

DecodeSVGToBuffer rasterizes an SVG file using optional text-face settings.

type DecodeOptions

type DecodeOptions struct {
	TextFace *TextFace
}

DecodeOptions controls image decode behavior.

type TextFace

type TextFace struct {
	Width  int
	Height int
	Glyphs map[rune][]byte
}

TextFace provides bitmap glyph metrics used by SVG text fallback.

Jump to

Keyboard shortcuts

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