Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Functions
rpng2-win.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include <time.h>
#include <math.h>
#include <windows.h>
#include <conio.h>
#include "readpng2.h"

Go to the source code of this file.

Macros

#define PROGNAME   "rpng2-win"
 
#define LONGNAME   "Progressive PNG Viewer for Windows"
 
#define VERSION   "2.02 of 16 March 2008"
 
#define PI   3.141592653589793238
 
#define PI_2   (PI*0.5)
 
#define INV_PI_360   (360.0 / PI)
 
#define MAX(a, b)   (a>b?a:b)
 
#define MIN(a, b)   (a<b?a:b)
 
#define CLIP(a, min, max)   MAX(min,MIN((a),max))
 
#define ABS(a)   ((a)<0?-(a):(a))
 
#define CLIP8P(c)   MAX(0,(MIN((c),255))) /* 8-bit pos. integer (uch) */
 
#define ROUNDF(f)   ((int)(f + 0.5))
 
#define rgb1_max   bg_freq
 
#define rgb1_min   bg_gray
 
#define rgb2_max   bg_bsat
 
#define rgb2_min   bg_brot
 
#define alpha_composite(composite, fg, alpha, bg)
 
#define INBUFSIZE
 

Functions

LRESULT CALLBACK rpng2_win_wndproc (HWND, UINT, WPARAM, LPARAM)
 
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
 

Macro Definition Documentation

◆ ABS

#define ABS (   a)    ((a)<0?-(a):(a))

Definition at line 109 of file rpng2-win.c.

◆ alpha_composite

#define alpha_composite (   composite,
  fg,
  alpha,
  bg 
)
Value:
{ \
ush temp = ((ush)(fg)*(ush)(alpha) + \
(ush)(bg)*(ush)(255 - (ush)(alpha)) + (ush)128); \
(composite) = (uch)((temp + (temp >> 8)) >> 8); \
}
unsigned short ush
Definition: zutil.h:36
GLfloat GLfloat GLfloat alpha
unsigned char uch
Definition: zutil.h:34

Definition at line 128 of file rpng2-win.c.

◆ CLIP

#define CLIP (   a,
  min,
  max 
)    MAX(min,MIN((a),max))

Definition at line 108 of file rpng2-win.c.

◆ CLIP8P

#define CLIP8P (   c)    MAX(0,(MIN((c),255))) /* 8-bit pos. integer (uch) */

Definition at line 110 of file rpng2-win.c.

◆ INBUFSIZE

#define INBUFSIZE
Value:
4096 /* with pseudo-timing on (1 sec delay/block), this
* block size corresponds roughly to a download
* speed 10% faster than theoretical 33.6K maximum
* (assuming 8 data bits, 1 stop bit and no other
* overhead) */

Definition at line 135 of file rpng2-win.c.

◆ INV_PI_360

#define INV_PI_360   (360.0 / PI)

Definition at line 105 of file rpng2-win.c.

◆ LONGNAME

#define LONGNAME   "Progressive PNG Viewer for Windows"

Definition at line 88 of file rpng2-win.c.

◆ MAX

#define MAX (   a,
  b 
)    (a>b?a:b)

Definition at line 106 of file rpng2-win.c.

◆ MIN

#define MIN (   a,
  b 
)    (a<b?a:b)

Definition at line 107 of file rpng2-win.c.

◆ PI

#define PI   3.141592653589793238

Definition at line 102 of file rpng2-win.c.

◆ PI_2

#define PI_2   (PI*0.5)

Definition at line 104 of file rpng2-win.c.

◆ PROGNAME

#define PROGNAME   "rpng2-win"

Definition at line 87 of file rpng2-win.c.

◆ rgb1_max

#define rgb1_max   bg_freq

Definition at line 113 of file rpng2-win.c.

◆ rgb1_min

#define rgb1_min   bg_gray

Definition at line 114 of file rpng2-win.c.

◆ rgb2_max

#define rgb2_max   bg_bsat

Definition at line 115 of file rpng2-win.c.

◆ rgb2_min

#define rgb2_min   bg_brot

Definition at line 116 of file rpng2-win.c.

◆ ROUNDF

#define ROUNDF (   f)    ((int)(f + 0.5))

Definition at line 111 of file rpng2-win.c.

◆ VERSION

#define VERSION   "2.02 of 16 March 2008"

Definition at line 89 of file rpng2-win.c.

Function Documentation

◆ rpng2_win_wndproc()

LRESULT CALLBACK rpng2_win_wndproc ( HWND  hwnd,
UINT  iMsg,
WPARAM  wP,
LPARAM  lP 
)

Definition at line 1188 of file rpng2-win.c.

References _mainprog_info::height, and _mainprog_info::width.

◆ WinMain()

int WINAPI WinMain ( HINSTANCE  hInst,
HINSTANCE  hPrevInst,
PSTR  cmd,
int  showmode 
)

Definition at line 247 of file rpng2-win.c.