Classes | Defines | Functions | Variables

pngdib.c File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <math.h>
#include "png.h"
#include "pngdib.h"

Classes

struct  errstruct

Defines

#define PNGDIB_SRC_VERSION   20200
#define PNGDIB_SRC_VERSION_STRING   "2.2.0"
#define MAX_ERRMSGLEN   100
#define PNG_GAMMA_THRESHOLD   0.05

Functions

static void pngd_get_error_message (int rv, char *e)
static unsigned char * uncompress_dib (LPBITMAPINFO lpbmi1, int infosize, void *lpbits1)
static void my_error_fn (png_structp png_ptr, const char *err_msg)
static void my_warning_fn (png_structp png_ptr, const char *warn_msg)
static void gamma_correct (double screen_gamma, double file_gamma, unsigned char *red, unsigned char *green, unsigned char *blue)
int read_png_to_dib (PNGD_P2DINFO *p2dp)
int write_dib_to_png (PNGD_D2PINFO *d2pp)
char * pngdib_get_version_string (void)
int pngdib_get_version (void)

Variables

static const double screen_gamma = 2.2

Define Documentation

#define MAX_ERRMSGLEN   100

Referenced by my_error_fn().

#define PNG_GAMMA_THRESHOLD   0.05

Referenced by gamma_correct().

#define PNGDIB_SRC_VERSION   20200
#define PNGDIB_SRC_VERSION_STRING   "2.2.0"

Function Documentation

static void gamma_correct ( double  screen_gamma,
double  file_gamma,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue 
) [static]

References PNG_GAMMA_THRESHOLD.

Referenced by read_png_to_dib().

static void my_error_fn ( png_structp  png_ptr,
const char *  err_msg 
) [static]
static void my_warning_fn ( png_structp  png_ptr,
const char *  warn_msg 
) [static]
static void pngd_get_error_message ( int  rv,
char *  e 
) [static]
int pngdib_get_version ( void   ) 
char* pngdib_get_version_string ( void   ) 
int read_png_to_dib ( PNGD_P2DINFO p2dp  ) 
static unsigned char* uncompress_dib ( LPBITMAPINFO  lpbmi1,
int  infosize,
void *  lpbits1 
) [static]

Referenced by write_dib_to_png().

int write_dib_to_png ( PNGD_D2PINFO d2pp  ) 

Variable Documentation

const double screen_gamma = 2.2 [static]

Referenced by read_png_to_dib().