Table of Contents

Class AspectRatio

Namespace
Bonsai.Shaders
Assembly
Bonsai.Shaders.dll

Represents an operator that calculates the ratio of window viewport width to its height for each viewport size in the sequence.

public class AspectRatio : Transform<Size, float>
Inheritance
AspectRatio
Inherited Members

Methods

Process(IObservable<INativeWindow>)

Calculates the ratio of window viewport width to its height for each window in an observable sequence.

public IObservable<float> Process(IObservable<INativeWindow> source)

Parameters

source IObservable<INativeWindow>

A sequence of INativeWindow objects.

Returns

IObservable<float>

A sequence of floating-point values representing the aspect ratio for each active viewport in the source sequence.

Process(IObservable<Size>)

Calculates the ratio of window viewport width to its height for each size in an observable sequence.

public override IObservable<float> Process(IObservable<Size> source)

Parameters

source IObservable<Size>

A sequence of Size values representing the viewport width and height.

Returns

IObservable<float>

A sequence of floating-point values representing the aspect ratio for each size in the source sequence.

Process(IObservable<Tuple<float, float>>)

Calculates the ratio of window viewport width to its height for each size pair in an observable sequence.

public IObservable<float> Process(IObservable<Tuple<float, float>> source)

Parameters

source IObservable<Tuple<float, float>>

A sequence of floating-point value pairs representing the viewport width and height.

Returns

IObservable<float>

A sequence of floating-point values representing the aspect ratio for each size pair in the source sequence.

Process<TEventArgs>(IObservable<EventPattern<INativeWindow, TEventArgs>>)

Calculates the ratio of window viewport width to its height for each window event in an observable sequence.

public IObservable<float> Process<TEventArgs>(IObservable<EventPattern<INativeWindow, TEventArgs>> source)

Parameters

source IObservable<EventPattern<INativeWindow, TEventArgs>>

A sequence of event data generated from a shader window.

Returns

IObservable<float>

A sequence of floating-point values representing the aspect ratio for the current viewport in each window in the sequence of event data.

Type Parameters

TEventArgs

The type of the event data generated by the window event.

Process<TSource>(IObservable<TSource>)

Calculates the ratio of the shader window viewport width to its height, at the time the source sequence emits a notification.

public IObservable<float> Process<TSource>(IObservable<TSource> source)

Parameters

source IObservable<TSource>

The sequence containing the notifications indicating when to calculate the current aspect ratio of the shader window.

Returns

IObservable<float>

A sequence of floating-point values representing the current aspect ratio of the shader window, at the time when the source sequence emits a notification.

Type Parameters

TSource

The type of the elements in the source sequence.