Go update; gofix for image changes

Change-Id: Id58f0abe112506ba665df37b99414360c236fc43
This commit is contained in:
Brad Fitzpatrick 2011-09-15 21:21:02 -07:00
parent 0fdb2df97a
commit 3eb3b994ca
2 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
6g version weekly.2011-09-07 9728
6g version weekly.2011-09-07 9772+

View File

@ -16,7 +16,7 @@ func Resize(m image.Image, r image.Rectangle, w, h int) image.Image {
return nil
}
if w == 0 || h == 0 || r.Dx() <= 0 || r.Dy() <= 0 {
return image.NewRGBA64(w, h)
return image.NewRGBA64(image.Rect(0, 0, w, h))
}
switch m := m.(type) {
case *image.RGBA:
@ -98,7 +98,7 @@ func Resize(m image.Image, r image.Rectangle, w, h int) image.Image {
// average convert the sums to averages and returns the result.
func average(sum []uint64, w, h int, n uint64) image.Image {
ret := image.NewRGBA(w, h)
ret := image.NewRGBA(image.Rect(0, 0, w, h))
for y := 0; y < h; y++ {
for x := 0; x < w; x++ {
i := y*ret.Stride + x*4
@ -225,10 +225,10 @@ func Resample(m image.Image, r image.Rectangle, w, h int) image.Image {
return nil
}
if w == 0 || h == 0 || r.Dx() <= 0 || r.Dy() <= 0 {
return image.NewRGBA64(w, h)
return image.NewRGBA64(image.Rect(0, 0, w, h))
}
curw, curh := r.Dx(), r.Dy()
img := image.NewRGBA(w, h)
img := image.NewRGBA(image.Rect(0, 0, w, h))
for y := 0; y < h; y++ {
for x := 0; x < w; x++ {
// Get a source pixel.