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 |
< |
#include "copyright.h" |
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(); |
61 |
< |
/* defined in header.c */ |
62 |
< |
extern void newheader(); |
63 |
< |
extern int isheadid(); |
64 |
< |
extern int headidval(); |
65 |
< |
extern int dateval(); |
66 |
< |
extern int isdate(); |
67 |
< |
extern void fputdate(); |
68 |
< |
extern void fputnow(); |
69 |
< |
extern void printargs(); |
70 |
< |
extern int isformat(); |
71 |
< |
extern int formatval(); |
72 |
< |
extern void fputformat(); |
73 |
< |
extern int getheader(); |
74 |
< |
extern int globmatch(); |
75 |
< |
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); |
88 |
< |
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 |
|
|
99 |
– |
#endif |
100 |
– |
|
92 |
|
#ifdef __cplusplus |
93 |
|
} |
94 |
|
#endif |
95 |
+ |
#endif /* _RAD_RESOLU_H_ */ |
96 |
+ |
|