resample

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package resample provides pure-Go pixel resamplers operating on decoder.Image. Used by the v1.0 Slide.ScaledStrips iterator (when it lands) and exposed as standalone primitives for ad-hoc callers.

Kernels: Nearest (cheap, ugly for downsampling), Bilinear, Lanczos (best for arbitrary ratios), Box (area-averaging, best for integer downsampling).

Future Go-assembly acceleration is possible but out of scope for v0.22; the public API stays stable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Image

func Image(src *decoder.Image, outW, outH int, k Kernel) *decoder.Image

Image returns a freshly-allocated Image at the requested output dimensions, resampled from src using kernel k. The output format matches src.Format.

func ImageInto

func ImageInto(src, dst *decoder.Image, k Kernel) error

ImageInto writes the resampled output into dst (dimensions determined by dst). dst.Format must match src.Format.

Types

type Kernel

type Kernel int
const (
	Nearest Kernel = iota
	Bilinear
	Lanczos
	Box
)

Jump to

Keyboard shortcuts

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