| 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 |
| 15 |
|
*/ |
| 16 |
|
#ifndef _RAD_RESOLU_H_ |
| 17 |
|
#define _RAD_RESOLU_H_ |
| 18 |
+ |
|
| 19 |
|
#ifdef __cplusplus |
| 20 |
|
extern "C" { |
| 21 |
|
#endif |
| 22 |
|
|
| 22 |
– |
#include "copyright.h" |
| 23 |
– |
|
| 23 |
|
/* flags for scanline ordering */ |
| 24 |
|
#define XDECR 1 |
| 25 |
|
#define YDECR 2 |
| 27 |
|
|
| 28 |
|
/* standard scanline ordering */ |
| 29 |
|
#define PIXSTANDARD (YMAJOR|YDECR) |
| 30 |
< |
#define PIXSTDFMT "-Y %d +X %d\n" |
| 30 |
> |
#define PIXSTDFMT "-Y %8d +X %8d\n" |
| 31 |
|
|
| 32 |
|
/* structure for image dimensions */ |
| 33 |
|
typedef struct { |
| 50 |
|
|
| 51 |
|
/* reading/writing of standard ordering */ |
| 52 |
|
#define fprtresolu(sl,ns,fp) fprintf(fp,PIXSTDFMT,ns,sl) |
| 53 |
< |
#define fscnresolu(sl,ns,fp) (fscanf(fp,PIXSTDFMT,ns,sl)==2) |
| 53 |
> |
#define fscnresolu(sl,ns,fp) (fgetresolu(sl,ns,fp)==PIXSTANDARD) |
| 54 |
|
|
| 55 |
< |
/* defined in resolu.c */ |
| 55 |
> |
/* defined in resolu.c */ |
| 56 |
|
extern void fputresolu(int ord, int sl, int ns, FILE *fp); |
| 57 |
|
extern int fgetresolu(int *sl, int *ns, FILE *fp); |
| 58 |
|
extern char * resolu2str(char *buf, RESOLU *rp); |
| 59 |
|
extern int str2resolu(RESOLU *rp, char *buf); |
| 61 |
– |
/* defined in header.c */ |
| 62 |
– |
extern void newheader(char *t, FILE *fp); |
| 63 |
– |
extern int isheadid(char *s); |
| 64 |
– |
extern int headidval(char *r, char *s); |
| 65 |
– |
extern int dateval(time_t *t, char *s); |
| 66 |
– |
extern int isdate(char *s); |
| 67 |
– |
extern void fputdate(time_t t, FILE *fp); |
| 68 |
– |
extern void fputnow(FILE *fp); |
| 69 |
– |
extern void printargs(int ac, char **av, FILE *fp); |
| 70 |
– |
extern int isformat(char *s); |
| 71 |
– |
extern int formatval(char *r, char *s); |
| 72 |
– |
extern void fputformat(char *s, FILE *fp); |
| 73 |
– |
extern int getheader(FILE *fp, int (*f)(), char *p); |
| 74 |
– |
extern int globmatch(char *pat, char *str); |
| 75 |
– |
extern int checkheader(FILE *fin, char *fmt, FILE *fout); |
| 76 |
– |
|
| 60 |
|
|
| 61 |
|
#ifdef __cplusplus |
| 62 |
|
} |