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 |
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 |
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(); |
63 |
< |
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 MAXFMTLEN 64 |
60 |
> |
#define isheadid(s) headidval(NULL,s) |
61 |
> |
#define isformat(s) formatval(NULL,s) |
62 |
> |
#define isdate(s) dateval(NULL,s) |
63 |
> |
#define isgmt(s) gmtval(NULL,s) |
64 |
|
|
65 |
< |
#else |
65 |
> |
#define LATLONSTR "LATLONG=" |
66 |
> |
#define LLATLONSTR 8 |
67 |
> |
#define islatlon(hl) (!strncmp(hl,LATLONSTR,LLATLONSTR)) |
68 |
> |
#define latlonval(ll,hl) sscanf((hl)+LLATLONSTR, "%f %f", \ |
69 |
> |
&(ll)[0],&(ll)[1]) |
70 |
> |
#define fputlatlon(lat,lon,fp) fprintf(fp,"%s %.6f %.6f\n",LATLONSTR,lat,lon) |
71 |
> |
|
72 |
|
/* defined in resolu.c */ |
73 |
|
extern void fputresolu(int ord, int sl, int ns, FILE *fp); |
74 |
|
extern int fgetresolu(int *sl, int *ns, FILE *fp); |
75 |
|
extern char * resolu2str(char *buf, RESOLU *rp); |
76 |
|
extern int str2resolu(RESOLU *rp, char *buf); |
77 |
|
/* defined in header.c */ |
78 |
< |
extern void newheader(char *t, FILE *fp); |
79 |
< |
extern int isheadid(char *s); |
80 |
< |
extern int headidval(char *r, char *s); |
81 |
< |
extern int dateval(time_t *t, char *s); |
143 |
< |
extern int isdate(char *s); |
78 |
> |
extern void newheader(const char *t, FILE *fp); |
79 |
> |
extern int headidval(char *r, const char *s); |
80 |
> |
extern int dateval(time_t *t, const char *s); |
81 |
> |
extern int gmtval(time_t *t, const char *s); |
82 |
|
extern void fputdate(time_t t, FILE *fp); |
83 |
|
extern void fputnow(FILE *fp); |
84 |
|
extern void printargs(int ac, char **av, FILE *fp); |
85 |
< |
extern int isformat(char *s); |
86 |
< |
extern int formatval(char *r, char *s); |
87 |
< |
extern void fputformat(char *s, FILE *fp); |
88 |
< |
extern int getheader(FILE *fp, int (*f)(), char *p); |
89 |
< |
extern int globmatch(char *pat, char *str); |
90 |
< |
extern int checkheader(FILE *fin, char *fmt, FILE *fout); |
85 |
> |
extern int formatval(char fmt[MAXFMTLEN], const char *s); |
86 |
> |
extern void fputformat(const char *s, FILE *fp); |
87 |
> |
typedef int gethfunc(char *s, void *p); /* callback to process header lines */ |
88 |
> |
extern int getheader(FILE *fp, gethfunc *f, void *p); |
89 |
> |
extern int globmatch(const char *pat, const char *str); |
90 |
> |
extern int checkheader(FILE *fin, char fmt[MAXFMTLEN], FILE *fout); |
91 |
|
|
154 |
– |
#endif |
155 |
– |
|
92 |
|
#ifdef __cplusplus |
93 |
|
} |
94 |
|
#endif |
95 |
+ |
#endif /* _RAD_RESOLU_H_ */ |
96 |
+ |
|