This commit is contained in:
potassium 2024-08-20 10:07:01 +03:00
parent d4aec6bcaf
commit 73d114ef5b
4 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
child_porn
imageutils.test
cpu.out
profile.out

1
README Normal file
View File

@ -0,0 +1 @@
dummy as fuck image rescaling

View File

@ -10,6 +10,8 @@ type rescaled struct {
scale int
}
func Render(
// ColorModel implements image.Image interface
func (r rescaled) ColorModel() color.Model {
return r.src.ColorModel()
@ -43,4 +45,5 @@ func Scale(img image.Image, scale int) image.Image {
scale = 1
}
return rescaled{img, scale}
1
}

View File

@ -23,8 +23,8 @@ func BenchmarkScale(b *testing.B) {
err := png.Encode(io.Discard,
Scale(Render(
texture.New(color.White, color.Black, 2),
image.Rect(0, 0, 32, 32),
), 32),
image.Rect(0, 0, 64, 64),
), 64),
)
if err != nil {
panic(err)