Functions for clisk image synthesis. Images should be generated by composing these functions.
Functions for clisk image synthesis. Images should be generated by composing these functions.
(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.
(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)
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)
(clamp v low high)
(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
(compose f g)
(compose f g & more)
Composes two or more vector functions
Composes two or more vector functions
(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)
(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}})
(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]
(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.
(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.
(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.
(limited-loop limit [& bindings] form)
(limited-recur bailout-result & values)
(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
(offset offset f)
Offsets a function by a specified amount
Offsets a function by a specified amount
(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)
(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.
(radius v)
Returns the raidus of a vector in polar co-ordinates
Returns the raidus of a vector in polar co-ordinates
(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
(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)
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.
(scale factor f)
Scales a function by a given factor.
Scales a function by a given factor.
(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.
Sigmoid function on a scalar or vector in range [0..1]
Sigmoid function on a scalar or vector in range [0..1]
(square-function x)
Retuns the square of a number.
Retuns the square of a number.
A step function that works on both vectors and scalars
A step function that works on both vectors and scalars
(t v)
Extracts the t component of a position vector
Extracts the t component of a position vector
(theta v)
Returns the angle of a vector in polar co-ordinates
Returns the angle of a vector in polar co-ordinates
Triangular wave function in range [0..1]
Triangular wave function in range [0..1]
(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.
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-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.
(x v)
Extracts the x component of a position vector
Extracts the x component of a position vector
(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