|
|
1.1 root 1: /* Copyright (c) 1989, 1990 AT&T --- All Rights Reserved. */
2: /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T. */
3: /* The copyright notice does not imply actual or intended publication. */
4: /* AUTHORS: */
5: /* H. S. Baird - ATT-BL MH - first versions */
6:
7: /* pic.h - picture files. See man page for picfile(5).
8: They have an ascii header, terminated by \n\n; see PIC_hdr for its data fields.
9: The rest is binary scanner data. Each `PIC_hdr.bpl' bytes holds one scan-line's
10: pixels, 1 bit/pixel. A `1' bit means black. The order of the bytes in a line
11: is left-to-right across the page. The low-order bit in a byte is the left-most.
12: Conventionally, X-coordinates start at 0, at the left of the page, and
13: increase to the right. Y-coordinates start at 0 at the top of the page,
14: and increase down.
15: NOTE: must be preceded by #include "Coord.h"
16: */
17:
18: typedef struct PIC_hdr {
19: /* Contents of picfile ASCII header (or other structure) */
20: char type[40]; /* "rle" "dump" "binary" "ccitt-g4" "imdir" etc */
21: Bbx bx; /* WINDOW (bounding box) */
22: short res_x; /* resolution in pixels/inch (x,y may differ) */
23: short res_y;
24: char *parms; /* PARMS= string */
25: char *misc; /* all other unexpected header lines, catenated */
26: /* the following are used by I/O routines */
27: FILE *fp;
28: long seek; /* current seek address */
29: int bpl; /* bytes per line (in file) */
30: unsigned char *line; /* one line of picture (malloc space) */
31: unsigned char *pline; /* prior line of picture (malloc space) */
32: Scoor cy; /* index no. of *line */
33: } PIC_hdr;
34: #define Init_PIC_hdr {"",Init_Bbx,0,0,NULL,NULL,NULL,0L,0,NULL,NULL,0}
35: #if MAIN
36: PIC_hdr empty_PIC_hdr = Init_PIC_hdr;
37: #else
38: extern PIC_hdr empty_PIC_hdr;
39: #endif
40:
41: /* these functions are in /usr/hsb/ocr/piclib.c */
42: PIC_hdr *alloc_PIC_hdr();
43: int PIC_get_hdr();
44: PIC_put_hdr();
45: err_PIC_line();
46: PIC_skip();
47: int PIC_rline();
48: int PIC_wline();
49: char *PIC_hdr_toa();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.