ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/resolu.h
(Generate patch)

Comparing ray/src/common/resolu.h (file contents):
Revision 1.1 by greg, Mon Nov 11 14:03:22 1991 UTC vs.
Revision 2.9 by schorsch, Fri Jan 2 11:35:17 2004 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   * Definitions for resolution line in image file.
4   *
5 + * Include after <stdio.h>, <string.h>, and <time.h>
6 + *
7   * True image orientation is defined by an xy coordinate system
8   * whose origin is at the lower left corner of the image, with
9   * x increasing to the right and y increasing in the upward direction.
# Line 14 | Line 13
13   * A typical line for a 1024x600 image might be "-Y 600 +X 1024\n",
14   * indicating that the scanlines are in English text order (PIXSTANDARD).
15   */
16 + #ifndef _RAD_RESOLU_H_
17 + #define _RAD_RESOLU_H_
18  
19 + #include <time.h>
20 +
21 +
22 + #ifdef __cplusplus
23 + extern "C" {
24 + #endif
25 +
26                          /* flags for scanline ordering */
27   #define  XDECR                  1
28   #define  YDECR                  2
# Line 26 | Line 34
34  
35                          /* structure for image dimensions */
36   typedef struct {
37 <        int     or;             /* orientation (from flags above) */
37 >        int     rt;             /* orientation (from flags above) */
38          int     xr, yr;         /* x and y resolution */
39   } RESOLU;
40  
41                          /* macros to get scanline length and number */
42 < #define  scanlen(rs)            ((rs)->or & YMAJOR ? (rs)->xr : (rs)->yr)
43 < #define  numscans(rs)           ((rs)->or & YMAJOR ? (rs)->yr : (rs)->xr)
42 > #define  scanlen(rs)            ((rs)->rt & YMAJOR ? (rs)->xr : (rs)->yr)
43 > #define  numscans(rs)           ((rs)->rt & YMAJOR ? (rs)->yr : (rs)->xr)
44  
45                          /* resolution string buffer and its size */
46   #define  RESOLU_BUFLEN          32
# Line 47 | Line 55 | extern char  resolu_buf[RESOLU_BUFLEN];
55   #define  fprtresolu(sl,ns,fp)   fprintf(fp,PIXSTDFMT,ns,sl)
56   #define  fscnresolu(sl,ns,fp)   (fscanf(fp,PIXSTDFMT,ns,sl)==2)
57  
58 < extern char  *fgets(), *resolu2str();
58 >                                        /* defined in resolu.c */
59 > extern void     fputresolu(int ord, int sl, int ns, FILE *fp);
60 > extern int      fgetresolu(int *sl, int *ns, FILE *fp);
61 > extern char *   resolu2str(char *buf, RESOLU *rp);
62 > extern int      str2resolu(RESOLU *rp, char *buf);
63 >                                        /* defined in header.c */
64 > extern void     newheader(char *t, FILE *fp);
65 > extern int      isheadid(char *s);
66 > extern int      headidval(char *r, char *s);
67 > extern int      dateval(time_t *t, char *s);
68 > extern int      isdate(char *s);
69 > extern void     fputdate(time_t t, FILE *fp);
70 > extern void     fputnow(FILE *fp);
71 > extern void     printargs(int ac, char **av, FILE *fp);
72 > extern int      isformat(char *s);
73 > extern int      formatval(char *r, char *s);
74 > extern void     fputformat(char *s, FILE *fp);
75 > typedef int gethfunc(char *s, void *p); /* callback to process header lines */
76 > extern int      getheader(FILE *fp, gethfunc *f, void *p);
77 > extern int      globmatch(char *pat, char *str);
78 > extern int      checkheader(FILE *fin, char *fmt, FILE *fout);
79 >
80 > #ifdef __cplusplus
81 > }
82 > #endif
83 > #endif /* _RAD_RESOLU_H_ */
84 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines