EnvironmentMapImage

Description

sealed class Tinman.Engine.Components.EnvironmentMapImage

Derived from

EnvironmentMap abstract

An IEnvironmentMap implementation that samples the given ColorBuffer.

Public / Constructors

Environment​Map​Image


public constructor EnvironmentMapImage → (2)

pixels in : ColorBuffer

[not-null]
The environment map image. The top-left corner is mapped to 90°N 180°W, the bottom-right corner is mapped to 90°S 180°E.

scale opt : float64 = 1

The value for IEnvironmentMap.MaximumEnvironmentColor.

Creates a new instance of EnvironmentMapImage.

The environment map will not have a prominent light.

Hdr​Automatic


public static method HdrAutomatic → (3)

image in : IImage

[not-null]
The high-dynamic range image to use.

maximum opt : float64 = 256

The maximum value to use for IEnvironmentMap.MaximumEnvironmentColor.

one opt : float64 = 1

The raw pixel value of image in to associate with the value 1 (full intensity) of a low-dynamic range color value.

returns → EnvironmentMapImage

The created EnvironmentMapImage.

Creates a new instance of EnvironmentMapImage.

This method uses RangeD.End of IImageInfo.Values to find the maximum HDR scale, which will be clamped to [one opt.. one opt*maximum opt] to obtain the effective HDR scale that will be returned by IEnvironmentMap.MaximumEnvironmentColor. The pixel values of image in will be scaled accordingly by using IImageOps.SetRange.

ValidatingException

If a file format validation error has occurred while loading image in.

IOException

If an I/O error has occurred while loading image in.

Hdr​Manual


public static method HdrManual → (2)

image in : IImage

[not-null]
The high-dynamic range image to use, which is assumed to have been prepared with IImageOps.SetRange in order to contain proper intensities.

maximum in : float64

The value to use for IEnvironmentMap.MaximumEnvironmentColor.

returns → EnvironmentMapImage

The created EnvironmentMapImage.

Creates a new instance of EnvironmentMapImage.

ValidatingException

If a file format validation error has occurred while loading image in.

IOException

If an I/O error has occurred while loading image in.

Ldr


public static method Ldr → (1)

image in : IImage

[not-null]
The low-dynamic range image to use.

returns → EnvironmentMapImage

The created EnvironmentMapImage.

Creates a new instance of EnvironmentMapImage.

ValidatingException

If a file format validation error has occurred while loading image in.

IOException

If an I/O error has occurred while loading image in.

Public / Methods

From​Pixel

2 overloads


[Pure]
public method FromPixel1 → (1)

in : Vec2I

The pixel coordinates.

returns → LatLon

The altitude (latitude) and azimuth (longitude) angles.

Converts the given pixel coordinates into altitude and azimuth angles.


[Pure]
public method FromPixel2 → (2)

in : int32

The pixel X-coordinate.

in : int32

The pixel X-coordinate.

returns → LatLon

The altitude (latitude) and azimuth (longitude) angles.

Converts the given pixel coordinates into altitude and azimuth angles.

Light​At

2 overloads


public method LightAt1 → (1)

lightCoords in : Vec2I

The pixel coordinates of the center of the prominent light.

returns → EnvironmentMapImage

this

Specifies the location of the prominent light source.


public method LightAt2 → (2)

lightCoords in : Vec2I

The pixel coordinates of the center of the prominent light.

lightOuter in : Vec2I

The pixel coordinates of a point on the outer edge of the prominent light.

returns → EnvironmentMapImage

this

Specifies the location of the prominent light source.

To​Pixel

2 overloads


[Pure]
public method ToPixel1 → (2)

altitude in : float64

The altitude angle, in degrees.

azimuth in : float64

The azimuth angle, in degrees.

returns → Vec2D

The pixel coordinates.

Converts the given altitude and azimuth angles to pixel coordinates.


[Pure]
public method ToPixel2 → (1)

latLon in : LatLon

The altitude (latitude) and azimuth (longitude) angles.

returns → Vec2D

The pixel coordinates.

Converts the given altitude and azimuth angles to pixel coordinates.