IPixelLayer

Description

interface Tinman.Terrain.Heightmaps.Painting.IPixelLayer

Derived from

IPixelLayerOps
IHeightmapLayers
IConfigurable

Extended by

PixelLayer abstract

Base interface for pixel layers.

A IPixelLayer object reads data from zero or more input heightmap layers of the input buffer (see PaintingBuffer), performs some implementation-dependent computations and finally outputs resp. updates pixel data in the output buffer (see ColorBuffer).

Public / Methods

Compute​Layer​Pixels


public method ComputeLayerPixels → (2)

input in : PaintingBuffer

[not-null]
The input buffer. A IPixelLayer object is only allowed to read data from those heightmap layers that have been indicated by IHeightmapLayers.LayerMask.

output in : ColorBuffer

[not-null]
The output buffer. The output buffer size must not be smaller than the input buffer size.

Computes the pixels of this layer.

Public / Attributes

Padding


public attribute Padding → (get)

value : int32

[>=0]
The number of padding pixels.

The amount of padding samples that this pixel layer requires in order to produce seamless output.

The following figure shows an 8x8 pixel layer with a padding of 2, which yields a size of 4x4 for the inner region that contains seamless data:

+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |###|###|###|###|   |   |
+---+---+---+---+---+---+---+---+
|   |   |###|###|###|###|   |   |
+---+---+---+---+---+---+---+---+
|   |   |###|###|###|###|   |   |
+---+---+---+---+---+---+---+---+
|   |   |###|###|###|###|   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+

Extensions

Adjust


public static method Adjust → (3)

brightness in : int32

The adjustment factor for image brightness in the range [-1000..1000].

saturation opt : int32 = 0

The adjustment factor for image saturation in the range [-1000..1000].

slopeBased opt : bool = false

Modulate color adjustment factors with terrain slope?

returns → IPixelLayer

The resulting pixel layer.

Adjust the brightness and saturation of the output pixels.

If slopes have been computed (i.e. PaintingBuffer.Slopes is not null), the adjustment factors for each pixel are computed as follows:

90° >= slope >= 0°
b' = slope / 90 * b
s' = slope / 90 * s

where slope is the slope angle of the pixel, b is the brightness in parameter, s is the saturation opt parameter. The values b' and s' are then passed to Colors.Adjust.

See also

Colors.Adjust

Brush


[OwnerReturn]
public static method Brush → ()

returns → IBrush

The flexible brush that wraps this pixel layer.

Wraps this pixel layer in a flexible brush.

Combine


public static method Combine → (2)

other in : IPixelLayer

[not-null]
The other pixel layer.

colorOp opt : ColorOp = ColorOp.Blend

The color operation to use.

returns → IPixelLayer

The resulting pixel layer.

Combines the result of this pixel layer with the result of the given one.

Compute​Layer​Pixels


public static method ComputeLayerPixels → (3)

input in : HeightmapRegion

[not-null]
The input heightmap region.

step opt : int32 = 1

The sample step that has been used to fill input in. This will always be a power of two.

output opt : ColorBuffer = null

Optional output buffer. If null a new buffer will be created.

returns → ColorBuffer

The resulting color buffer.

Computes the pixels of this layer.

Contour


public static method Contour → (6)

value in : ContourValue

The contour values.

range in : ContourRange

The contour settings.

fillColor opt : int64 = 0

Color of contour fill. Set to 0 to disable contour fill.

lineColor opt : int64 = 0

Color of contour lines. Set to 0 to disable contour lines.

lineStrength opt : int32 = 0

[0..31]
The strength of contour lines: 0 is light and 31 is heavy. Defaults to 0.

materialId opt : int32 = 0

The material ID to use if value in is ContourValue.Material.

returns → IPixelLayer

The resulting pixel layer.

Renders contour lines onto the output pixel buffer.

Modulate


public static method Modulate → ()

returns → IPixelLayer

The resulting pixel layer.

Modulates the alpha channel of the output pixels with the HeightmapRegion.Coverage layer of PaintingBuffer.Samples.

Shade


public static method Shade → (6)

colorFrom in : int64

The color shade at elevationFrom in.

colorTo in : int64

The color shade at elevationTo in.

elevationFrom in : float64

The altitude value at the start of the shade interval, according to HeightmapRegion.Vertical of PaintingBuffer.Samples.

elevationTo in : float64

The altitude value at the start of the shade interval, according to HeightmapRegion.Vertical of PaintingBuffer.Samples.

falloff in : float64

Length of falloff interval, according to HeightmapRegion.Vertical of PaintingBuffer.Samples.

power opt : float64 = 1

Optional exponent to use for transforming the linear blending factor.

returns → IPixelLayer

The resulting pixel layer.

Applies a color shade to the output pixels, depending on the elevation values in PaintingBuffer.Samples

For shading, terrain altitude values in vertical units are used (see IHeightmap.Vertical).