2020-02-05 19:26:43 +01:00
|
|
|
package pixelflut
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"image"
|
|
|
|
)
|
|
|
|
|
2020-02-06 01:01:05 +01:00
|
|
|
func CmdsFetchImage(bounds image.Rectangle) (cmds Commands) {
|
|
|
|
cmds = make([][]byte, bounds.Size().X*bounds.Size().Y)
|
|
|
|
numCmds := 0
|
|
|
|
for x := bounds.Min.X; x < bounds.Max.X; x++ {
|
|
|
|
for y := bounds.Min.Y; y < bounds.Max.Y; y++ {
|
|
|
|
cmd := fmt.Sprintf("PX %d %d\n", x, y)
|
|
|
|
cmds[numCmds] = []byte(cmd)
|
|
|
|
numCmds++
|
2020-02-05 19:26:43 +01:00
|
|
|
}
|
|
|
|
}
|
2020-02-06 01:01:05 +01:00
|
|
|
return cmds
|
2020-02-05 19:26:43 +01:00
|
|
|
}
|