Show / Hide Table of Contents

Struct SwsAlgorithm

Represents a scaling algorithm for use with FFmpeg's libswscale, encapsulating the algorithm flags and optional scaling parameters. These parameters can tune the behavior of the scaling algorithm for finer control over image scaling quality.

Implements
IEquatable<SwsAlgorithm>
Inherited Members
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: FFmpeg.Images
Assembly: FFmpeg.dll
Syntax
public readonly struct SwsAlgorithm : IEquatable<SwsAlgorithm>

Constructors

View Source

SwsAlgorithm(SwsFlags, double, double)

Initializes a new instance of the SwsAlgorithm struct with the specified scaling algorithm flags and optional parameters.

Declaration
public SwsAlgorithm(SwsFlags algorithmFlags, double param1 = 123456, double param2 = 123456)
Parameters
Type Name Description
SwsFlags algorithmFlags

The scaling algorithm flags used to determine the interpolation or filtering method.

double param1

An optional parameter to tune the behavior of the algorithm (default: DEFAULT_PARAM).

double param2

An optional second parameter for additional tuning of the algorithm (default: DEFAULT_PARAM).

Fields

View Source

DEFAULT_PARAM

The default value for algorithm parameters when none are specified.

Declaration
public const int DEFAULT_PARAM = 123456
Field Value
Type Description
int

Properties

View Source

AlgorithmFlags

Gets the scaling algorithm flags that specify the type of interpolation or filtering used.

Declaration
public SwsFlags AlgorithmFlags { get; }
Property Value
Type Description
SwsFlags
View Source

Param1

Gets the first parameter used for fine-tuning the scaling algorithm, specific to the algorithm.

Declaration
public double Param1 { get; }
Property Value
Type Description
double
View Source

Param2

Gets the second parameter used for additional fine-tuning of the scaling algorithm, specific to the algorithm.

Declaration
public double Param2 { get; }
Property Value
Type Description
double

Methods

View Source

Area()

Creates an area-based scaling algorithm with no additional tuning.

Declaration
public static SwsAlgorithm Area()
Returns
Type Description
SwsAlgorithm
View Source

Bicubic()

Creates a bicubic scaling algorithm with default parameters.

Declaration
public static SwsAlgorithm Bicubic()
Returns
Type Description
SwsAlgorithm
View Source

Bicubic(double, double)

Creates a bicubic scaling algorithm with adjustable parameters.

For Bicubic, param1 tunes the value of f(1), and param2 tunes f'(1), which influence the shape of the basis function.

Declaration
public static SwsAlgorithm Bicubic(double param1 = 0, double param2 = 0.6)
Parameters
Type Name Description
double param1

Tuning parameter for f(1) (default: 0).

double param2

Tuning parameter for f'(1) (default: 0.6).

Returns
Type Description
SwsAlgorithm
View Source

Bicublin()

Creates a bicublin scaling algorithm with default parameters.

Declaration
public static SwsAlgorithm Bicublin()
Returns
Type Description
SwsAlgorithm
View Source

Bicublin(double, double)

Creates a bicublin scaling algorithm with adjustable parameters.

For Bicublin, param1 tunes f(1) and param2 tunes f'(1), similar to the bicubic filter.

Declaration
public static SwsAlgorithm Bicublin(double param1 = 0, double param2 = 0.6)
Parameters
Type Name Description
double param1

Tuning parameter for f(1) (default: 0).

double param2

Tuning parameter for f'(1) (default: 0.6).

Returns
Type Description
SwsAlgorithm
View Source

Bilinear()

Creates a bilinear scaling algorithm with no additional tuning.

Declaration
public static SwsAlgorithm Bilinear()
Returns
Type Description
SwsAlgorithm
View Source

Equals(SwsAlgorithm)

Declaration
public bool Equals(SwsAlgorithm other)
Parameters
Type Name Description
SwsAlgorithm other
Returns
Type Description
bool
View Source

Equals(object?)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
ValueType.Equals(object)
View Source

Experimental()

Creates an experimental scaling algorithm with a default parameter.

Declaration
public static SwsAlgorithm Experimental()
Returns
Type Description
SwsAlgorithm
View Source

Experimental(double)

Creates an experimental scaling algorithm with adjustable parameters.

Specific to the experimental algorithm, param1 is used for custom tuning.

Declaration
public static SwsAlgorithm Experimental(double param1 = 1)
Parameters
Type Name Description
double param1

Custom tuning parameter (default: 1.0).

Returns
Type Description
SwsAlgorithm
View Source

FastBilinear()

Creates a fast bilinear scaling algorithm with no additional tuning.

Declaration
public static SwsAlgorithm FastBilinear()
Returns
Type Description
SwsAlgorithm
View Source

Gauss()

Creates a Gaussian scaling algorithm with default parameters.

Declaration
public static SwsAlgorithm Gauss()
Returns
Type Description
SwsAlgorithm
View Source

Gauss(double)

Creates a Gaussian scaling algorithm with an adjustable parameter.

For Gauss, param1 tunes the exponent of the Gaussian function, affecting the cutoff frequency of the filter.

Declaration
public static SwsAlgorithm Gauss(double param1 = 3)
Parameters
Type Name Description
double param1

Tuning parameter for the Gaussian exponent (default: 3.0).

Returns
Type Description
SwsAlgorithm
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

Lanczos()

Creates a Lanczos scaling algorithm with default parameters.

Declaration
public static SwsAlgorithm Lanczos()
Returns
Type Description
SwsAlgorithm
View Source

Lanczos(double)

Creates a Lanczos scaling algorithm with an adjustable parameter.

For Lanczos, param1 tunes the width of the window function used by the Lanczos filter.

Declaration
public static SwsAlgorithm Lanczos(double param1 = 3)
Parameters
Type Name Description
double param1

Tuning parameter for the width of the Lanczos window function (default: 3).

Returns
Type Description
SwsAlgorithm
View Source

NearestNeighbor()

Creates a nearest neighbor scaling algorithm (point sampling).

Declaration
public static SwsAlgorithm NearestNeighbor()
Returns
Type Description
SwsAlgorithm
View Source

Sinc()

Creates a Sinc scaling algorithm with no additional tuning.

Declaration
public static SwsAlgorithm Sinc()
Returns
Type Description
SwsAlgorithm
View Source

Spline()

Creates a Spline scaling algorithm with no additional tuning.

Declaration
public static SwsAlgorithm Spline()
Returns
Type Description
SwsAlgorithm

Operators

View Source

operator ==(SwsAlgorithm, SwsAlgorithm)

Declaration
public static bool operator ==(SwsAlgorithm left, SwsAlgorithm right)
Parameters
Type Name Description
SwsAlgorithm left
SwsAlgorithm right
Returns
Type Description
bool
View Source

operator !=(SwsAlgorithm, SwsAlgorithm)

Declaration
public static bool operator !=(SwsAlgorithm left, SwsAlgorithm right)
Parameters
Type Name Description
SwsAlgorithm left
SwsAlgorithm right
Returns
Type Description
bool

Implements

IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX