merging all related stuff here

This commit is contained in:
2026-02-22 01:06:02 +03:00
parent cc5c9c6d1a
commit 352631e071
11 changed files with 110 additions and 71 deletions

View File

@@ -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,