Tachyon (current)  Current Main Branch
Data Structures | Macros | Functions
tgafile.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "util.h"
#include "ui.h"
#include "imageio.h"
#include "tgafile.h"

Go to the source code of this file.

Data Structures

struct  tgahandle
 

Macros

#define TACHYON_INTERNAL   1
 

Functions

int createtgafile (char *name, unsigned short width, unsigned short height)
 
void * opentgafile (char *filename)
 
void writetgaregion (void *voidhandle, int startx, int starty, int stopx, int stopy, unsigned char *buffer)
 
void closetgafile (void *voidhandle)
 
int readtga (char *name, int *xres, int *yres, unsigned char **imgdata)
 
int writetga (char *name, int xres, int yres, unsigned char *imgdata)
 

Macro Definition Documentation

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 16 of file tgafile.c.

Function Documentation

◆ closetgafile()

void closetgafile ( void *  voidhandle)

Definition at line 175 of file tgafile.c.

References tgahandle::ofp.

Referenced by writetga().

◆ createtgafile()

int createtgafile ( char *  name,
unsigned short  width,
unsigned short  height 
)

Definition at line 29 of file tgafile.c.

References IMAGENOERR, IMAGEWRITEERR, MSG_ABORT, MSG_ERR, and rt_ui_message().

Referenced by writetga().

◆ opentgafile()

void* opentgafile ( char *  filename)

Definition at line 75 of file tgafile.c.

References tgahandle::height, MSG_ABORT, MSG_ERR, tgahandle::ofp, rt_ui_message(), and tgahandle::width.

Referenced by writetga().

◆ readtga()

int readtga ( char *  name,
int *  xres,
int *  yres,
unsigned char **  imgdata 
)

Definition at line 182 of file tgafile.c.

References IMAGEBADFILE, IMAGENOERR, IMAGEREADERR, and IMAGEUNSUP.

Referenced by readimage().

◆ writetga()

int writetga ( char *  name,
int  xres,
int  yres,
unsigned char *  imgdata 
)

Definition at line 260 of file tgafile.c.

References closetgafile(), createtgafile(), IMAGENOERR, IMAGEWRITEERR, opentgafile(), and writetgaregion().

Referenced by writeimage().

◆ writetgaregion()

void writetgaregion ( void *  voidhandle,
int  startx,
int  starty,
int  stopx,
int  stopy,
unsigned char *  buffer 
)

Definition at line 97 of file tgafile.c.

References tgahandle::height, MSG_ERR, tgahandle::ofp, rt_ui_message(), and tgahandle::width.

Referenced by writetga().