From aadc89bca03e9c3a6ceea210236e88f8d9678ad2 Mon Sep 17 00:00:00 2001 From: potassium Date: Thu, 5 Sep 2024 14:13:00 +0300 Subject: [PATCH] README update --- README | 2 ++ concat.go | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README b/README index 262b232..b36e908 100644 --- a/README +++ b/README @@ -1 +1,3 @@ (with a dummy as fuck image rescaling) +utilities work in theory, but doing everything very slow. +i really love Go's image.Image interface type, but its really hard to do something with it well. diff --git a/concat.go b/concat.go index e651740..30876dd 100644 --- a/concat.go +++ b/concat.go @@ -21,9 +21,9 @@ type pair struct { } // Takes color.Model of the first Image. -func (p pair) ColorModel() color.Model { return p.first.ColorModel() } +func (p *pair) ColorModel() color.Model { return p.first.ColorModel() } -func (p pair) Bounds() image.Rectangle { +func (p *pair) Bounds() image.Rectangle { var ( b1 = p.first.Bounds() b2 = p.second.Bounds() @@ -52,7 +52,7 @@ func (p pair) Bounds() image.Rectangle { } } -func (p pair) At(x, y int) color.Color { +func (p *pair) At(x, y int) color.Color { img := image.NewRGBA(p.Bounds()) point := image.Point{} @@ -86,7 +86,7 @@ func (p pair) At(x, y int) color.Color { return img.At(x, y) } -func render(p pair) image.Image { +func render(p *pair) image.Image { img := image.NewRGBA(p.Bounds()) point := image.Point{} @@ -122,5 +122,5 @@ func render(p pair) image.Image { // Concat concatenates second image on a given side. func Concat(i1, i2 image.Image, s Side) image.Image { - return render(pair{i1, i2, s}) + return render(&pair{i1, i2, s}) }