interp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package interp implements image interpolation.

An interpolator provides the Interp interface, which can be used to interpolate a pixel:

c := interp.Bilinear.Interp(src, 1.2, 1.8)

To interpolate a large number of RGBA or Gray pixels, an implementation may provide a fast-path by implementing the RGBA or Gray interfaces.

i1, ok := i.(interp.RGBA)
if ok {
	c := i1.RGBA(src, 1.2, 1.8)
	// use c.R, c.G, etc
	return
}
c := i.Interp(src, 1.2, 1.8)
// use generic color.Color

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gray

type Gray interface {
	// Gray interpolates (x, y).
	Gray(src *image.Gray, x, y float64) color.Gray
}

Gray is a fast-path interpolation implementation for image.Gray.

type Interp

type Interp interface {
	// Interp interpolates (x, y).
	Interp(src image.Image, x, y float64) color.Color
}

Interp interpolates an image's color at fractional co-ordinates.

var Bilinear Interp = bilinear{}

Bilinear implements bilinear interpolation.

type RGBA

type RGBA interface {
	// RGBA interpolates (x, y).
	RGBA(src *image.RGBA, x, y float64) color.RGBA
}

RGBA is a fast-path interpolation implementation for image.RGBA. It is common for an Interp to also implement RGBA.

Jump to

Keyboard shortcuts

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