merging all related stuff here
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/potassium5703/texture"
|
||||
"git.nkpl.cc/twocookedfaggots/imageutils/pkg/texture"
|
||||
)
|
||||
|
||||
func Render(img image.Image, rect image.Rectangle) image.Image {
|
||||
@@ -33,6 +33,21 @@ func BenchmarkScale(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
type SinglePixel struct{}
|
||||
|
||||
func (s SinglePixel) At(x, y int) color.Color {
|
||||
return color.White
|
||||
}
|
||||
|
||||
func (s SinglePixel) ColorModel() color.Model {
|
||||
return color.RGBAModel
|
||||
}
|
||||
|
||||
func (s SinglePixel) Bounds() image.Rectangle {
|
||||
return image.Rect(0, 0, 1, 1)
|
||||
}
|
||||
|
||||
func BenchmarkSinglePixel(b *testing.B) {
|
||||
instance := SinglePixel{}
|
||||
err := png.Encode(io.Discard,
|
||||
|
||||
Reference in New Issue
Block a user