readme
This commit is contained in:
parent
d4aec6bcaf
commit
73d114ef5b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
child_porn
|
||||
imageutils.test
|
||||
cpu.out
|
||||
profile.out
|
||||
|
3
scale.go
3
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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user