public sealed class Pixel
A single pixel in a raycasting process.

Constructors

Pixel

#
public Pixel(int x, int y)
Create a new, empty pixel.
x (int)X coordinate.
y (int)Y coordinate.

Properties

Colour

#
public Color Colour { get; }
Gets the colour implied by all the samples thus far.

Completed

#
public bool Completed { get; set; }
Bookkeeping property useful for keeping track of pixel 'liveness' over the course of a raysampling process. The pixel itself does not access or read this field.

Consistency

#
public int Consistency { get; set; }
Bookkeeping property useful for keeping track of pixel consistency over the course of a raysampling process. The pixel itself does not access or read this field.

N

#
public int N { get; }
Gets the number of samples made through this pixel.

X

#
public int X { get; }
Gets the pixel X coordinate.

Y

#
public int Y { get; }
Gets the pixel Y coordinate.

Methods

AddSample

#
public void AddSample(Color colour, out float difference)
Add a new sample to this pixel. This method is threadsafe.
colour (Color)Colour to add.
difference (out float)The difference between the new colour and the current colour.

AddSample

#
public void AddSample(Color colour)
Add a new sample to this pixel. This method is threadsafe.
colour (Color)Colour to add.
The difference between the new colour and the current colour.

NextRay

#
public Ray NextRay()
Gets the next ray position based on the pixel [x,y] coordinates and the sampling density. This method is threadsafe.
Ray.

SetColour

#
public void SetColour(Color colour)
Set the colour of this pixel and revert the N counter.
colour (Color)Colour to set.