interp.go 794 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2012 The Graphics-Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package interp
  5. import (
  6. "image"
  7. "image/color"
  8. )
  9. // Interp interpolates an image's color at fractional co-ordinates.
  10. type Interp interface {
  11. // Interp interpolates (x, y).
  12. Interp(src image.Image, x, y float64) color.Color
  13. }
  14. // RGBA is a fast-path interpolation implementation for image.RGBA.
  15. // It is common for an Interp to also implement RGBA.
  16. type RGBA interface {
  17. // RGBA interpolates (x, y).
  18. RGBA(src *image.RGBA, x, y float64) color.RGBA
  19. }
  20. // Gray is a fast-path interpolation implementation for image.Gray.
  21. type Gray interface {
  22. // Gray interpolates (x, y).
  23. Gray(src *image.Gray, x, y float64) color.Gray
  24. }