wuffspng

package
v2.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: GPL-3.0, Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package wuffspng decodes PNG images with Wuffs, Google's memory-safe image decoders, compiled from the vendored single-file C release wuffs-v0.4.c (google/wuffs commit 7f70dda95c77b10c087c0908790837b5e9c15713, licensed Apache-2.0 OR MIT; see LICENSE-APACHE and LICENSE-MIT).

On a MiSTer it decoded real 512x700 cover art 2.8 times faster than image/png, with identical pixels. Builds without cgo report ErrUnavailable so callers fall back to image/png.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnavailable is returned by builds without cgo.
	ErrUnavailable = errors.New("wuffspng: not available without cgo")
	// ErrTooLarge is returned when the decoded image cannot be addressed.
	ErrTooLarge = errors.New("wuffspng: image too large")
	// ErrDecode wraps Wuffs' own status message for an invalid PNG.
	ErrDecode = errors.New("wuffspng: decode failed")
)

Functions

func Decode

func Decode(data []byte) (*image.RGBA, error)

Decode decodes a PNG into a premultiplied RGBA image, the form image scaling and compositing work in.

Types

This section is empty.

Jump to

Keyboard shortcuts

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