|
TIM image format library
|
The TIM image library (libtim.so) lets you deal with TIM images.
It aids you in accessing their contents and creating them
- void tim_init (void);
Initialize the library. Required.
- tim_t *tim_new (tim_mode_t mode, u_short width, u_short height, u_short ncluts);
Create a new TIM image with the given attributes. The image is linear mapped
after the returned pointer, so if you write tim_sizeof(tim) bytes you have
saved the TIM image.
- void tim_free (tim_t *tim);
Frees the TIM image.
- tim_chunk_t *tim_clut_addr (tim_t *tim);
Get the address of the CLUT in the TIM image
- tim_chunk_t *tim_pixel_addr (tim_t *tim);
Get the address of the first pixel in the TIM image
- int tim_sizeof (tim_t *tim);
Get the size in bytes of an TIM image
- int tim_width (tim_t *tim,int ofclut);
Get the width in pixels of a TIM image
- int tim_height (tim_t *tim,int ofclut);
Get the height in pixels of a TIM image
- tim_pixel_t *tim_pixel (tim_t *tim, int x, int y);
Get the address (16-bit pointer) for an X,Y pixel in an TIM image
- tim_pixel_t *tim_clut (tim_t *tim, int x, int y);
Get the address (16-bit pointer) for an X,Y CLUT entry in an TIM image
- char *tim_get_alpha (tim_t *tim);
This extracts the transparency plane, which is width x height bytes long.
You should free this pointer with a call to free().
- char *tim_get_rgb (tim_t *tim, int shift);
This will convert a TIM image into a RGB image. You should free this
pointer with a call to free() if it is no more needed.
| |