1
0
mirror of https://github.com/RPCS3/ps3autotests.git synced 2024-11-08 20:02:46 +01:00

Merge pull request #1 from unknownbrackets/texformats

Add COMPRESSED_B8R8_G8R8 / COMPRESSED_R8B8_R8G8
This commit is contained in:
Alexandro Sánchez Bach 2014-05-18 22:23:45 +02:00
commit f142ecdb51

View File

@ -81,6 +81,32 @@ for y in range(img.size[0])[::-1]:
w.close() w.close()
#COMPRESSED_B8R8_G8R8
w = open("Texture-COMPRESSED_B8R8_G8R8.raw", "wb")
for y in range(img.size[0])[::-1]:
for x in range(0, img.size[1], 2):
b = (pix[x + 0, y][2] + pix[x + 1, y][2]) / 2
g = (pix[x + 0, y][1] + pix[x + 1, y][1]) / 2
w.write(chr(b))
w.write(chr(pix[x + 1, y][0]))
w.write(chr(g))
w.write(chr(pix[x + 0, y][0]))
w.close()
#COMPRESSED_R8B8_R8G8
w = open("Texture-COMPRESSED_B8R8_G8R8.raw", "wb")
for y in range(img.size[0])[::-1]:
for x in range(0, img.size[1], 2):
b = (pix[x + 0, y][2] + pix[x + 1, y][2]) / 2
g = (pix[x + 0, y][1] + pix[x + 1, y][1]) / 2
w.write(chr(pix[x + 1, y][0]))
w.write(chr(b))
w.write(chr(pix[x + 0, y][0]))
w.write(chr(g))
w.close()
#B8 #B8
w = open("Texture-B8.raw", "wb") w = open("Texture-B8.raw", "wb")
for y in range(img.size[0])[::-1]: for y in range(img.size[0])[::-1]: