Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
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_NO_ERROR   0
 
#define ERR_OPEN   1
 
#define ERR_READ   2
 
#define ERR_MEM   3
 
#define ERR_UNSUPPORTED   4
 

Functions

int simage_tga_error (char *buffer, int buflen)
 
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_new_packet (unsigned char *src, int *rleRemaining, int *rleIsCompressed, unsigned char *rleCurrent, const int rleEntrySize)
 
static unsigned char * rle_decode (unsigned char *src, unsigned char *dest, const int numbytes, int *rleRemaining, int *rleIsCompressed, unsigned char *rleCurrent, const int rleEntrySize)
 
unsigned char * simage_tga_load (const char *filename, int *width_ret, int *height_ret, int *numComponents_ret)
 
int simage_tga_identify (const char *filename, const unsigned char *buf, int headerlen)
 

Variables

static int tgaerror = 0
 

Macro Definition Documentation

◆ ERR_NO_ERROR

#define ERR_NO_ERROR   0

◆ ERR_OPEN

#define ERR_OPEN   1

◆ ERR_READ

#define ERR_READ   2

◆ ERR_MEM

#define ERR_MEM   3

◆ ERR_UNSUPPORTED

#define ERR_UNSUPPORTED   4

Function Documentation

◆ simage_tga_error()

int simage_tga_error ( char *  buffer,
int  buflen 
)

◆ 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_new_packet()

static unsigned char* rle_new_packet ( unsigned char *  src,
int *  rleRemaining,
int *  rleIsCompressed,
unsigned char *  rleCurrent,
const int  rleEntrySize 
)
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

◆ simage_tga_load()

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

◆ simage_tga_identify()

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

Variable Documentation

◆ tgaerror

int tgaerror = 0
static