mirror of https://github.com/status-im/resize.git
Change ordering
This commit is contained in:
parent
cfcbeb4bb2
commit
2d6edc049a
20
converter.go
20
converter.go
|
@ -23,16 +23,6 @@ import (
|
|||
|
||||
type colorArray [4]float32
|
||||
|
||||
// converter allows to retrieve
|
||||
// a colorArray for points of an image
|
||||
type converter interface {
|
||||
at(x, y int) colorArray
|
||||
}
|
||||
|
||||
type genericConverter struct {
|
||||
src image.Image
|
||||
}
|
||||
|
||||
func replicateBorder1d(x, min, max int) int {
|
||||
if x < min {
|
||||
x = min
|
||||
|
@ -49,6 +39,16 @@ func replicateBorder(x, y int, rect image.Rectangle) (xx, yy int) {
|
|||
return
|
||||
}
|
||||
|
||||
// converter allows to retrieve
|
||||
// a colorArray for points of an image.
|
||||
type converter interface {
|
||||
at(x, y int) colorArray
|
||||
}
|
||||
|
||||
type genericConverter struct {
|
||||
src image.Image
|
||||
}
|
||||
|
||||
func (c *genericConverter) at(x, y int) colorArray {
|
||||
r, g, b, a := c.src.At(replicateBorder(x, y, c.src.Bounds())).RGBA()
|
||||
return colorArray{
|
||||
|
|
Loading…
Reference in New Issue