simage  1.8.3
Coin3D texture image library
Loading...
Searching...
No Matches
simage_tga.c File Reference
#include <config.h>
#include <simage_tga.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>

Macros

#define ERR_MEM   3
 
#define ERR_NO_ERROR   0
 
#define ERR_OPEN   1
 
#define ERR_READ   2
 
#define ERR_UNSUPPORTED   4
 

Functions

static void convert_16_to_24 (const unsigned char *const src, unsigned char *const dest)
 
static void convert_16_to_32 (const unsigned char *const src, unsigned char *const dest)
 
static void convert_24_to_24 (const unsigned char *const src, unsigned char *const dest)
 
static void convert_32_to_32 (const unsigned char *const src, unsigned char *const dest)
 
static void convert_data (const unsigned char *const src, unsigned char *const dest, const int x, const int srcformat, const int destformat)
 
static int getInt16 (unsigned char *ptr)
 
static unsigned char * rle_decode (unsigned char *src, unsigned char *dest, const int numbytes, int *rleRemaining, int *rleIsCompressed, unsigned char *rleCurrent, const int rleEntrySize)
 
static unsigned char * rle_new_packet (unsigned char *src, int *rleRemaining, int *rleIsCompressed, unsigned char *rleCurrent, const int rleEntrySize)
 
int simage_tga_error (char *buffer, int buflen)
 
int simage_tga_identify (const char *filename, const unsigned char *buf, int headerlen)
 
unsigned char * simage_tga_load (const char *filename, int *width_ret, int *height_ret, int *numComponents_ret)
 

Variables

static int tgaerror = 0
 

Macro Definition Documentation

◆ ERR_MEM

#define ERR_MEM   3

◆ ERR_NO_ERROR

#define ERR_NO_ERROR   0

◆ ERR_OPEN

#define ERR_OPEN   1

◆ ERR_READ

#define ERR_READ   2

◆ ERR_UNSUPPORTED

#define ERR_UNSUPPORTED   4

Function Documentation

◆ convert_16_to_24()

static void convert_16_to_24 ( const unsigned char *const src,
unsigned char *const dest )
static

◆ convert_16_to_32()

static void convert_16_to_32 ( const unsigned char *const src,
unsigned char *const dest )
static

◆ convert_24_to_24()

static void convert_24_to_24 ( const unsigned char *const src,
unsigned char *const dest )
static

◆ convert_32_to_32()

static void convert_32_to_32 ( const unsigned char *const src,
unsigned char *const dest )
static

◆ convert_data()

static void convert_data ( const unsigned char *const src,
unsigned char *const dest,
const int x,
const int srcformat,
const int destformat )
static

◆ getInt16()

static int getInt16 ( unsigned char * ptr)
static

◆ rle_decode()

static unsigned char * rle_decode ( unsigned char * src,
unsigned char * dest,
const int numbytes,
int * rleRemaining,
int * rleIsCompressed,
unsigned char * rleCurrent,
const int rleEntrySize )
static

◆ rle_new_packet()

static unsigned char * rle_new_packet ( unsigned char * src,
int * rleRemaining,
int * rleIsCompressed,
unsigned char * rleCurrent,
const int rleEntrySize )
static

◆ simage_tga_error()

int simage_tga_error ( char * buffer,
int buflen )

◆ simage_tga_identify()

int simage_tga_identify ( const char * filename,
const unsigned char * buf,
int headerlen )

◆ simage_tga_load()

unsigned char * simage_tga_load ( const char * filename,
int * width_ret,
int * height_ret,
int * numComponents_ret )

Variable Documentation

◆ tgaerror

int tgaerror = 0
static