GRAF:Aglaia Online: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Paul Siramy
(Format specification for TXB)
imported>Ikskoks
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 10: Line 10:


<tt><b>
<tt><b>
char {4}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">(TXB )</font> <br>
uint16 {2}&nbsp;&nbsp; - Image Width <br>
uint16 {2}&nbsp;&nbsp; - Image Height <br>
uint32 {4}&nbsp;&nbsp; - Palette Type <font color="purple">(1/3)</font> <br>
byte {20}&nbsp;&nbsp;&nbsp; - null <br>
<br>
<br>
<font color="blue"> ''' // Main header ''' </font> <br>  
<font color="blue"> ''' if (paletteType == 1){ ''' </font> <br>  
byte {4}&nbsp; - Signature <font color="purple"> '' "TXB " '' </font> <br>
: <font color="blue"> ''' // for each color (256) ''' </font> <br>  
uint16 &nbsp;&nbsp; - Width <br>  
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Alpha <br>  
uint16 &nbsp;&nbsp; - Height <br>  
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Red <br>  
uint32 &nbsp;&nbsp; - Palette Type <font color="purple"> '' 1 or 3 '' </font><br>
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Green <br>
byte {20} - null <br>  
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Blue <br>
: <font color="blue"> ''' } ''' </font> <br>  
<br>
<br>
<font color="blue"> ''' // Optional palette ''' </font> <br>
byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - Compressed Pixel Data (ZLib) <br>  
<font color="blue"> ''' if (Palette Type == 1){ ''' </font> <br>
: <font color="purple"> '' // this TXB is a 8bpp image, here is the palette '' </font> <br>
: byte {256}{4}&nbsp; - Palette data <font color="purple"> '' 256 ARGB colors, total of 1024 bytes '' </font> <br>
<font color="blue"> ''' } ''' </font> <br>  
<br>
<br>
<font color="blue"> ''' // Compressed image ''' </font> <br>  
<font color="green"> ''' // When the compressed pixel data is decompressed...{ ''' </font> <br>
byte {X} - Image Data<br>  
: <font color="blue"> ''' if (paletteType == 1){ ''' </font> <br>
:: <font color="blue"> ''' for (width*height){ ''' </font> <br>
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Palette Index <br>
::: <font color="blue"> ''' } ''' </font> <br>
:: <font color="blue"> ''' } ''' </font> <br>
<br>
: <font color="blue"> ''' else if (paletteType == 3){ ''' </font> <br>
:: <font color="blue"> ''' for (width*height){ ''' </font> <br>
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Blue <br>
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Green <br>
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Red <br>
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Alpha <br>
::: <font color="blue"> ''' } ''' </font> <br>
:: <font color="blue"> ''' } ''' </font> <br>  
<br>
: uint64 {8}&nbsp;&nbsp; - null <br>
: byte {16}&nbsp;&nbsp;&nbsp; - Signature <font color="purple">(TRUEVISION-XFILE)</font> <br>
: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - Tag <font color="purple">(0x2E)</font> <br>
: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - null <br>
: <font color="green"> ''' } ''' </font> <br>  
</b></tt>
</b></tt>
<br>


=== Notes and Comments ===  
=== Notes and Comments ===  
Line 55: Line 75:
=== Other Games ===
=== Other Games ===
None
None
[[Category:File Format]]

Latest revision as of 01:08, 3 January 2021

TXB

  • Format Type : Compressed image (8bpp or 32bpp)
  • Endian Order : Little Endian
  • Forum Threads : None
  • Date Posted : December 4th 2005 05:22 AM


Format Specifications

char {4}     - Header (TXB )
uint16 {2}   - Image Width
uint16 {2}   - Image Height
uint32 {4}   - Palette Type (1/3)
byte {20}    - null

if (paletteType == 1){

// for each color (256)
byte {1}     - Alpha
byte {1}     - Red
byte {1}     - Green
byte {1}     - Blue
}


byte {X}     - Compressed Pixel Data (ZLib)

// When the compressed pixel data is decompressed...{

if (paletteType == 1){
for (width*height){
byte {1}     - Palette Index
}
}


else if (paletteType == 3){
for (width*height){
byte {1}     - Blue
byte {1}     - Green
byte {1}     - Red
byte {1}     - Alpha
}
}


uint64 {8}   - null
byte {16}    - Signature (TRUEVISION-XFILE)
byte {1}     - Tag (0x2E)
byte {1}     - null
}

Notes and Comments

Image Data is a ZLIB compressed buffer (hint : it start with an 'x'). Give it to the uncompress() function of ZLIB and you obtain the uncompressed image. The format of this uncompressed image can be of 2 sort, depending of the Palette Type. Whatever the format, after the pixels it has a footer of 26 bytes. Note that the pixels are from bottom to top, and for each row are left to right. The Alpha Channel is used in certain TXB of the game, it's not here just for padding.

If Palette Type == 1 then the uncompressed image contain palette indexs. Its size is 26 + (Width * Height) bytes.


If Palette Type == 3 then the uncompressed image contain a true color image. Here, the image size is 26 + (4 * Width * height) bytes. Each pixel is in BGRA format.


The footer is 26 bytes, structured like that :

byte {8}  - null
byte {16} - signature "TRUEVISION-XFILE"
byte {1}  - Tag 0x2E
byte {1}  - null


MultiEx BMS Script

Not written yet


Supported by Programs

None


Other Games

None