|
|
@ -24,9 +24,8 @@ using System.Runtime.InteropServices; |
|
|
|
|
|
|
|
|
void GenerateDefaultSelfConversionMethods(string pixelType) |
|
|
void GenerateDefaultSelfConversionMethods(string pixelType) |
|
|
{ |
|
|
{ |
|
|
#> |
|
|
#> |
|
|
|
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
|
|
|
internal override void From<#=pixelType#>(Configuration configuration, ReadOnlySpan<<#=pixelType#>> source, Span<<#=pixelType#>> destPixels) |
|
|
internal override void From<#=pixelType#>(Configuration configuration, ReadOnlySpan<<#=pixelType#>> source, Span<<#=pixelType#>> destPixels) |
|
|
{ |
|
|
{ |
|
|
Guard.NotNull(configuration, nameof(configuration)); |
|
|
Guard.NotNull(configuration, nameof(configuration)); |
|
|
@ -44,12 +43,12 @@ using System.Runtime.InteropServices; |
|
|
sourcePixels.CopyTo(destPixels); |
|
|
sourcePixels.CopyTo(destPixels); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
<#+ |
|
|
<#+ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void GenerateDefaultConvertToMethod(string fromPixelType, string toPixelType) |
|
|
void GenerateDefaultConvertToMethod(string fromPixelType, string toPixelType) |
|
|
{ |
|
|
{ |
|
|
#> |
|
|
#> |
|
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
internal override void To<#=toPixelType#>(Configuration configuration, ReadOnlySpan<<#=fromPixelType#>> sourcePixels, Span<<#=toPixelType#>> destPixels) |
|
|
internal override void To<#=toPixelType#>(Configuration configuration, ReadOnlySpan<<#=fromPixelType#>> sourcePixels, Span<<#=toPixelType#>> destPixels) |
|
|
@ -68,12 +67,12 @@ using System.Runtime.InteropServices; |
|
|
dp.From<#=fromPixelType#>(sp); |
|
|
dp.From<#=fromPixelType#>(sp); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
<#+ |
|
|
<#+ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void GenerateOptimized32BitConversionMethods(string thisPixelType, string otherPixelType) |
|
|
void GenerateOptimized32BitConversionMethods(string thisPixelType, string otherPixelType) |
|
|
{ |
|
|
{ |
|
|
#> |
|
|
#> |
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
internal override void To<#=otherPixelType#>(Configuration configuration, ReadOnlySpan<<#=thisPixelType#>> sourcePixels, Span<<#=otherPixelType#>> destPixels) |
|
|
internal override void To<#=otherPixelType#>(Configuration configuration, ReadOnlySpan<<#=thisPixelType#>> sourcePixels, Span<<#=otherPixelType#>> destPixels) |
|
|
{ |
|
|
{ |
|
|
@ -105,13 +104,12 @@ using System.Runtime.InteropServices; |
|
|
Unsafe.Add(ref destRef, i) = PixelConverter.From<#=otherPixelType#>.To<#=thisPixelType#>(sp); |
|
|
Unsafe.Add(ref destRef, i) = PixelConverter.From<#=otherPixelType#>.To<#=thisPixelType#>(sp); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
<#+ |
|
|
<#+ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void GenerateRgba32CompatibleVector4ConversionMethods(string pixelType) |
|
|
void GenerateRgba32CompatibleVector4ConversionMethods(string pixelType) |
|
|
{ |
|
|
{ |
|
|
#> |
|
|
#> |
|
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
internal override void FromVector4(Configuration configuration, ReadOnlySpan<Vector4> sourceVectors, Span<<#=pixelType#>> destPixels) |
|
|
internal override void FromVector4(Configuration configuration, ReadOnlySpan<Vector4> sourceVectors, Span<<#=pixelType#>> destPixels) |
|
|
{ |
|
|
{ |
|
|
@ -136,7 +134,7 @@ using System.Runtime.InteropServices; |
|
|
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, true); |
|
|
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
<#+ |
|
|
<#+ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void GenerateAllDefaultConversionMethods(string pixelType) |
|
|
void GenerateAllDefaultConversionMethods(string pixelType) |
|
|
|