diff options
author | José Fonseca <[email protected]> | 2008-08-07 08:50:50 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-08-07 18:58:30 +0100 |
commit | c76d86f0abfa09a241370af024c806b8a0005850 (patch) | |
tree | 0f1f210b10d7cc09047bf01f314380e888141277 /bin | |
parent | f6e0514736bb763813a49ae5542b2c8648641595 (diff) |
raw2png: Fix channel order in a8b8g8r8/x8b8g8r8 formats.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/raw2png.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/raw2png.py b/bin/raw2png.py index 18d40bda0e7..f01e7990a13 100755 --- a/bin/raw2png.py +++ b/bin/raw2png.py @@ -262,12 +262,20 @@ def translate_r5g6b5(data): a = 255 return [[(r, g, b, a)]] +def translate_a8r8g8b8(data): + b, g, r, a = struct.unpack_from("BBBB", data) + return [[(r, g, b, a)]] + + +def translate_x8r8g8b8(data): + b, g, r, x = struct.unpack_from("BBBB", data) + a = 255 + return [[(r, g, b, a)]] def translate_r8g8b8a8(data): r, g, b, a = struct.unpack_from("BBBB", data) return [[(r, g, b, a)]] - def translate_ycbcr(data): y1, u, y2, v = struct.unpack_from("BBBB", data) r1, g1, b1 = yuv2rgb(y1, u, v) @@ -296,8 +304,8 @@ def translate_s8z24(data): translate = { - PIPE_FORMAT_A8R8G8B8_UNORM: (4, 1, 1, translate_r8g8b8a8), - PIPE_FORMAT_X8R8G8B8_UNORM: (4, 1, 1, translate_r8g8b8a8), + PIPE_FORMAT_A8R8G8B8_UNORM: (4, 1, 1, translate_a8r8g8b8), + PIPE_FORMAT_X8R8G8B8_UNORM: (4, 1, 1, translate_x8r8g8b8), PIPE_FORMAT_B8G8R8A8_UNORM: (4, 1, 1, translate_r8g8b8a8), PIPE_FORMAT_B8G8R8X8_UNORM: (4, 1, 1, translate_r8g8b8a8), PIPE_FORMAT_A8B8G8R8_SNORM: (4, 1, 1, translate_r8g8b8a8), |