automated snapshot
This commit is contained in:
30
main.go
30
main.go
@@ -60,15 +60,17 @@ func main() {
|
||||
|
||||
sierpinskiLayer := &SierpinskiArrow { dirty: true }
|
||||
|
||||
imageLayer := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg")
|
||||
aurora := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg")
|
||||
cave := NewImageLayer("/home/d/Dropbox/photos/Events/2025/ Chelsea and James visit Lindell/Photo Nov 29 2025, 5 26 40 PM (29).jpg")
|
||||
|
||||
//sketch.AddColorLayer("background-black", rl.Black)
|
||||
sketch.AddColorLayer("background-magenta", rl.Magenta)
|
||||
sketch.AddLayer("field", &FieldLayer{field: field, dirty: true})
|
||||
sketch.AddColorLayer("background-black", rl.Black)
|
||||
//sketch.AddColorLayer("background-magenta", rl.Magenta)
|
||||
sketch.AddLayer("field", &FieldLayer{field: field, loColor: rl.NewColor(0, 0, 0, 0), hiColor: rl.Magenta, dirty: true})
|
||||
contourLayer := NewContourLayer(&sketch, rng, field)
|
||||
sketch.AddLayer("contours", contourLayer)
|
||||
sketch.AddLayer("sierpinski", sierpinskiLayer)
|
||||
sketch.AddLayer("aurora", imageLayer)
|
||||
sketch.AddLayer("sierpinski-arrowhead", sierpinskiLayer)
|
||||
sketch.AddLayer("aurora", aurora)
|
||||
sketch.AddLayer("cave", cave)
|
||||
|
||||
ports := MakePorts()
|
||||
ports["sierpinskiArrowAngle"] =
|
||||
@@ -218,25 +220,27 @@ func main() {
|
||||
|
||||
type FieldLayer struct {
|
||||
field Field
|
||||
loColor rl.Color
|
||||
hiColor rl.Color
|
||||
dirty bool
|
||||
}
|
||||
|
||||
func (s *FieldLayer) Update(ctx *RenderCtx) {
|
||||
func (fl *FieldLayer) Update(ctx *RenderCtx) {
|
||||
;
|
||||
}
|
||||
|
||||
func (s *FieldLayer) Draw(ctx *RenderCtx) {
|
||||
func (fl *FieldLayer) Draw(ctx *RenderCtx) {
|
||||
for x := range ctx.SourceWidth {
|
||||
for y := range ctx.SourceHeight {
|
||||
v := s.field.Get(float32(x), float32(y))
|
||||
clr := GrayCurve(v, 1.0)
|
||||
v := fl.field.Get(float32(x), float32(y))
|
||||
clr := LerpCurve(v, 1.0, fl.loColor, fl.hiColor)
|
||||
rl.DrawPixel(x, y, clr)
|
||||
}
|
||||
}
|
||||
s.dirty = false
|
||||
fl.dirty = false
|
||||
}
|
||||
|
||||
func (s *FieldLayer) IsDirty() bool {
|
||||
return s.dirty
|
||||
func (fl *FieldLayer) IsDirty() bool {
|
||||
return fl.dirty
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user