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 2.3 by greg, Sat Feb 22 02:07:22 2003 UTC vs.
Revision 2.11 by greg, Thu May 21 18:08:43 2009 UTC

# Line 1 | Line 1
1 < /* RCSid: $Id$ */
1 > /* RCSid $Id$ */
2   /*
3   * Definitions for resolution line in image file.
4   *
5 < * Include after <stdio.h>, <string.h>, and <time.h>
5 > * Include after <stdio.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
# Line 13 | 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 < /* ====================================================================
18 < * The Radiance Software License, Version 1.0
19 < *
20 < * Copyright (c) 1990 - 2002 The Regents of the University of California,
21 < * through Lawrence Berkeley National Laboratory.   All rights reserved.
22 < *
23 < * Redistribution and use in source and binary forms, with or without
24 < * modification, are permitted provided that the following conditions
25 < * are met:
26 < *
27 < * 1. Redistributions of source code must retain the above copyright
28 < *         notice, this list of conditions and the following disclaimer.
29 < *
30 < * 2. Redistributions in binary form must reproduce the above copyright
31 < *       notice, this list of conditions and the following disclaimer in
32 < *       the documentation and/or other materials provided with the
33 < *       distribution.
34 < *
35 < * 3. The end-user documentation included with the redistribution,
36 < *           if any, must include the following acknowledgment:
37 < *             "This product includes Radiance software
38 < *                 (http://radsite.lbl.gov/)
39 < *                 developed by the Lawrence Berkeley National Laboratory
40 < *               (http://www.lbl.gov/)."
41 < *       Alternately, this acknowledgment may appear in the software itself,
42 < *       if and wherever such third-party acknowledgments normally appear.
43 < *
44 < * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
45 < *       and "The Regents of the University of California" must
46 < *       not be used to endorse or promote products derived from this
47 < *       software without prior written permission. For written
48 < *       permission, please contact [email protected].
49 < *
50 < * 5. Products derived from this software may not be called "Radiance",
51 < *       nor may "Radiance" appear in their name, without prior written
52 < *       permission of Lawrence Berkeley National Laboratory.
53 < *
54 < * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
55 < * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
56 < * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
57 < * DISCLAIMED.   IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
58 < * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 < * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 < * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
61 < * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
62 < * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
63 < * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
64 < * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65 < * SUCH DAMAGE.
66 < * ====================================================================
67 < *
68 < * This software consists of voluntary contributions made by many
69 < * individuals on behalf of Lawrence Berkeley National Laboratory.   For more
70 < * information on Lawrence Berkeley National Laboratory, please see
71 < * <http://www.lbl.gov/>.
72 < */
19 > #include <time.h>
20  
21 +
22   #ifdef __cplusplus
23   extern "C" {
24   #endif
# Line 107 | 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 < #ifdef NOPROTO
59 <                                        /* defined in resolu.c */
60 < extern void     fputresolu();
61 < extern int      fgetresolu();
62 < extern char     *resolu2str();
115 < extern int      str2resolu();
116 <                                        /* defined in header.c */
117 < extern void     newheader();
118 < extern int      isheadid();
119 < extern int      headidval();
120 < extern int      dateval();
121 < extern int      isdate();
122 < extern void     fputdate();
123 < extern void     fputnow();
124 < extern void     printargs();
125 < extern int      isformat();
126 < extern int      formatval();
127 < extern void     fputformat();
128 < extern int      getheader();
129 < extern int      globmatch();
130 < extern int      checkheader();
58 >                        /* identify header lines */
59 > #define  isheadid(s)    headidval(NULL,s)
60 > #define  isformat(s)    formatval(NULL,s)
61 > #define  isdate(s)      dateval(NULL,s)
62 > #define  isgmt(s)       gmtval(NULL,s)
63  
64 < #else
64 > #define  LATLONSTR      "LATLONG="
65 > #define  LLATLONSTR     8
66 > #define  islatlon(hl)           (!strncmp(hl,LATLONSTR,LLATLONSTR))
67 > #define  latlonval(ll,hl)       sscanf((hl)+LLATLONSTR, "%f %f", \
68 >                                                &(ll)[0],&(ll)[1])
69 > #define  fputlatlon(lat,lon,fp) fprintf(fp,"%s %.6f %.6f\n",LATLONSTR,lat,lon)
70 >
71                                          /* defined in resolu.c */
72   extern void     fputresolu(int ord, int sl, int ns, FILE *fp);
73   extern int      fgetresolu(int *sl, int *ns, FILE *fp);
# Line 137 | Line 75 | extern char *  resolu2str(char *buf, RESOLU *rp);
75   extern int      str2resolu(RESOLU *rp, char *buf);
76                                          /* defined in header.c */
77   extern void     newheader(char *t, FILE *fp);
140 extern int      isheadid(char *s);
78   extern int      headidval(char *r, char *s);
79   extern int      dateval(time_t *t, char *s);
80 < extern int      isdate(char *s);
80 > extern int      gmtval(time_t *t, char *s);
81   extern void     fputdate(time_t t, FILE *fp);
82   extern void     fputnow(FILE *fp);
83   extern void     printargs(int ac, char **av, FILE *fp);
147 extern int      isformat(char *s);
84   extern int      formatval(char *r, char *s);
85   extern void     fputformat(char *s, FILE *fp);
86 < extern int      getheader(FILE *fp, int (*f)(), char *p);
86 > typedef int gethfunc(char *s, void *p); /* callback to process header lines */
87 > extern int      getheader(FILE *fp, gethfunc *f, void *p);
88   extern int      globmatch(char *pat, char *str);
89   extern int      checkheader(FILE *fin, char *fmt, FILE *fout);
90  
154 #endif
155
91   #ifdef __cplusplus
92   }
93   #endif
94 + #endif /* _RAD_RESOLU_H_ */
95 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines