ImageConverter.cs 586 B

123456789101112131415161718192021222324
  1. namespace Ryujinx.Graphics.Texture
  2. {
  3. static class ImageConverter
  4. {
  5. public static byte[] G8R8ToR8G8(
  6. byte[] Data,
  7. int Width,
  8. int Height,
  9. int Depth)
  10. {
  11. int Texels = Width * Height * Depth;
  12. byte[] Output = new byte[Texels * 2];
  13. for (int Texel = 0; Texel < Texels; Texel++)
  14. {
  15. Output[Texel * 2 + 0] = Data[Texel * 2 + 1];
  16. Output[Texel * 2 + 1] = Data[Texel * 2 + 0];
  17. }
  18. return Output;
  19. }
  20. }
  21. }