summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/interp/interp.go
blob: 560637d4a9050889a4b04242b5d7ecaa5ad440cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2012 The Graphics-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package interp

import (
	"image"
	"image/color"
)

// Interp interpolates an image's color at fractional co-ordinates.
type Interp interface {
	// Interp interpolates (x, y).
	Interp(src image.Image, x, y float64) color.Color
}

// RGBA is a fast-path interpolation implementation for image.RGBA.
// It is common for an Interp to also implement RGBA.
type RGBA interface {
	// RGBA interpolates (x, y).
	RGBA(src *image.RGBA, x, y float64) color.RGBA
}

// Gray is a fast-path interpolation implementation for image.Gray.
type Gray interface {
	// Gray interpolates (x, y).
	Gray(src *image.Gray, x, y float64) color.Gray
}