Difference between revisions of "PSX/TIM format"

From Final Fantasy Inside
< PSX
Jump to navigation Jump to search
my_wiki>Qhimm
m
my_wiki>Qhimm
(File layout)
Line 3: Line 3:
  
 
== File layout ==
 
== File layout ==
[[Image:PSX_TIM_file_layout.png]]
+
A TIM file is made up of three conceptual blocks; the header, the color lookup table (CLUT) and the image data. The CLUT block and the image data block have the same basic layout and are also treated the same way when loading a TIM file into the PlayStation frame buffer.
 +
<br/><center>[[Image:PSX_TIM_file_layout.png]]</center><br/>
  
 
== Header ==
 
== Header ==

Revision as of 20:47, 3 March 2005

Introduction

A TIM file is a standard image file format for the Sony PlayStation. The file structure closely mimics the way textures are managed in the frame buffer by the GPU. TIM files are little endian-based.

File layout

A TIM file is made up of three conceptual blocks; the header, the color lookup table (CLUT) and the image data. The CLUT block and the image data block have the same basic layout and are also treated the same way when loading a TIM file into the PlayStation frame buffer.


PSX TIM file layout.png


Header

CLUT (color lookup table)

Image data

<cpp> // C++ code:

  1. include <stdio.h>
  2. include "tim.h"

class TIMFile { public:

   TIMFile() { return; }
   ~TIMFile() { return; }

/* Multi line comment */

protected:

   int m_data;

}; </cpp>