Signed RGB color support with new source generation for standard RGB formats

This commit is contained in:
Jeremy Pritts committed 2022-11-04 21:06:28 -04:00
1 parent a5cfc5cbf7
commit 35ed50dc26
39 files changed
+2015 -118

No files matched your search

@@ -15,17 +15,26 @@ namespace AssetRipper.TextureDecoder.TestGenerator
new GenerationData(typeof(ColorA8), typeof(byte), 1),
new GenerationData(typeof(ColorARGB16), typeof(byte), 2),
new GenerationData(typeof(ColorARGB32), typeof(byte), 4),
new GenerationData(typeof(ColorBGRA32), typeof(byte), 4),
new GenerationData(typeof(ColorR16), typeof(ushort), 2),
new GenerationData(typeof(ColorR16Signed), typeof(short), 2),
new GenerationData(typeof(ColorR8), typeof(byte), 1),
new GenerationData(typeof(ColorR8Signed), typeof(sbyte), 1),
new GenerationData(typeof(ColorRG16), typeof(byte), 2),
new GenerationData(typeof(ColorRG16Signed), typeof(sbyte), 2),
new GenerationData(typeof(ColorRG32), typeof(ushort), 4),
new GenerationData(typeof(ColorRG32Signed), typeof(short), 4),
new GenerationData(typeof(ColorRGB16), typeof(byte), 2),
new GenerationData(typeof(ColorRGB24), typeof(byte), 3),
new GenerationData(typeof(ColorRGB24Signed), typeof(sbyte), 3),
new GenerationData(typeof(ColorRGB48), typeof(ushort), 6),
new GenerationData(typeof(ColorRGB48Signed), typeof(short), 6),
new GenerationData(typeof(ColorRGB9e5), typeof(double), 4),
new GenerationData(typeof(ColorRGBA16), typeof(byte), 2),
new GenerationData(typeof(ColorRGBA32), typeof(byte), 4),
new GenerationData(typeof(ColorRGBA32Signed), typeof(sbyte), 4),
new GenerationData(typeof(ColorRGBA64), typeof(ushort), 8),
new GenerationData(typeof(ColorRGBA64Signed), typeof(short), 8),
new GenerationData(typeof(ColorRGBAHalf), typeof(Half), 8),
new GenerationData(typeof(ColorRGBASingle), typeof(float), 16),
new GenerationData(typeof(ColorRGBHalf), typeof(Half), 6),
@@ -38,14 +47,16 @@ namespace AssetRipper.TextureDecoder.TestGenerator
private static readonly Dictionary<Type, ColorRandomValues> randomValueDictionary = new()
{
{ typeof(sbyte), new ColorRandomValues("-0b01010101", "0b01110010", "-0b00001111", "-0b01000111", "0b01001110") },
{ typeof(byte), new ColorRandomValues("0b11010101", "0b01110010", "0b10001111", "0b11000111", "0b01001110") },
{ typeof(short), new ColorRandomValues("-24000", "21354", "-80", "347", "31871") },
{ typeof(ushort), new ColorRandomValues("44000", "21354", "60080", "347", "33871") },
{ typeof(Half), new ColorRandomValues("(Half)0.447f", "(Half)0.224f", "(Half)0.95f", "(Half)0.897f", "(Half)0.333f") },
{ typeof(float), new ColorRandomValues("0.447f", "0.224f", "0.95f", "0.897f", "0.333f") },
{ typeof(double), new ColorRandomValues("0.447", "0.224", "0.95", "0.897", "0.333") },
};
static void Main(string[] args)
static void Main()
{
Directory.CreateDirectory(OutputFolder);