2024-09-04 00:07:15 +04:00
|
|
|
package imageutils
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
"image/png"
|
|
|
|
"io"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func BenchmarkConcat(b *testing.B) {
|
2024-09-05 14:50:59 +04:00
|
|
|
var instance image.Image = image.NewRGBA(image.Rect(0, 0, 0, 0))
|
2024-09-04 00:07:15 +04:00
|
|
|
pixel := SinglePixel{}
|
|
|
|
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
instance = Concat(instance, pixel, Right)
|
|
|
|
}
|
|
|
|
err := png.Encode(
|
|
|
|
io.Discard,
|
|
|
|
instance,
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|