Checkerboard

ColourShader
public sealed class Checkerboard : ColourShader
Implements a shader for chequerboard fills.

Constructors

Checkerboard

#
public Checkerboard(ColourShader colour0, ColourShader colour1, int size, Angle angle)
Create a new angled square pattern.
colour0 (ColourShader)Colour for odd squares.
colour1 (ColourShader)Colour for even squares.
size (int)Size of squares.
angle (Angle)Angle of squares.

Checkerboard

#
public Checkerboard(ColourShader colour0, ColourShader colour1, int size)
Create a new square pattern.
colour0 (ColourShader)Colour for odd squares.
colour1 (ColourShader)Colour for even squares.
size (int)Size of squares.

Checkerboard

#
public Checkerboard(ColourShader colour0, ColourShader colour1, int sizeX, int sizeY, Angle angle)
Create a new angled rectangular pattern.
colour0 (ColourShader)Colour for odd squares.
colour1 (ColourShader)Colour for even squares.
sizeX (int)Width of squares.
sizeY (int)Height of squares.
angle (Angle)Angle of squares.

Checkerboard

#
public Checkerboard(ColourShader colour0, ColourShader colour1, int sizeX, int sizeY)
Create a new rectangular pattern.
colour0 (ColourShader)Colour for odd squares.
colour1 (ColourShader)Colour for even squares.
sizeX (int)Width of squares.
sizeY (int)Height of squares.

Methods

ColourAt

#
public override Color ColourAt(Ray ray, IObjectStack stack)
Evaluate this shader at a specific ray location.
ray (Ray)Coincident ray.
stack (IObjectStack)Object stack context.

Dilate

public ColourShader Dilate(double sx, double sy)
Apply a dilation (or scaling) transformation to this shader.
inherited fromColourShader
sx (double)Horizontal dilation.
sy (double)Vertical dilation.
Dilated shader.

Fade

public ColourShader Fade(ValueShader transparency, bool combine)
Add a transparency layer to this shader.
inherited fromColourShader
transparency (ValueShader)Transparency layer.
combine (bool)If true, overlay transparency is combined with existing transparency. If false, overlay transparency overrules the existing transparency.
Modified shader.

Fade

public ColourShader Fade(ValueShader transparency)
Add a transparency layer to this shader.
inherited fromColourShader
transparency (ValueShader)Transparency layer.
Modified shader.

ResolveColour

protected Color ResolveColour(Color colour, Ray ray, IObjectStack stack)
Utility function for resolving a colour with the background.
inherited fromColourShader
colour (Color)Colour to resolve.
ray (Ray)Ray associated with colour location.
stack (IObjectStack)Object stack context.
Resolved colour.

Rotate

public ColourShader Rotate(Angle angle)
Apply a rotation transformation to this shader.
inherited fromColourShader
angle (Angle)Rotation angle (counter-clockwise).
Rotated shader.

Transform

public ColourShader Transform(Transform2D transform)
Apply a custom transformation to this shader.
inherited fromColourShader
transform (Transform2D)Transformation.
Transformed shader.

Translate

public ColourShader Translate(double dx, double dy)
Apply a translation transformation to this shader.
inherited fromColourShader
dx (double)Horizontal translation.
dy (double)Vertical translation.
Translated shader.