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

Functions

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

Variables

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

#define ERR_SIZEZ   4

◆ ERR_OPEN_WRITE

#define ERR_OPEN_WRITE   5

Function Documentation

◆ simage_rgb_load()

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

◆ write_short()

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

◆ simage_rgb_save()

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

◆ simage_rgb_identify()

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

◆ simage_rgb_error()

int simage_rgb_error ( char *  buffer,
int  buflen 
)

◆ read_short()

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

◆ read_ushort()

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

◆ read_int()

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

◆ read_uint()

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

◆ simage_rgb_open()

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

◆ simage_rgb_close()

void simage_rgb_close ( void *  opendata)

◆ read_rgb_row_component()

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

◆ simage_rgb_read_line()

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

Variable Documentation

◆ rgberror

int rgberror = 0
static