Added ISpanFormattable interface to pixel types
このコミットが含まれているのは:
1 親
06b12f5a6c
コミット
72cce16597
7ファイル変更
+91
-7
検索条件に一致するファイルはありません
@@ -18,7 +18,7 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
/// <remarks>This struct is fully mutable.</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Bgra32 : IEquatable<Bgra32>, IUnorm<Vector4>, IUnorm<Float4>
|
||||
public struct Bgra32 : IEquatable<Bgra32>, ISpanFormattable, IUnorm<Vector4>, IUnorm<Float4>
|
||||
{
|
||||
/// <summary>
|
||||
/// The blue component.
|
||||
@@ -118,4 +118,16 @@ public struct Bgra32 : IEquatable<Bgra32>, IUnorm<Vector4>, IUnorm<Float4>
|
||||
|
||||
/// <inheritdoc />
|
||||
public override readonly string ToString() => $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})";
|
||||
|
||||
/// <inheritdoc />
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})", out charsWritten);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct R16 : IEquatable<R16>, IUnorm<float>
|
||||
public struct R16 : IEquatable<R16>, ISpanFormattable, IUnorm<float>
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -77,4 +77,16 @@ public struct R16 : IEquatable<R16>, IUnorm<float>
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(R16)}({this.R})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(R16)}({this.R})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(R16)}({this.R})", out charsWritten);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct R8 : IEquatable<R8>, IUnorm<float>
|
||||
public struct R8 : IEquatable<R8>, ISpanFormattable, IUnorm<float>
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -77,4 +77,16 @@ public struct R8 : IEquatable<R8>, IUnorm<float>
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(R8)}({this.R})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(R8)}({this.R})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(R8)}({this.R})", out charsWritten);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rg16 : IEquatable<Rg16>, IUnorm<Vector2>, IUnorm<Float2>
|
||||
public struct Rg16 : IEquatable<Rg16>, ISpanFormattable, IUnorm<Vector2>, IUnorm<Float2>
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -85,4 +85,16 @@ public struct Rg16 : IEquatable<Rg16>, IUnorm<Vector2>, IUnorm<Float2>
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rg16)}({this.R}, {this.G})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(Rg16)}({this.R}, {this.G})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rg16)}({this.R}, {this.G})", out charsWritten);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace ComputeSharp;
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rg32 : IEquatable<Rg32>, IUnorm<Vector2>, IUnorm<Float2>
|
||||
public struct Rg32 : IEquatable<Rg32>, ISpanFormattable, IUnorm<Vector2>, IUnorm<Float2>
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -85,4 +85,16 @@ public struct Rg32 : IEquatable<Rg32>, IUnorm<Vector2>, IUnorm<Float2>
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rg32)}({this.R}, {this.G})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(Rg32)}({this.R}, {this.G})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rg32)}({this.R}, {this.G})", out charsWritten);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
/// <remarks>This struct is fully mutable.</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rgba32 : IEquatable<Rgba32>, IUnorm<Vector4>, IUnorm<Float4>
|
||||
public struct Rgba32 : IEquatable<Rgba32>, ISpanFormattable, IUnorm<Vector4>, IUnorm<Float4>
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -117,4 +117,16 @@ public struct Rgba32 : IEquatable<Rgba32>, IUnorm<Vector4>, IUnorm<Float4>
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})", out charsWritten);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
/// <remarks>This struct is fully mutable.</remarks>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rgba64 : IEquatable<Rgba64>, IUnorm<Vector4>, IUnorm<Float4>
|
||||
public struct Rgba64 : IEquatable<Rgba64>, ISpanFormattable, IUnorm<Vector4>, IUnorm<Float4>
|
||||
{
|
||||
/// <summary>
|
||||
/// The red component.
|
||||
@@ -117,4 +117,16 @@ public struct Rgba64 : IEquatable<Rgba64>, IUnorm<Vector4>, IUnorm<Float4>
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return string.Create(formatProvider, $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})");
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
|
||||
{
|
||||
return destination.TryWrite(provider, $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})", out charsWritten);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする