[ Home ]

tga.c File Reference

Handle Targa file format. More...

#include <string.h>
#include <stdio.h>
#include "../common/platform.h"
#include "../memory/memory.h"
#include "../common/common_utils.h"

Include dependency graph for tga.c:


Functions

PRIVATE void rle_write (FILE *fp, W8 *buffer, W32 width, W32 bytes)
 Run length encode scanline.
PUBLIC W8 TGA_write (const char *filename, W16 bpp, W32 width, W32 height, void *Data, W8 upsideDown, W8 rle)
 Write targa image file.

Detailed Description

Handle Targa file format.

Author:
Michael Liebscher
Date:
2004-2005
Note:
Portion of this code was derived from The GIMP -- an image manipulation program, and was originally written by Spencer Kimball and Peter Mattis.

Function Documentation

PRIVATE void rle_write ( FILE *  fp,
W8 *  buffer,
W32  width,
W32  bytes 
)

Run length encode scanline.

Parameters:
[in] fp Pointer to valid FILE structure.
[in] buffer Scanline data.
[in] width Image scanline width.
[in] bytes Bytes per pixel.
Returns:
Nothing.

Here is the caller graph for this function:

PUBLIC W8 TGA_write ( const char *  filename,
W16  bpp,
W32  width,
W32  height,
void *  Data,
W8  upsideDown,
W8  rle 
)

Write targa image file.

Parameters:
[in] filename Name of TGA file to save as.
[in] depth Bytes per pixel. (16, 24 or 32).
[in] width Width of image in pixels.
[in] height Height of image in pixels.
[in] Data Raw image data.
[in] upsideDown Is the data upside down? 1 yes, 0 no.
[in] rle Run Length encode? 1 yes, 0 no.
Returns:
0 on error, otherwise 1.

Here is the call graph for this function:

Here is the caller graph for this function: