File: pcd.h

package info (click to toggle)
xli 1.17.0+20061110-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,540 kB
  • sloc: ansic: 25,840; makefile: 11
file content (60 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* #ident "@(#)x11:contrib/clients/xloadimage/pcd.h 1.2 94/07/29 Labtam" */
/*  */
/*
 * pcd.h - header file for Photograph on CD image files.
 */
 
#define PCDSHIFT 11
#define PCDBLOCK (1 << PCDSHIFT)
#define PCDBMASK (PCDBLOCK-1)

#define BASEW 768
#define BASEH 512

#define SZ_B16	-2
#define SZ_B4	-1
#define SZ_B	0
#define SZ_4B	1
#define SZ_16B	2

#define PCD_NO_ROTATE 0
#define PCD_ACLOCK_ROTATE 1
#define PCD_CLOCK_ROTATE 2

/* PCD image information */
typedef struct {
	ZFILE *zf;
	unsigned long off;		/* File byte offset of the start of the buffer */
	int nob;				/* Number of bytes currently in buffer */
	byte buf[PCDBLOCK];		/* current block data */

	byte *bp;				/* Current byte pointer */
	unsigned int bits;		/* bits buffer */
	int	bytes_left;			/* Bytes left from *bp */
	int	bits_left;			/* Bits left in bits */

	char *name;			/* stash pointer to name here too */
	char magic[8];		/* image format ident string (?) */
	char source[89];	/* source (?) */
	char owner[21];		/* owner (?) */
	int rotate;			/* rotation needed */

	int size;			/* Size code */
	int width,height;	/* Target width/height */
	unsigned int xzoom,yzoom;	/* User specified zoom percentages */

	byte *Lp,*C1p,*C2p;	/* Pointers to the color components */
	} pcdHeader;


/* Huffman entry (16 bit signed int) */
typedef struct {
	byte l;			/* number of bits */
	sbyte v;		/* value */
	} huff;

/* The file offset of the next read */
#define pcd_offset(hp) ((hp)->off + (hp)->nob)