scene

package
v0.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package scene defines the portable, executable-code-free On Air document v1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ease

func Ease(name string, u, energy float64) float64

func Eval

func Eval(v Value, b Bindings, t float64) any

func Number

func Number(v any, fallback float64) float64

Types

type Audio

type Audio struct {
	Generator string `json:"generator"`
	Seed      uint32 `json:"seed,omitempty"`
}

type Behavior

type Behavior struct {
	Typewriter *Params `json:"typewriter,omitempty"`
	Flicker    *Params `json:"flicker,omitempty"`
	Wiggle     *Params `json:"wiggle,omitempty"`
	Bounce     *Params `json:"bounce,omitempty"`
	Glint      *Params `json:"glint,omitempty"`
	Chroma     *Params `json:"chroma,omitempty"`
	Drift      *Params `json:"drift,omitempty"`
	Pop        *Params `json:"pop,omitempty"`
	Squash     *Params `json:"squash,omitempty"`
}

type Bindings

type Bindings struct {
	Tokens map[string]any    `json:"tokens,omitempty"`
	Slots  map[string]string `json:"slots,omitempty"`
}

func (Bindings) Number

func (b Bindings) Number(k string, fallback float64) float64

func (Bindings) Resolve

func (b Bindings) Resolve(s string) string

type Cost

type Cost struct {
	Layers    int
	Particles int
	Blur      float64
	Duration  float64
}

type Document

type Document struct {
	Audio    *Audio   `json:"audio,omitempty"`
	V        int      `json:"v"`
	Moment   string   `json:"moment"`
	Duration float64  `json:"duration"`
	Poster   float64  `json:"poster"`
	Slots    []string `json:"slots,omitempty"`
	Layers   []Layer  `json:"layers"`
	Post     []Effect `json:"post,omitempty"`
}

func Decode

func Decode(data []byte) (Document, error)

func (Document) Estimate

func (d Document) Estimate() Cost

func (Document) StaticForeground

func (d Document) StaticForeground() (Document, bool)

StaticForeground separates a full-frame analogue background from its prepared foreground. Such scenes air over a live Signal engine instead of a clip loop.

func (Document) Validate

func (d Document) Validate() error

type Effect

type Effect struct {
	Type   string `json:"type"`
	Amount Value  `json:"amount"`
	Seed   uint32 `json:"seed,omitempty"`
}

type Layer

type Layer struct {
	Name        string     `json:"name,omitempty"`
	Hidden      bool       `json:"hidden,omitempty"`
	Locked      bool       `json:"locked,omitempty"`
	Start       float64    `json:"start,omitempty"`
	End         float64    `json:"end,omitempty"`
	ID          string     `json:"id"`
	Type        string     `json:"type"`
	X           Value      `json:"x,omitempty"`
	Y           Value      `json:"y,omitempty"`
	W           Value      `json:"w,omitempty"`
	H           Value      `json:"h,omitempty"`
	Scale       Value      `json:"scale,omitempty"`
	ScaleX      Value      `json:"scaleX,omitempty"`
	ScaleY      Value      `json:"scaleY,omitempty"`
	Rotate      Value      `json:"rotate,omitempty"`
	Opacity     Value      `json:"opacity,omitempty"`
	Fill        Value      `json:"fill,omitempty"`
	Stroke      Value      `json:"stroke,omitempty"`
	StrokeWidth Value      `json:"strokeWidth,omitempty"`
	Join        string     `json:"join,omitempty"`
	Cap         string     `json:"cap,omitempty"`
	FillRule    string     `json:"fillRule,omitempty"`
	Path        string     `json:"path,omitempty"`
	Clip        string     `json:"clip,omitempty"`
	Text        Value      `json:"text,omitempty"`
	Font        Value      `json:"font,omitempty"`
	Size        Value      `json:"size,omitempty"`
	Weight      int        `json:"weight,omitempty"`
	Track       Value      `json:"track,omitempty"`
	Align       string     `json:"align,omitempty"`
	MaxWidth    float64    `json:"maxWidth,omitempty"`
	Fit         string     `json:"fit,omitempty"`
	MaxLines    int        `json:"maxLines,omitempty"`
	Src         Value      `json:"src,omitempty"`
	Tint        Value      `json:"tint,omitempty"`
	TintBlend   string     `json:"tintBlend,omitempty"`
	Blend       string     `json:"blend,omitempty"`
	Blur        float64    `json:"blur,omitempty"`
	Glow        float64    `json:"glow,omitempty"`
	Count       int        `json:"count,omitempty"`
	Seed        uint32     `json:"seed,omitempty"`
	Repeat      int        `json:"repeat,omitempty"`
	Behave      []Behavior `json:"behave,omitempty"`
	Reveal      *Reveal    `json:"reveal,omitempty"`
	Layers      []Layer    `json:"layers,omitempty"`
}

type Params

type Params struct {
	Start     float64 `json:"start,omitempty"`
	Step      float64 `json:"step,omitempty"`
	Amplitude float64 `json:"amplitude,omitempty"`
	Speed     float64 `json:"speed,omitempty"`
	Seed      uint32  `json:"seed,omitempty"`
}

type Reveal

type Reveal struct {
	Out  bool    `json:"out,omitempty"`
	Wipe string  `json:"wipe"`
	From float64 `json:"from"`
	To   float64 `json:"to"`
	Ease string  `json:"ease,omitempty"`
}

type Value

type Value = any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL