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

Macros

#define ERR_MEM   2
 
#define ERR_MEM_WRITE   6
 
#define ERR_NO_ERROR   0
 
#define ERR_OPEN   1
 
#define ERR_OPEN_WRITE   4
 
#define ERR_PNGLIB   3
 
#define ERR_PNGLIB_WRITE   5
 

Functions

static void err_callback (png_structp ps, png_const_charp pc)
 
int simage_png_error (char *buffer, int buflen)
 
int simage_png_identify (const char *ptr, const unsigned char *header, int headerlen)
 
unsigned char * simage_png_load (const char *filename, int *width_ret, int *height_ret, int *numComponents_ret)
 
int simage_png_save (const char *filename, const unsigned char *bytes, int width, int height, int numcomponents)
 
static void user_flush_cb (png_structp png_ptr)
 
static void user_read_cb (png_structp png_ptr, png_bytep data, png_uint_32 length)
 
static void user_write_cb (png_structp png_ptr, png_bytep data, png_uint_32 length)
 
static void warn_callback (png_structp ps, png_const_charp pc)
 

Variables

static int pngerror = 0
 
static jmp_buf setjmp_buffer
 

Macro Definition Documentation

◆ ERR_MEM

#define ERR_MEM   2

◆ ERR_MEM_WRITE

#define ERR_MEM_WRITE   6

◆ ERR_NO_ERROR

#define ERR_NO_ERROR   0

◆ ERR_OPEN

#define ERR_OPEN   1

◆ ERR_OPEN_WRITE

#define ERR_OPEN_WRITE   4

◆ ERR_PNGLIB

#define ERR_PNGLIB   3

◆ ERR_PNGLIB_WRITE

#define ERR_PNGLIB_WRITE   5

Function Documentation

◆ err_callback()

static void err_callback ( png_structp ps,
png_const_charp pc )
static

◆ simage_png_error()

int simage_png_error ( char * buffer,
int buflen )

◆ simage_png_identify()

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

◆ simage_png_load()

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

◆ simage_png_save()

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

◆ user_flush_cb()

static void user_flush_cb ( png_structp png_ptr)
static

◆ user_read_cb()

static void user_read_cb ( png_structp png_ptr,
png_bytep data,
png_uint_32 length )
static

◆ user_write_cb()

static void user_write_cb ( png_structp png_ptr,
png_bytep data,
png_uint_32 length )
static

◆ warn_callback()

static void warn_callback ( png_structp ps,
png_const_charp pc )
static

Variable Documentation

◆ pngerror

int pngerror = 0
static

◆ setjmp_buffer

jmp_buf setjmp_buffer
static