#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 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" |
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] |
References errstruct::errmsg, errstruct::jbufp, and MAX_ERRMSGLEN.
Referenced by read_png_to_dib(), and write_dib_to_png().
static void my_warning_fn | ( | png_structp | png_ptr, | |
const char * | warn_msg | |||
) | [static] |
Referenced by read_png_to_dib(), and write_dib_to_png().
static void pngd_get_error_message | ( | int | rv, | |
char * | e | |||
) | [static] |
References PNGD_E_BADBMP, PNGD_E_BADPNG, PNGD_E_ERROR, PNGD_E_LIBPNG, PNGD_E_NOMEM, PNGD_E_READ, PNGD_E_UNSUPP, PNGD_E_VERSION, and PNGD_E_WRITE.
Referenced by read_png_to_dib(), and write_dib_to_png().
int pngdib_get_version | ( | void | ) |
char* pngdib_get_version_string | ( | void | ) |
int read_png_to_dib | ( | PNGD_P2DINFO * | p2dp | ) |
References PNGD_P2DINFO_struct::bgcolor, PNGD_P2DINFO_struct::bits_offs, PNGD_P2DINFO_struct::bits_per_pixel, PNGD_P2DINFO_struct::bits_per_sample, PNGD_COLOR_struct::blue, PNGD_P2DINFO_struct::color_type, PNGD_P2DINFO_struct::dibsize, errstruct::errmsg, PNGD_P2DINFO_struct::errmsg, PNGD_P2DINFO_struct::file_gamma, PNGD_P2DINFO_struct::flags, gamma_correct(), PNGD_COLOR_struct::green, PNGD_P2DINFO_struct::heap, PNGD_P2DINFO_struct::interlace, errstruct::jbufp, PNGD_P2DINFO_struct::lpbits, PNGD_P2DINFO_struct::lpdib, my_error_fn(), my_warning_fn(), PNGD_P2DINFO_struct::palette, PNGD_P2DINFO_struct::palette_colors, PNGD_P2DINFO_struct::palette_offs, PNGD_GAMMA_CORRECTION, pngd_get_error_message(), PNGD_USE_BKGD, PNGD_USE_CUSTOM_BG, PNGD_USE_HEAPALLOC, PNGD_P2DINFO_struct::pngfn, PNGD_COLOR_struct::red, PNGD_P2DINFO_struct::res_units, PNGD_P2DINFO_struct::res_x, PNGD_P2DINFO_struct::res_y, screen_gamma, PNGD_P2DINFO_struct::structsize, and VOID().
Referenced by convertPNG2BMP().
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 | ) |
References PNGD_D2PINFO_struct::bitssize, PNGD_D2PINFO_struct::dibsize, PNGD_D2PINFO_struct::errmsg, errstruct::errmsg, PNGD_D2PINFO_struct::flags, errstruct::jbufp, PNGD_D2PINFO_struct::lpbits, PNGD_D2PINFO_struct::lpdib, my_error_fn(), my_warning_fn(), pngd_get_error_message(), PNGD_INTERLACED, PNGD_NO_GAMMA_LABEL, PNGD_D2PINFO_struct::pngfn, size, PNGD_D2PINFO_struct::software, PNGD_D2PINFO_struct::structsize, uncompress_dib(), and VOID().
Referenced by convertBMP2PNG().
const double screen_gamma = 2.2 [static] |
Referenced by read_png_to_dib().