mirror of
https://github.com/AssetRipper/AssetRipper.TextureDecoder.git
synced 2026-11-13 12:41:27 -10:00
18 lines
751 B
C#
18 lines
751 B
C#
using AssetRipper.TextureDecoder.Rgb;
|
|
|
|
namespace AssetRipper.TextureDecoder.Tests.Formats;
|
|
internal static class LosslessConversion
|
|
{
|
|
internal static void Assert<TColor1, TChannelValue1, TColor2, TChannelValue2>()
|
|
where TChannelValue1 : unmanaged
|
|
where TChannelValue2 : unmanaged
|
|
where TColor1 : unmanaged, IColor<TChannelValue1>
|
|
where TColor2 : unmanaged, IColor<TChannelValue2>
|
|
{
|
|
TColor1 original = ColorRandom<TColor1, TChannelValue1>.MakeRandomColor();
|
|
TColor2 converted = original.Convert<TColor1, TChannelValue1, TColor2, TChannelValue2>();
|
|
TColor1 convertedBack = converted.Convert<TColor2, TChannelValue2, TColor1, TChannelValue1>();
|
|
NUnit.Framework.Assert.That(convertedBack, Is.EqualTo(original));
|
|
}
|
|
}
|