Struct Scale
Represents a scaling.
Implements
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public readonly struct Scale : IEquatable<Scale>
Constructors
| Edit this page View SourceScale(float)
Initializes a new instance of the Scale class using the provided values.
Declaration
public Scale(float scale = 1)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The value used for horizontal and vertical scaling. 0 if not set. |
Scale(float, float)
Initializes a new instance of the Scale class using the provided values.
Declaration
public Scale(float horizontal, float vertical)
Parameters
Type | Name | Description |
---|---|---|
float | horizontal | The value used for horizontal scaling. |
float | vertical | The value used for vertical scaling. |
Properties
| Edit this page View SourceHorizontal
Gets the horizontal scaling value.
Declaration
public float Horizontal { get; }
Property Value
Type | Description |
---|---|
float |
Vertical
Gets the vertical scaling value.
Declaration
public float Vertical { get; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceDeconstruct(out float, out float)
Deconstructs the scale into the horizontal and vertical value.
Declaration
public void Deconstruct(out float horizontalScale, out float verticalScale)
Parameters
Type | Name | Description |
---|---|---|
float | horizontalScale | The horizontal scaling value. |
float | verticalScale | The vertical scaling value. |
Equals(Scale)
Declaration
public bool Equals(Scale other)
Parameters
Type | Name | Description |
---|---|---|
Scale | other | The scale to test. |
Returns
Type | Description |
---|---|
bool |
|
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to test. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
| Edit this page View SourceGetHashCode()
Returns a hash code for this Scale.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer value that specifies the hash code for this Scale. |
Overrides
| Edit this page View SourceToString()
Converts the Horizontal and Vertical value of this Scale to a human-readable string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that contains the Horizontal and Vertical value of this Scale. For example "[Horizontal: 1, Vertical: 0.5]". |
Overrides
Operators
| Edit this page View Sourceoperator +(Scale, float)
Declaration
public static Scale operator +(Scale scale, float value)
Parameters
Type | Name | Description |
---|---|---|
Scale | scale | The Scale. |
float | value | The value to add. |
Returns
Type | Description |
---|---|
Scale | A new Scale representing the addition of the Scale and the provided value. |
operator /(Scale, float)
Declaration
public static Scale operator /(Scale scale, float value)
Parameters
Type | Name | Description |
---|---|---|
Scale | scale | The Scale. |
float | value | The value to device with. |
Returns
Type | Description |
---|---|
Scale | A new Scale representing the division of the Scale and the provided value. |
operator ==(Scale, Scale)
Returns a value that indicates whether two specified Scale are equal.
Declaration
public static bool operator ==(Scale scale1, Scale scale2)
Parameters
Type | Name | Description |
---|---|---|
Scale | scale1 | The first Scale to compare. |
Scale | scale2 | The second Scale to compare. |
Returns
Type | Description |
---|---|
bool |
|
implicit operator Scale(float)
Converts a float to a Scale.
Declaration
public static implicit operator Scale(float scale)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The scale value to convert. |
Returns
Type | Description |
---|---|
Scale |
operator !=(Scale, Scale)
Returns a value that indicates whether two specified Scale are equal.
Declaration
public static bool operator !=(Scale scale1, Scale scale2)
Parameters
Type | Name | Description |
---|---|---|
Scale | scale1 | The first Scale to compare. |
Scale | scale2 | The second Scale to compare. |
Returns
Type | Description |
---|---|
bool |
|
operator *(Scale, float)
Declaration
public static Scale operator *(Scale scale, float value)
Parameters
Type | Name | Description |
---|---|---|
Scale | scale | The Scale. |
float | value | The value to multiply with. |
Returns
Type | Description |
---|---|
Scale | A new Scale representing the multiplication of the Scale and the provided value. |
operator -(Scale, float)
Declaration
public static Scale operator -(Scale scale, float value)
Parameters
Type | Name | Description |
---|---|---|
Scale | scale | The Scale. |
float | value | The value to substract. |
Returns
Type | Description |
---|---|
Scale | A new Scale representing the subtraction of the Scale and the provided value. |