Documentation ¶
Overview ¶
Package xi provides function registration and implementations for xirho.
External packages adding new function types only need to Register a factory here to automatically work with xirho serialization and user interfaces. Conversely, user interfaces will be primarily interested in the New, NameOf, and Names functions, as most of the rest of the work is done in package fapi.
Lastly, some users may want to use the function implementation types directly, either to decode systems serialized in another format (e.g. package encoding/flame) or to build a system by hand. As a general rule, if a function type has any parameters, it implements xirho.Func as a pointer, and if it has none, then it implements it as a (size zero) value.
Index ¶
- func NameOf(f xirho.Func) (name string, ok bool)
- func Names(unique bool) []string
- func New(name string) xirho.Func
- func Register(name string, factory func() xirho.Func) error
- type Affine
- type Bipolar
- type Blur
- type Bubble
- type CElliptic
- type ColorSpeed
- type Curl
- type Cylinder
- type Disc
- type Exblur
- type Exp
- type Farblur
- type Flatten
- type Foci
- type Gaussblur
- type Heat
- type Hole
- type JuliaN
- type LazySusan
- type Log
- type Mobius
- type Perspective
- type Polar
- type Rod
- type Scale
- type Scry
- type Spherical
- type Splits
- type Sum
- type Then
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameOf ¶
NameOf returns the name of a registered function. ok is false if there is no such function.
func Names ¶
Names returns a list of all registered function names. If unique is true, then only the first name registered for each underlying type is used. The names are returned in lexicographically increasing order.
func New ¶
New creates a new function using a registered name. The result is nil if there is no function registered with the given name.
Types ¶
type CElliptic ¶
type CElliptic struct{}
CElliptic is a simpler, conformal modification of elliptic.
type ColorSpeed ¶
type ColorSpeed struct { // Color is the color coordinate toward which inputs move. Color xirho.Real `xirho:"color,0,1"` // Speed is the smoothing rate. A value of 0 means the output color always // equals Color; a value of 1 means the output color always equals the // input color. Speed xirho.Real `xirho:"speed,0,1"` }
ColorSpeed performs exponential smoothing on the input color coordinate toward a chosen color.
func (*ColorSpeed) Prep ¶
func (f *ColorSpeed) Prep()
type Cylinder ¶
type Cylinder struct{}
Cylinder creates a cylinder with circular cross-sections of radius 1 in the x/z plane.
type Exblur ¶
type Exblur struct { Str xirho.Real `xirho:"strength"` Dist xirho.Real `xirho:"dist"` Origin xirho.Vec3 `xirho:"origin"` }
Exblur applies a radial blur with strength depending on distance from a point. Exblur is intended to be used following other functions in a Then.
type Farblur ¶
type Farblur struct { Origin xirho.Vec3 `xirho:"origin"` Ax xirho.Affine `xirho:"affine"` Dist xirho.Real `xirho:"dist"` }
Farblur applies an affine-transformed Gaussian blur with strength varying according to distance from a point. Farblur is intended to be used following other functions in a Then.
type Heat ¶
type Heat struct { ThetaT xirho.Real `xirho:"planar wave period"` ThetaP xirho.Angle `xirho:"planar wave phase"` ThetaA xirho.Real `xirho:"planar wave amp"` PhiT xirho.Real `xirho:"axial wave period"` PhiP xirho.Angle `xirho:"axial wave phase"` PhiA xirho.Real `xirho:"axial wave amp"` RT xirho.Real `xirho:"radial wave period"` RP xirho.Angle `xirho:"radial wave phase"` RA xirho.Real `xirho:"radial wave amp"` }
Heat applies transverse and radial waves.
type LazySusan ¶
type LazySusan struct { Inside xirho.Affine `xirho:"inside"` Outside xirho.Affine `xirho:"outside"` Center xirho.Vec3 `xirho:"center"` Radius xirho.Real `xirho:"radius"` Spread xirho.Real `xirho:"spread"` TwistZ xirho.Real `xirho:"twistZ"` }
LazySusan transforms points by different affine transforms depending on whether the input is inside a selection sphere.
type Mobius ¶
type Mobius struct { Ar xirho.Real `xirho:"A.scalar"` Avec xirho.Vec3 `xirho:"A.vector"` Br xirho.Real `xirho:"B.scalar"` Bvec xirho.Vec3 `xirho:"B.vector"` Cr xirho.Real `xirho:"C.scalar"` Cvec xirho.Vec3 `xirho:"C.vector"` Dr xirho.Real `xirho:"D.scalar"` Dvec xirho.Vec3 `xirho:"D.vector"` InZero xirho.List `xirho:"input blank,r,i,j,k"` }
Mobius implements Mobius transformations over quaternions.
type Perspective ¶
Perspective applies a perspective transform to the 3D spatial coordinates.
func (*Perspective) Prep ¶
func (f *Perspective) Prep()
type Rod ¶
Rod creates a solid cylinder of a given radius, with circular cross-sections in the x/z plane.
type Spherical ¶
type Spherical struct{}
Spherical calculates the conjugate of the complex reciprocal of the x and y of the input point treated as x+iy. The z and c coordinates are unchanged.
Source Files ¶
- affine.go
- bipolar.go
- blur.go
- bubble.go
- celliptic.go
- colorspeed.go
- curl.go
- cylinder.go
- disc.go
- doc.go
- exblur.go
- exp.go
- farblur.go
- flatten.go
- foci.go
- gaussblur.go
- heat.go
- hole.go
- julian.go
- lazysusan.go
- log.go
- mobius.go
- perspective.go
- polar.go
- register.go
- rod.go
- scale.go
- scry.go
- spherical.go
- splits.go
- sum.go
- then.go