more progress on compositing
This commit is contained in:
20
main.go
20
main.go
@@ -6,27 +6,32 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
"flag"
|
||||||
|
|
||||||
gui "github.com/gen2brain/raylib-go/raygui"
|
gui "github.com/gen2brain/raylib-go/raygui"
|
||||||
rl "github.com/gen2brain/raylib-go/raylib"
|
rl "github.com/gen2brain/raylib-go/raylib"
|
||||||
//"github.com/ojrac/opensimplex-go"
|
//"github.com/ojrac/opensimplex-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
var snapshotsPath string
|
||||||
snapshotsDir = "snapshots"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
log := log.New(os.Stdout, "", log.Ldate|log.Ltime|log.Lshortfile)
|
||||||
|
|
||||||
|
flag.StringVar(&snapshotsPath, "path", "snapshots", "Path to snapshots and db")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
var sourceWidth int32 = 8000
|
var sourceWidth int32 = 8000
|
||||||
var sourceHeight int32 = 6400
|
var sourceHeight int32 = 6400
|
||||||
|
|
||||||
var targetWidth int32 = int32(1600)
|
var targetWidth int32 = int32(1600)
|
||||||
var targetHeight int32 = int32(1000)
|
var targetHeight int32 = int32(1000)
|
||||||
|
|
||||||
os.MkdirAll(snapshotsDir, 0755)
|
log.Printf("Storing snapshots at '%s'\n", snapshotsPath)
|
||||||
log := log.New(os.Stdout, "", log.Ldate|log.Ltime|log.Lshortfile)
|
|
||||||
storage, err := NewStorage(snapshotsDir)
|
os.MkdirAll(snapshotsPath, 0755)
|
||||||
|
storage, err := NewStorage(snapshotsPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error loading storage: %v\n", err)
|
log.Printf("Error loading storage: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@@ -46,7 +51,7 @@ func main() {
|
|||||||
|
|
||||||
rng := rand.New(rand.NewSource(0))
|
rng := rand.New(rand.NewSource(0))
|
||||||
//imageField := NewImageField("/home/d/Dropbox/art/passage/data/david.png")
|
//imageField := NewImageField("/home/d/Dropbox/art/passage/data/david.png")
|
||||||
imageField := NewImageField("/home/d/Dropbox/art/passage/data/moses_statue.jpg")
|
imageField := NewImageField("/home/d/Dropbox/art/data/moses_statue.jpg")
|
||||||
field :=
|
field :=
|
||||||
&TranslateField {
|
&TranslateField {
|
||||||
x: -float32(sourceWidth / 2.0),
|
x: -float32(sourceWidth / 2.0),
|
||||||
@@ -61,7 +66,6 @@ func main() {
|
|||||||
|
|
||||||
sierpinskiLayer := &SierpinskiArrow { dirty: true }
|
sierpinskiLayer := &SierpinskiArrow { dirty: true }
|
||||||
|
|
||||||
|
|
||||||
//sketch.AddColorLayer("background-magenta", rl.Magenta)
|
//sketch.AddColorLayer("background-magenta", rl.Magenta)
|
||||||
sketch.AddLayer("field", &FieldLayer{field: field, loColor: rl.NewColor(0, 0, 0, 0), hiColor: rl.Yellow, dirty: true})
|
sketch.AddLayer("field", &FieldLayer{field: field, loColor: rl.NewColor(0, 0, 0, 0), hiColor: rl.Yellow, dirty: true})
|
||||||
contourLayer := NewContourLayer(&sketch, rng, field)
|
contourLayer := NewContourLayer(&sketch, rng, field)
|
||||||
|
|||||||
Reference in New Issue
Block a user