Divooka Reference

Texture Transforms

10 nodes

On this page 10

Break Up Tiling

Function

Breaks up a tiling texture's repetition: a texture several copies across, in which every copy shows the texture moved, turned and scaled at random, blended across the seams so no two copies match and no seam shows. Across a floor or a hillside, where the same stone in the same place every metre gives a tiling texture away, this is what hides it. The result still tiles, but only every Tiles Across copies.

Signature
BreakUpTiling -> Texture
    texture: Texture
    tilesAcross: Integer
    blend: Number
    rotation: Number
    scaleVariation: Number
    contrast: Number
    seed: Integer
    size: Integer
Texture BreakUpTiling(
    Texture texture,
    int tilesAcross = 4,
    double blend = 0.3,
    double rotation = 360,
    double scaleVariation = 0,
    double contrast = 0.5,
    int seed = 0,
    int size = 2048)

Parameters

nametypedefaultdescription
textureTexture—The tiling texture.
tilesAcrossInteger4How many copies of the texture the result is across, and how far apart its own repetition is.
blendNumber0.3How wide the seams' blend is, as a share of a copy: 0 cuts hard, 1 blends across the whole copy.
rotationNumber360How far each copy may turn, in degrees: 0 for a texture with a direction (planks, brushed metal, rain), 360 for one without.
scaleVariationNumber0How much each copy may grow or shrink, 0 to 0.5.
contrastNumber0.5How much the brighter (higher) copy wins where two meet, 0 to 1: high keeps stones whole across a seam, 0 cross-fades.
seedInteger0Which random arrangement.
sizeInteger2048The result's width and height in pixels; it holds Tiles Across copies, so each copy gets this divided by Tiles Across.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Cartesian To Polar

Function

Wraps a texture round the centre: its left-to-right becomes the angle round, its top-to-bottom the distance out. A row of stripes becomes rings; a gradient becomes a sunburst.

Signature
CartesianToPolar(texture: Texture) -> Texture
Texture CartesianToPolar(Texture texture)

Parameters

nametypedefaultdescription
textureTexture—The texture.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Make It Tile

Function

Makes a texture that does not tile - a photograph - tile, by blending it with two copies of itself, one moved half a tile and one a quarter, each used away from its own seams. The original's seams are its edges, the half copy's a cross through the middle, the quarter copy's a grid between them; no point lies on all three, so every point has a copy with no seam there, and the blend's edges are broken up by noise so they do not show as lines.

Signature
MakeItTile -> Texture
    texture: Texture
    blendWidth: Number
    seed: Integer
Texture MakeItTile(
    Texture texture,
    double blendWidth = 0.25,
    int seed = 0)

Parameters

nametypedefaultdescription
textureTexture—The texture.
blendWidthNumber0.25How far from its seams a copy fades in, as a share of the texture: wider hides seams better and shows more doubling.
seedInteger0Which noise breaks up the fades' edges.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Mirror

Function

Reflects one half of a texture onto the other: symmetric ornaments, or a quick way to hide a seam.

Signature
Mirror -> Texture
    texture: Texture
    axis: Mirror Axis
    keepSecondHalf: Truth
Texture Mirror(
    Texture texture,
    MirrorAxis axis = MirrorAxis.Horizontal,
    bool keepSecondHalf = false)

Parameters

nametypedefaultdescription
textureTexture—The texture.
axisMirror AxisHorizontalMirror across, down, or both.
keepSecondHalfTruthFalseKeep the right (or bottom) half and reflect it, rather than the left (or top).

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Offset

Function

Moves a texture across and down, wrapping round. Half and half shows what was at the corners in the middle, which is where a seam would show.

Signature
Offset -> Texture
    texture: Texture
    offsetX: Number
    offsetY: Number
Texture Offset(
    Texture texture,
    double offsetX = 0.5,
    double offsetY = 0.5)

Parameters

nametypedefaultdescription
textureTexture—The texture.
offsetXNumber0.5Across, as a share of the width.
offsetYNumber0.5Down, as a share of the height.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Polar To Cartesian

Function

Unwraps a texture from round its centre: the angle round becomes left-to-right, the distance out top-to-bottom. Rings become stripes.

Signature
PolarToCartesian(texture: Texture) -> Texture
Texture PolarToCartesian(Texture texture)

Parameters

nametypedefaultdescription
textureTexture—The texture.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Repeat

Function

Repeats a texture a whole number of times across and down at the same size, so it tiles finer.

Signature
Repeat -> Texture
    texture: Texture
    countX: Integer
    countY: Integer
Texture Repeat(Texture texture, int countX = 2, int countY = 2)

Parameters

nametypedefaultdescription
textureTexture—The texture.
countXInteger2Repeats across.
countYInteger2Repeats down.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Resize

Function

Resamples a texture to a new size: box-filtered when it shrinks, bilinear when it grows.

Signature
Resize(texture: Texture, size: Integer) -> Texture
Texture Resize(Texture texture, int size = 512)

Parameters

nametypedefaultdescription
textureTexture—The texture.
sizeInteger512The new width and height in pixels.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Rotate90

Function

Turns a texture by quarter turns, exactly, with no resampling.

Signature
Rotate90(texture: Texture, quarterTurns: Integer) -> Texture
Texture Rotate90(Texture texture, int quarterTurns = 1)

Parameters

nametypedefaultdescription
textureTexture—The texture.
quarterTurnsInteger1Quarter turns clockwise.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing

Transform

Function

Moves, turns and scales a texture about its centre, reading across its edges so the result still tiles when the scale is a whole number and the turn a quarter.

Signature
Transform -> Texture
    texture: Texture
    offsetX: Number
    offsetY: Number
    rotation: Number
    scale: Number
Texture Transform(
    Texture texture,
    double offsetX = 0,
    double offsetY = 0,
    double rotation = 0,
    double scale = 1)

Parameters

nametypedefaultdescription
textureTexture—The texture.
offsetXNumber0Moves it across, as a share of the width.
offsetYNumber0Moves it down, as a share of the height.
rotationNumber0Turns it, in degrees clockwise.
scaleNumber1Repeats it this many times across; 2 shows it twice as small.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Transforms
Package
Image Processing