RGBX-RGBA7

This commit is contained in:
ManicSteiner
2025-01-18 22:45:40 +08:00
parent a935f1cee9
commit cb865b5977
2 changed files with 12 additions and 12 deletions

View File

@@ -71,8 +71,8 @@ namespace GameRes
BgrX = 6,
RgbA = 9,
BgrA = 10,
RgbX_Disposed = 55,
BgrX_Disposed = 66,
RgbA7 = 55,
BgrA7 = 66,
}
public class ImageData
@@ -215,15 +215,15 @@ namespace GameRes
int src = 0;
var color_map = new Color[colors];
Func<int, Color> get_color;
if (PaletteFormat.Bgr == format || PaletteFormat.BgrX_Disposed == format)
if (PaletteFormat.Bgr == format || PaletteFormat.BgrX == format)
get_color = x => Color.FromRgb (palette_data[x+2], palette_data[x+1], palette_data[x]);
else if (PaletteFormat.BgrX == format)
else if (PaletteFormat.BgrA7 == format)
get_color = x => Color.FromArgb(palette_data[x+3] >= byte.MaxValue / 2 ? byte.MaxValue : (byte)(palette_data[x+3] << 1), palette_data[x+2], palette_data[x+1], palette_data[x]);
else if (PaletteFormat.BgrA == format)
get_color = x => Color.FromArgb (palette_data[x+3], palette_data[x+2], palette_data[x+1], palette_data[x]);
else if (PaletteFormat.RgbA == format)
get_color = x => Color.FromArgb (palette_data[x+3], palette_data[x], palette_data[x+1], palette_data[x+2]);
else if (PaletteFormat.RgbX == format)
else if (PaletteFormat.RgbA7 == format)
get_color = x => Color.FromArgb (palette_data[x+3] >= byte.MaxValue / 2 ? byte.MaxValue : (byte)(palette_data[x+3] << 1), palette_data[x], palette_data[x+1], palette_data[x+2]);
else
get_color = x => Color.FromRgb (palette_data[x], palette_data[x+1], palette_data[x+2]);