From 73d114ef5b7787ec924ddd8863d696d360a5d8c4 Mon Sep 17 00:00:00 2001 From: potassium Date: Tue, 20 Aug 2024 10:07:01 +0300 Subject: [PATCH] readme --- .gitignore | 1 + README | 1 + scale.go | 3 +++ scale_test.go | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 README diff --git a/.gitignore b/.gitignore index 44b578a..8090a6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ child_porn imageutils.test cpu.out +profile.out diff --git a/README b/README new file mode 100644 index 0000000..6e74f02 --- /dev/null +++ b/README @@ -0,0 +1 @@ +dummy as fuck image rescaling diff --git a/scale.go b/scale.go index 7c6039e..a9087c1 100644 --- a/scale.go +++ b/scale.go @@ -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 } diff --git a/scale_test.go b/scale_test.go index 0ff66d6..5329652 100644 --- a/scale_test.go +++ b/scale_test.go @@ -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)