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

Data Structures

struct  simage_rgb_opendata
 

Macros

#define ERR_MEM   3
 
#define ERR_NO_ERROR   0
 
#define ERR_OPEN   1
 
#define ERR_OPEN_WRITE   5
 
#define ERR_READ   2
 
#define ERR_SIZEZ   4
 

Functions

static int read_int (FILE *in, int *dst, int n, int swap)
 
static int read_rgb_row_component (simage_rgb_opendata *od, int y, int c)
 
static int read_short (FILE *in, short *dst, int n, int swap)
 
static int read_uint (FILE *in, unsigned int *dst, int n, int swap)
 
static int read_ushort (FILE *in, unsigned short *dst, int n, int swap)
 
void simage_rgb_close (void *opendata)
 
int simage_rgb_error (char *buffer, int buflen)
 
int simage_rgb_identify (const char *filename, const unsigned char *header, int headerlen)
 
unsigned char * simage_rgb_load (const char *filename, int *width, int *height, int *numcomponents)
 
void * simage_rgb_open (const char *filename, int *width, int *height, int *numcomponents)
 
int simage_rgb_read_line (void *opendata, int y, unsigned char *buf)
 
int simage_rgb_save (const char *filename, const unsigned char *bytes, int width, int height, int comp)
 
static int write_short (FILE *fp, unsigned short val)
 

Variables

static int rgberror = 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_OPEN_WRITE

#define ERR_OPEN_WRITE   5

◆ ERR_READ

#define ERR_READ   2

◆ ERR_SIZEZ

#define ERR_SIZEZ   4

Function Documentation

◆ read_int()

static int read_int ( FILE * in,
int * dst,
int n,
int swap )
static

◆ read_rgb_row_component()

static int read_rgb_row_component ( simage_rgb_opendata * od,
int y,
int c )
static

◆ read_short()

static int read_short ( FILE * in,
short * dst,
int n,
int swap )
static

◆ read_uint()

static int read_uint ( FILE * in,
unsigned int * dst,
int n,
int swap )
static

◆ read_ushort()

static int read_ushort ( FILE * in,
unsigned short * dst,
int n,
int swap )
static

◆ simage_rgb_close()

void simage_rgb_close ( void * opendata)

◆ simage_rgb_error()

int simage_rgb_error ( char * buffer,
int buflen )

◆ simage_rgb_identify()

int simage_rgb_identify ( const char * filename,
const unsigned char * header,
int headerlen )

◆ simage_rgb_load()

unsigned char * simage_rgb_load ( const char * filename,
int * width,
int * height,
int * numcomponents )

◆ simage_rgb_open()

void * simage_rgb_open ( const char * filename,
int * width,
int * height,
int * numcomponents )

◆ simage_rgb_read_line()

int simage_rgb_read_line ( void * opendata,
int y,
unsigned char * buf )

◆ simage_rgb_save()

int simage_rgb_save ( const char * filename,
const unsigned char * bytes,
int width,
int height,
int comp )

◆ write_short()

static int write_short ( FILE * fp,
unsigned short val )
static

Variable Documentation

◆ rgberror

int rgberror = 0
static