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 | Variables
rpng2-x.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <setjmp.h>
#include <time.h>
#include <math.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/keysym.h>
#include "readpng2.h"

Go to the source code of this file.

Macros

#define PROGNAME   "rpng2-x"
 
#define LONGNAME   "Progressive PNG Viewer for X"
 
#define VERSION   "2.02 of 16 March 2008"
 
#define RESNAME   "rpng2" /* our X resource application name */
 
#define RESCLASS   "Rpng" /* our X resource class name */
 
#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 QUIT(e, k)
 
#define NO_24BIT_MASKS   /* undef case not fully written--only for redisplay() */
 
#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

int main (int argc, char **argv)
 

Variables

int pause_after_pass = FALSE
 
int demo_timing = FALSE
 
ulg usleep_duration = 0L
 

Macro Definition Documentation

◆ ABS

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

Definition at line 126 of file rpng2-x.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 151 of file rpng2-x.c.

◆ CLIP

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

Definition at line 125 of file rpng2-x.c.

◆ CLIP8P

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

Definition at line 127 of file rpng2-x.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 158 of file rpng2-x.c.

◆ INV_PI_360

#define INV_PI_360   (360.0 / PI)

Definition at line 122 of file rpng2-x.c.

◆ LONGNAME

#define LONGNAME   "Progressive PNG Viewer for X"

Definition at line 96 of file rpng2-x.c.

◆ MAX

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

Definition at line 123 of file rpng2-x.c.

◆ MIN

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

Definition at line 124 of file rpng2-x.c.

◆ NO_24BIT_MASKS

#define NO_24BIT_MASKS   /* undef case not fully written--only for redisplay() */

Definition at line 134 of file rpng2-x.c.

◆ PI

#define PI   3.141592653589793238

Definition at line 119 of file rpng2-x.c.

◆ PI_2

#define PI_2   (PI*0.5)

Definition at line 121 of file rpng2-x.c.

◆ PROGNAME

#define PROGNAME   "rpng2-x"

Definition at line 95 of file rpng2-x.c.

◆ QUIT

#define QUIT (   e,
 
)
Value:
((e.type == ButtonPress && e.xbutton.button == Button1) || \
(e.type == KeyPress && /* v--- or 1 for shifted keys */ \
((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape)))

Definition at line 130 of file rpng2-x.c.

◆ RESCLASS

#define RESCLASS   "Rpng" /* our X resource class name */

Definition at line 99 of file rpng2-x.c.

◆ RESNAME

#define RESNAME   "rpng2" /* our X resource application name */

Definition at line 98 of file rpng2-x.c.

◆ rgb1_max

#define rgb1_max   bg_freq

Definition at line 136 of file rpng2-x.c.

◆ rgb1_min

#define rgb1_min   bg_gray

Definition at line 137 of file rpng2-x.c.

◆ rgb2_max

#define rgb2_max   bg_bsat

Definition at line 138 of file rpng2-x.c.

◆ rgb2_min

#define rgb2_min   bg_brot

Definition at line 139 of file rpng2-x.c.

◆ ROUNDF

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

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

◆ VERSION

#define VERSION   "2.02 of 16 March 2008"

Definition at line 97 of file rpng2-x.c.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 292 of file rpng2-x.c.

Variable Documentation

◆ demo_timing

int demo_timing = FALSE

Definition at line 200 of file rpng2-x.c.

◆ pause_after_pass

int pause_after_pass = FALSE

Definition at line 199 of file rpng2-x.c.

◆ usleep_duration

ulg usleep_duration = 0L

Definition at line 201 of file rpng2-x.c.