Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d080dd

Browse files
committed
Support decoding textures with signed integer pixels
* Resolves AssetRipper#1858
1 parent 3bab19b commit 8d080dd

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Source/AssetRipper.Export.Modules.Textures/TextureConverter.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,38 @@ private static bool TryDecodeTexture<TColor, TChannelValue>(TextureFormat textur
546546
RgbConverter.Convert<ColorRGB9e5, double, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
547547
return true;
548548

549+
case TextureFormat.R8_SIGNED:
550+
RgbConverter.Convert<ColorR<sbyte>, sbyte, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
551+
return true;
552+
553+
case TextureFormat.RG16_SIGNED:
554+
RgbConverter.Convert<ColorRG<sbyte>, sbyte, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
555+
return true;
556+
557+
case TextureFormat.RGB24_SIGNED:
558+
RgbConverter.Convert<ColorRGB<sbyte>, sbyte, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
559+
return true;
560+
561+
case TextureFormat.RGBA32_SIGNED:
562+
RgbConverter.Convert<ColorRGBA<sbyte>, sbyte, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
563+
return true;
564+
565+
case TextureFormat.R16_SIGNED:
566+
RgbConverter.Convert<ColorR<short>, short, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
567+
return true;
568+
569+
case TextureFormat.RG32_SIGNED:
570+
RgbConverter.Convert<ColorRG<short>, short, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
571+
return true;
572+
573+
case TextureFormat.RGB48_SIGNED:
574+
RgbConverter.Convert<ColorRGB<short>, short, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
575+
return true;
576+
577+
case TextureFormat.RGBA64_SIGNED:
578+
RgbConverter.Convert<ColorRGBA<short>, short, TColor, TChannelValue>(inputSpan, width, height, outputSpan);
579+
return true;
580+
549581
default:
550582
Logger.Log(LogType.Error, LogCategory.Export, $"Unsupported texture format '{textureFormat}'");
551583
return false;

0 commit comments

Comments
 (0)