Skip to content

StackFaces

Namespace Nfty.Model in assembly Nfty.Model.

public sealed class StackFaces : IDisposable

The two face pictures of a risen stack: what the front and the back of each column show, each taken from the layer that OWNS that face by the union rule, plus the seam where a column's wall switches from one owner's color to the other's.

Remarks

Owns both images. Non-solid pixels are clear in both. For an all-paper stack both faces equal the art and every seam is 0.

Properties

Back

public Image<Rgba32> Back { get; }

What the back of each column shows.

Front

public Image<Rgba32> Front { get; }

What the front of each column shows.

Height

public int Height { get; }

Height in pixels.

Width

public int Width { get; }

Width in pixels.

Methods

BackColored(int, int)

public int BackColored(int x, int y);

How many voxels, counted from the column's back end, take the back color; the rest take the front color. 0 on a non-solid pixel.

Parameters

  • x (int) - Column.
  • y (int) - Row, 0 at the top.

Returns. The voxel count.

Clone()

public StackFaces Clone();

An independent copy; the caller owns it.

Returns. The copy.

CopyRegionFrom(StackFaces, Rectangle)

public void CopyRegionFrom(StackFaces source, Rectangle area);

Copies a rectangle of another set of faces over this one, in place (the same size).

Parameters

  • source (StackFaces) - The faces to read.
  • area (Rectangle) - The pixels to copy; clipped to the picture.

Exceptions

  • ArgumentException - The faces are another size.

Dispose()

public void Dispose();

Disposes the front and back pictures.

Uniform(Image<Rgba32>)

public static StackFaces Uniform(Image<Rgba32> art);

The faces of a single picture: both are the art, and the seam is 0.

Parameters

  • art (Image<Rgba32>) - The picture; cloned, not taken.

Returns. Faces the caller owns.