2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,20 +1,29 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os/exec"
|
||||
"raster"
|
||||
)
|
||||
|
||||
func main() {
|
||||
b, err := raster.ReadPpmFile("Unfilledcirc.ppm")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
log.Fatal(err)
|
||||
}
|
||||
b.Flood(200, 200, raster.Pixel{127, 0, 0})
|
||||
err = b.WritePpmFile("flood.ppm")
|
||||
c := exec.Command("convert", "ppm:-", "flood.png")
|
||||
pipe, err := c.StdinPipe()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err = c.Start(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err = b.WritePpmTo(pipe); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err = pipe.Close(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue