mirror of
https://github.com/claunia/libexeinfo.git
synced 2025-12-16 19:14:24 +00:00
Added decoder for Atari Falcon 16-bit pixel format.
This commit is contained in:
@@ -131,6 +131,8 @@ namespace libexeinfo
|
|||||||
int[] pixels = PlaneToRasterIndexed(data, width, height, planes);
|
int[] pixels = PlaneToRasterIndexed(data, width, height, planes);
|
||||||
int[] palette = null;
|
int[] palette = null;
|
||||||
|
|
||||||
|
if(planes <= 8)
|
||||||
|
{
|
||||||
switch(planes)
|
switch(planes)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@@ -153,6 +155,23 @@ namespace libexeinfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < pixels.Length; i++) pixels[i] = palette[pixels[i]];
|
for(int i = 0; i < pixels.Length; i++) pixels[i] = palette[pixels[i]];
|
||||||
|
}
|
||||||
|
// This is the Falcon030 pixel format: RRRRRGGG GGGBBBBB
|
||||||
|
else if(planes == 16)
|
||||||
|
{
|
||||||
|
int[] pixels2 = new int[pixels.Length];
|
||||||
|
for(int i = 0; i < pixels.Length; i++)
|
||||||
|
{
|
||||||
|
// Red, from 5 to 8 bit
|
||||||
|
pixels2[i] = (((pixels[i] >> 11) * 0xFF) / 0x1F) << 16;
|
||||||
|
// Green, from 6 to 8 bit
|
||||||
|
pixels2[i] = ((((pixels[i] >> 5) & 0x3F) * 0xFF) / 0x3F) << 8;
|
||||||
|
// Blue, from 5 to 8 bit
|
||||||
|
pixels2[i] += ((pixels[i] & 0x1F) * 0xFF) / 0x1F;
|
||||||
|
}
|
||||||
|
|
||||||
|
pixels = pixels2;
|
||||||
|
}
|
||||||
|
|
||||||
return pixels;
|
return pixels;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user