README update

This commit is contained in:
potassium 2024-09-05 14:13:00 +03:00
parent 11aa6e044b
commit aadc89bca0
2 changed files with 7 additions and 5 deletions

2
README
View File

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

View File

@ -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})
}