Table of Contents

Class ImageScaler

Namespace
Stride.Rendering.Images
Assembly
Stride.Rendering.dll

Scales an input texture to an output texture (down or up, depending on the relative size between input and output)

public sealed class ImageScaler : ImageEffectShader, IComponent, IReferencable, ICollectorHolder, IImageEffect, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
Inheritance
ImageScaler
Implements
Inherited Members
Extension Methods

Remarks

This effect can be used for downscaling or upscaling if the output rendertarget is smaller/larger than the input texture

Constructors

ImageScaler()

public ImageScaler()

ImageScaler(SamplingPattern, bool)

Initializes a new instance of the ImageScaler class.

public ImageScaler(SamplingPattern samplingPattern, bool delaySetRenderTargets = false)

Parameters

samplingPattern SamplingPattern

9 taps multi-sampler (Expanded) or 1-tap Point sampling (Linear)

delaySetRenderTargets bool

Properties

Color

Gets or sets the color multiplier. Default is White

public Color4 Color { get; set; }

Property Value

Color4

The color multiplier.

FilterPattern

public SamplingPattern FilterPattern { get; }

Property Value

SamplingPattern

IsOnlyChannelRed

Copy only the red channel. Default is false

public bool IsOnlyChannelRed { get; set; }

Property Value

bool

true if this instance is only channel red; otherwise, false.

Sampler

Gets or sets the sampler used to sample the input texture. Default is LinearClamp

public SamplerState Sampler { get; set; }

Property Value

SamplerState

The sampler.

Methods

SetDefaultParameters()

Sets the default parameters (called at constructor time and if Reset() is called)

protected override void SetDefaultParameters()

UpdateParameters()

Updates the effect Parameters from properties defined in this instance. See remarks.

protected override void UpdateParameters()

Remarks

By default, all the input textures will be remapped to Texture0...etc.

Exceptions

InvalidOperationException

Expecting less than 10 textures in input