Namespace with all includes ready for live coding.
Namespace with all includes ready for live coding.
(add-glow image-with-alpha
&
{:keys [glow-radius glow-colour glow-background blur-image-size]
:or {glow-radius 0.2
glow-colour yellow
glow-background [0.0 0.0 0.0 0.0]
blur-image-size 256}})
Adds a glow effect to any image with an alpha channel
Adds a glow effect to any image with an alpha channel
(adjust-hsl shift source)
(adjust-hue shift source)
(affine-transform matrix-rows)
(affine-transform matrix-rows src)
Performs an affine transformation (implicitly appends a 1 as final row of the input vector)
Performs an affine transformation (implicitly appends a 1 as final row of the input vector)
(alpha v)
Extracts the alpha component of a colour vector. Assumes 1.0 if not present.
Extracts the alpha component of a colour vector. Assumes 1.0 if not present.
(alpha-from-argb argb)
Gets the alpha component value from an ARGB integer
Gets the alpha component value from an ARGB integer
(apply-to-components f v)
Applies a function f to all components of a vector
Applies a function f to all components of a vector
(average & vs)
(blue-from-argb argb)
Gets the blue component value from an ARGB integer
Gets the blue component value from an ARGB integer
(blue-from-hsl colour-vector)
A special node that evaluates to the c vector. Used as initial fractal position
A special node that evaluates to the c vector. Used as initial fractal position
(check-dims & vectors)
(checker a b)
Checker pattern in (x,y) space, with 2*2 grid in [0..1,0..1] range
Checker pattern in (x,y) space, with 2*2 grid in [0..1,0..1] range
(checker-3D a b)
Checker pattern in (x,y,z) space, with 222 grid in [0..1,0..1,0..1] range
Checker pattern in (x,y,z) space, with 2*2*2 grid in [0..1,0..1,0..1] range
(clamp v low high)
(code-node form & {:keys [objects] :or {objects nil}})
Creates a node from a given code form (may be a vector). Does not preserve objects - must be copied over manually.
Creates a node from a given code form (may be a vector). Does not preserve objects - must be copied over manually.
4 dimensional randomly coloured unit hypercubes filling space
4 dimensional randomly coloured unit hypercubes filling space
(colour-map mapping)
(colour-map mapping x)
Creates a colour map function using a set of value-colour mappings
Creates a colour map function using a set of value-colour mappings
(compile-fn node)
(compile-render-fn node)
(compile-scalar-node n)
(compose f g)
(compose f g & more)
Composes two or more vector functions
Composes two or more vector functions
(constant-node v)
Create a node that returns a constant value, can be either a constant vector or scalar value
Create a node that returns a constant value, can be either a constant vector or scalar value
(constant-node? x)
(context-class-loader)
(cross3 a b)
Returns the cross product of 2 3D vectors
Returns the cross product of 2 3D vectors
(diffuse-light light-colour light-direction normal-direction)
Calculate the diffuse light on a surface normal vector. This function performs its own normalisation, so neither the light vector nor the normal vector need to be normalised.
Calculate the diffuse light on a surface normal vector. This function performs its own normalisation, so neither the light vector nor the normal vector need to be normalised.
(dot a b)
Returns the dot product of two vectors
Returns the dot product of two vectors
(ensure-scalar x)
(error & vals)
Throws a clisk error with the provided message(s)
Throws a clisk error with the provided message(s)
(expression-info expr)
Uses the Clojure compiler to analyze the given s-expr. Returns a map with keys :class and :primitive? indicating what the compiler concluded about the return value of the expression. Returns nil if no type info can be determined at compile-time.
Example: (expression-info '(+ (int 5) (float 10))) Returns: {:class float, :primitive? true}
Uses the Clojure compiler to analyze the given s-expr. Returns a map with keys :class and :primitive? indicating what the compiler concluded about the return value of the expression. Returns nil if no type info can be determined at compile-time. Example: (expression-info '(+ (int 5) (float 10))) Returns: {:class float, :primitive? true}
(expression-info-internal expr)
(frac x)
Retuns the fractional part of a number. Equivalent to Math/floor.
Retuns the fractional part of a number. Equivalent to Math/floor.
(fractal &
{:keys [init while update result bailout-result max-iterations]
:or {init pos}})
(function-node f & scalars)
Creates a node which is a scalar function of scalar nodes. Function should be provided as a symbol.
Creates a node which is a scalar function of scalar nodes. Function should be provided as a symbol.
(generate-colour-map
&
{:keys [hue-variation lightness-variation saturation-variation frequency
hue-frequency lightness-frequency saturation-frequency base-colour]})
(generate-scalar-code n)
(globe)
(globe function)
(globe function background)
Creates a globe, returning the value of the function called on the surface of a unit sphere.
(globe) alone produces z values that Can be used as a hight map
Creates a globe, returning the value of the function called on the surface of a unit sphere. (globe) alone produces z values that Can be used as a hight map
(gradient f)
Computes the gradient of a scalar function f with respect to [x y z t]
Computes the gradient of a scalar function f with respect to [x y z t]
Pattern returning a unique vector in [0..1)^4 range value for every point in 4D space
Pattern returning a unique vector in [0..1)^4 range value for every point in 4D space
(green-from-argb argb)
Gets the green component value from an ARGB integer
Gets the green component value from an ARGB integer
(green-from-hsl colour-vector)
(gridlines &
{:keys [colour background width scale]
:or {colour [1 1 1 1] background [0 0 0 0] width 0.0625 scale 1.0}})
4 dimensional randomly coloured unit hypercubes filling space
4 dimensional randomly coloured unit hypercubes filling space
(height f)
Calculates the height value (z) of a source function
Calculates the height value (z) of a source function
(height-normal heightmap)
(height-normal scale heightmap)
Calculates a vector normal to the surface defined by the z-value of a source vector or a scalar height value. The result is not normalised.
Calculates a vector normal to the surface defined by the z-value of a source vector or a scalar height value. The result is *not* normalised.
(hsl-from-rgb rgb)
(hue-from-rgb colour-vector)
(hue-function r g b)
(image vector-function
&
{:keys [width height size anti-alias] :or {size DEFAULT-IMAGE-SIZE}})
Creates a bufferedimage from the given clisk data
Creates a bufferedimage from the given clisk data
(image-filter filter source & {:keys [size width height]})
Applies a BufferedImageOp filter to a source image or function.
If size, width of height is specified, renders function at the specified resolution.
Applies a BufferedImageOp filter to a source image or function. If size, width of height is specified, renders function at the specified resolution.
(img node)
(img node w h)
(img node w h dx dy)
Creates a BufferedImage from the given node.
Creates a BufferedImage from the given node.
(is-constant value)
(length a)
Calculates the length of a vector
Calculates the length of a vector
Performs clamped linear interpolation between two vectors, according to the proportion given in the 3rd parameter.
Performs clamped linear interpolation between two vectors, according to the proportion given in the 3rd parameter.
(let-vector bindings form)
let a vector value into each component of a function
let a vector value into each component of a function
(light-value light-direction normal-direction)
Calculates diffuse light intensity given a light direction and a surface normal vector. This function performs its own normalisation, so neither the light vector nor the normal vector need to be normalised.
Calculates diffuse light intensity given a light direction and a surface normal vector. This function performs its own normalisation, so neither the light vector nor the normal vector need to be normalised.
(lightness-from-rgb colour-vector)
(lightness-function r g b)
(limited-loop limit [& bindings] form)
(limited-recur bailout-result & values)
(load-image resource-name)
(make-multi-fractal function
&
{:keys [octaves lacunarity gain scale]
:or {octaves 8 lacunarity 2.0 gain 0.5 scale 0.5}})
Creates a multi-fractal function from a given source function with additional parameters
Creates a multi-fractal function from a given source function with additional parameters
(matrix rows)
Creates a matrix multiplication function
Creates a matrix multiplication function
(matrix-transform matrix-rows)
(matrix-transform matrix-rows src)
Performs a matrix transformation on the given source
Performs a matrix transformation on the given source
(max-component v)
Returns the max component of a vector
Returns the max component of a vector
(min-component v)
Returns the min component of a vector
Returns the min component of a vector
(new-image w h)
(new-node props)
Create a new AST node with the given properties
Create a new AST node with the given properties
(node a)
(node-info node)
(node? x)
(object-node v)
Creates a node with an embedded Java object
Creates a node with an embedded Java object
(offset offset f)
Offsets a function by a specified amount
Offsets a function by a specified amount
Standard 4-dimensional scalar perlin noise in range [0..1]
Standard 4-dimensional scalar perlin noise in range [0..1]
4-dimensional scalar perlin noise standardised with mean zero, range [-1..1]
4-dimensional scalar perlin noise standardised with mean zero, range [-1..1]
(phash x)
(phash x y)
(phash x y z)
(phash x y z t)
Returns a hashed double value in the range [0..1)
Returns a hashed double value in the range [0..1)
(pixelize size src)
Pixelizes an image with pixels of given size
Pixelizes an image with pixels of given size
(polar v)
Returns the polar co-ordinates of a vector
Returns the polar co-ordinates of a vector
A special node that evaluates to the current position in space as a 4D vector.
A special node that evaluates to the current position in space as a 4D vector.
(posterize src & {:keys [bands] :or {bands 4}})
Posterization effect with discrete colour bands.
Posterization effect with discrete colour bands.
(primitive? expression)
(psychedelic src
&
{:keys [noise-scale noise-bands]
:or {noise-scale 0.2 noise-bands 2.0}})
Psychedelic colour effect
Psychedelic colour effect
(radial src & {:keys [repeat] :or {repeat 1.0}})
Wraps an image around an origin in a radial fashion in the x-y plane
Wraps an image around an origin in a radial fashion in the x-y plane
(radius v)
Returns the raidus of a vector in polar co-ordinates
Returns the raidus of a vector in polar co-ordinates
(red-from-argb argb)
Gets the red component value from an ARGB integer
Gets the red component value from an ARGB integer
(red-from-hsl colour-vector)
(render-lit height)
(render-lit colour height)
Renders example lighting on a couloured surface with a given heightmap function
Renders example lighting on a couloured surface with a given heightmap function
(rgb java-colour)
(rgb r g b)
(rgb r g b a)
Creates an RGB colour vector
Creates an RGB colour vector
(rgb-from-hsl hsl)
(rgba java-colour)
(rgba r g b)
(rgba r g b a)
Creates an RGBA colour vector
Creates an RGBA colour vector
(rotate angle function)
Rotates a function in the (x,y plane)
Rotates a function in the (x,y plane)
(sample node)
(sample node pos)
Samples the value of a node at a given position
Samples the value of a node at a given position
(sampler node)
Creates a sampler function for a given node, which is a fn from position to sample value
Creates a sampler function for a given node, which is a fn from position to sample value
(saturation-from-rgb colour-vector)
(saturation-function r g b)
Hash function producing a scalar value in the range [0..1) for every unique point in space
Hash function producing a scalar value in the range [0..1) for every unique point in space
(scalar-lerp proportion a b)
Performs clamped linear interpolation between two values, according to the proportion given in the 3rd parameter.
Performs clamped linear interpolation between two values, according to the proportion given in the 3rd parameter.
(scalar-node? x)
(scale factor f)
Scales a function by a given factor.
Scales a function by a given factor.
(scale-image img w h)
Scales an image to a given width and height
Scales an image to a given width and height
(seamless v4)
(seamless scale v4)
Creates a seamless 2D tileable version of a 4D texture in the [0 0] to [1 1] region. The scale argument detrmines the amount of the source texture to be used per repeat.
Creates a seamless 2D tileable version of a 4D texture in the [0 0] to [1 1] region. The scale argument detrmines the amount of the source texture to be used per repeat.
(seed-perlin-noise!)
(seed-perlin-noise! s)
Modify the perlin noise seed.
Modify the perlin noise seed.
(seed-simplex-noise!)
(seed-simplex-noise! s)
Modify the simplex noise seed.
Modify the simplex noise seed.
(shatter src & args)
Breaks an image up into sharp irregular fragments defined by a Voronoi map
Breaks an image up into sharp irregular fragments defined by a Voronoi map
(show
image-or-function
&
{:keys [width height size anti-alias] :or {size DEFAULT-IMAGE-SIZE} :as ks})
Creates and shows an image from the given image vector function
Creates and shows an image from the given image vector function
(show-comp com & {:keys [title] :as options :or {title nil}})
Shows a component in a new frame
Shows a component in a new frame
Sigmoid function on a scalar or vector in range [0..1]
Sigmoid function on a scalar or vector in range [0..1]
Standard 4-dimensional scalar perlin noise in range [0..1]
Standard 4-dimensional scalar perlin noise in range [0..1]
4-dimensional scalar simplex noise standardised with mean zero, range [-1..1]
4-dimensional scalar simplex noise standardised with mean zero, range [-1..1]
4 dimensional plasma, in range [-1..1]
4 dimensional plasma, in range [-1..1]
(square-function x)
Retuns the square of a number.
Retuns the square of a number.
(static-cast class-sym expression)
Performs a static type cast
Performs a static type cast
A step function that works on both vectors and scalars
A step function that works on both vectors and scalars
(swirl src)
(swirl rate src)
Swirls a function around the origin with a given rate
Swirls a function around the origin with a given rate
(t v)
Extracts the t component of a position vector
Extracts the t component of a position vector
(texture-bound v offset width max)
(theta v)
Returns the angle of a vector in polar co-ordinates
Returns the angle of a vector in polar co-ordinates
(tile pattern)
Tiles a pattern in the range [0..1,0..1]
Tiles a pattern in the range [0..1,0..1]
(transform-components f & nodes)
Calls transform-node separately on each component of a set of nodes. Returns a scalar iff all input nodes are scalar.
Calls transform-node separately on each component of a set of nodes. Returns a scalar iff all input nodes are scalar.
(transform-node f & nodes)
Creates a node containing code based on transforming the other nodes into a new form
Creates a node containing code based on transforming the other nodes into a new form
Triangular wave function in range [0..1]
Triangular wave function in range [0..1]
(tst)
(turbulate factor func)
Adds random turbulence to a pattern according to a perlin noise offset
Adds random turbulence to a pattern according to a perlin noise offset
Classic Perlin turbulence in one dimension
Classic Perlin turbulence in one dimension
(typeof expression)
(validate nd)
Validates the structure and behaviour of any node. Throws an error if any problem is deteted, returns the node otherwise.
Validates the structure and behaviour of any node. Throws an error if any problem is deteted, returns the node otherwise.
(value-node v)
(vconcat & vectors)
Concatenate a set of vectors into a longer vector. Treats scalars as 1D vectors.
Concatenate a set of vectors into a longer vector. Treats scalars as 1D vectors.
(vec-node xs)
Creates a node from a sequence of scalar nodes
Creates a node from a sequence of scalar nodes
(vector-function a & {:keys [input-dimensions]})
Defines a vector function, operating on vectorz vectors
Defines a vector function, operating on vectorz vectors
(vector-function-node vf)
Creates a vector node from a VectorFunction
Creates a vector node from a VectorFunction
Hash function producing a vector value in the range [0..1)^4 for every unique point in space
Hash function producing a vector value in the range [0..1)^4 for every unique point in space
(vector-node & xs)
(vector-node? x)
(vector-offsets func)
(vectorize-op f & {:keys [zero identity unary-identity]})
Make an arbitrary function work on clisk vectors in a component-wise manner
Make an arbitrary function work on clisk vectors in a component-wise manner
(vfor init
while
update
&
{:keys [max-iterations result bailout-result] :or {max-iterations 10}})
(viewport a b function)
Rescales the texture as if viwed from [ax, ay] to [bx ,by]
Rescales the texture as if viwed from [ax, ay] to [bx ,by]
(vif condition a b)
(vlet bindings form)
let one or more values within a vector function
let one or more values within a vector function
(vloop init rest & {:keys [max-iterations] :or {max-iterations 10}})
Returns the modulus of a vector by component.
Returns the modulus of a vector by component.
4 dimensional vector perlin noise in range [0..1]^4
4 dimensional vector perlin noise in range [0..1]^4
(voronoi & {:keys [points] :or {points DEFAULT-VORONOI-POINTS}})
(voronoi-blocks & args)
A patterns of angular blocks created from a voronoi map, in range [0..1]
A patterns of angular blocks created from a voronoi map, in range [0..1]
(voronoi-function function
&
{:keys [points voronoi] :or {points DEFAULT-VORONOI-POINTS}})
(voronoi-points & {:keys [points voronoi] :or {points DEFAULT-VORONOI-POINTS}})
4 dimensional vector plasma in range [0..1]^4
4 dimensional vector plasma in range [0..1]^4
4 dimensional vector standardised perlin noise in range [-1..1]^4
4 dimensional vector standardised perlin noise in range [-1..1]^4
4 dimensional vector plasma in range [-1..1]^4
4 dimensional vector plasma in range [-1..1]^4
Classic Perlin turbulence in 4 dimensions
Classic Perlin turbulence in 4 dimensions
Spherical wood-like texture centred at origin
Spherical wood-like texture centred at origin
(x v)
Extracts the x component of a position vector
Extracts the x component of a position vector
(xor)
(xor a)
(xor a & more)
Returns logical xor of values
Returns logical xor of values
(y v)
Extracts the y component of a position vector
Extracts the y component of a position vector
(z v)
Extracts the z component of a position vector
Extracts the z component of a position vector
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close