PSX/TIM format

From Final Fantasy Inside
< PSX
Revision as of 20:47, 3 March 2005 by my_wiki>Qhimm (File layout)

Contents

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.


 


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>