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

Data Structures

struct  simage_tiff_opendata
 

Macros

#define CVT(x)   (((x) * 255L) / ((1L<<16)-1))
 
#define ERR_MEM   3
 
#define ERR_NO_ERROR   0
 
#define ERR_OPEN   1
 
#define ERR_OPEN_WRITE   6
 
#define ERR_READ   2
 
#define ERR_TIFFLIB   5
 
#define ERR_UNSUPPORTED   4
 
#define ERR_WRITE   7
 
#define pack(a, b)   ((a)<<8 | (b))
 

Functions

static int checkcmap (int n, uint16 *r, uint16 *g, uint16 *b)
 
static void copy_row (unsigned char *ptr, unsigned char *data, int n, int numcomponents)
 
static void interleave_row (unsigned char *ptr, unsigned char *red, unsigned char *blue, unsigned char *green, unsigned char *alpha, int n)
 
static void invert_row (unsigned char *ptr, unsigned char *data, int n, int invert)
 
static void remap_row (unsigned char *ptr, unsigned char *data, int n, unsigned short *rmap, unsigned short *gmap, unsigned short *bmap, unsigned char *amap)
 
void simage_tiff_close (void *opendata)
 
int simage_tiff_error (char *buffer, int buflen)
 
int simage_tiff_identify (const char *ptr, const unsigned char *header, int headerlen)
 
unsigned char * simage_tiff_load (const char *filename, int *width_ret, int *height_ret, int *numComponents_ret)
 
void * simage_tiff_open (const char *filename, int *width, int *height, int *numcomponents)
 
int simage_tiff_read_line (void *opendata, int y, unsigned char *buf)
 
int simage_tiff_save (const char *filename, const unsigned char *bytes, int width, int height, int numcomponents)
 
static void tiff_error (const char *module, const char *fmt, va_list list)
 
static int tiff_try_read_rgba (TIFF *in, int w, int h, int format, unsigned char *buffer)
 
static void tiff_warn (const char *module, const char *fmt, va_list list)
 

Variables

static int tifferror = 0
 

Macro Definition Documentation

◆ CVT

#define CVT ( x)    (((x) * 255L) / ((1L<<16)-1))

◆ 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   6

◆ ERR_READ

#define ERR_READ   2

◆ ERR_TIFFLIB

#define ERR_TIFFLIB   5

◆ ERR_UNSUPPORTED

#define ERR_UNSUPPORTED   4

◆ ERR_WRITE

#define ERR_WRITE   7

◆ pack

#define pack ( a,
b )   ((a)<<8 | (b))

Function Documentation

◆ checkcmap()

static int checkcmap ( int n,
uint16 * r,
uint16 * g,
uint16 * b )
static

◆ copy_row()

static void copy_row ( unsigned char * ptr,
unsigned char * data,
int n,
int numcomponents )
static

◆ interleave_row()

static void interleave_row ( unsigned char * ptr,
unsigned char * red,
unsigned char * blue,
unsigned char * green,
unsigned char * alpha,
int n )
static

◆ invert_row()

static void invert_row ( unsigned char * ptr,
unsigned char * data,
int n,
int invert )
static

◆ remap_row()

static void remap_row ( unsigned char * ptr,
unsigned char * data,
int n,
unsigned short * rmap,
unsigned short * gmap,
unsigned short * bmap,
unsigned char * amap )
static

◆ simage_tiff_close()

void simage_tiff_close ( void * opendata)

◆ simage_tiff_error()

int simage_tiff_error ( char * buffer,
int buflen )

◆ simage_tiff_identify()

int simage_tiff_identify ( const char * ptr,
const unsigned char * header,
int headerlen )

◆ simage_tiff_load()

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

◆ simage_tiff_open()

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

◆ simage_tiff_read_line()

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

◆ simage_tiff_save()

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

◆ tiff_error()

static void tiff_error ( const char * module,
const char * fmt,
va_list list )
static

◆ tiff_try_read_rgba()

static int tiff_try_read_rgba ( TIFF * in,
int w,
int h,
int format,
unsigned char * buffer )
static

◆ tiff_warn()

static void tiff_warn ( const char * module,
const char * fmt,
va_list list )
static

Variable Documentation

◆ tifferror

int tifferror = 0
static