| 1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 12 |
|
|
| 13 |
|
#include <stdio.h> |
| 14 |
|
|
| 15 |
+ |
#ifdef MSDOS |
| 16 |
+ |
#include <fcntl.h> |
| 17 |
+ |
#endif |
| 18 |
+ |
|
| 19 |
+ |
#include <math.h> |
| 20 |
+ |
|
| 21 |
|
#include <signal.h> |
| 22 |
|
|
| 23 |
|
#include "color.h" |
| 29 |
|
extern char *malloc(); |
| 30 |
|
extern float *matchlamp(); |
| 31 |
|
|
| 32 |
< |
#define FEQ(a,b) ((a) >= .98*(b) && (a) <= 1.02*(b)) |
| 32 |
> |
#define FEQ(a,b) ((a) >= .98*(b) && (a) <= 1.02*(b)) |
| 33 |
|
|
| 34 |
< |
#define CHECKRAD 1.5 /* radius to check for filtering */ |
| 34 |
> |
#define CHECKRAD 1.5 /* radius to check for filtering */ |
| 35 |
|
|
| 36 |
|
COLOR exposure = WHTCOLOR; /* exposure for the frame */ |
| 37 |
|
|
| 38 |
< |
double rad = 0.0; /* output pixel radius for filtering */ |
| 38 |
> |
double rad = 0.0; /* output pixel radius for filtering */ |
| 39 |
|
|
| 40 |
|
int nrows = 0; /* number of rows for output */ |
| 41 |
|
int ncols = 0; /* number of columns for output */ |
| 42 |
|
|
| 43 |
< |
double x_c = 1.0; /* ratio of output x size to input */ |
| 44 |
< |
double y_r = 1.0; /* ratio of output y size to input */ |
| 43 |
> |
double x_c = 1.0; /* ratio of output x size to input */ |
| 44 |
> |
double y_r = 1.0; /* ratio of output y size to input */ |
| 45 |
|
|
| 46 |
|
int singlepass = 0; /* true means skip first pass */ |
| 47 |
|
|
| 48 |
|
int avghot = 0; /* true means average in bright spots */ |
| 49 |
|
|
| 50 |
< |
double hotlvl = 1000.0; /* level considered "hot" */ |
| 50 |
> |
double hotlvl = 1000.0; /* level considered "hot" */ |
| 51 |
|
|
| 52 |
|
int npts = 0; /* (half) number of points for stars */ |
| 53 |
|
|
| 54 |
< |
double spread = 1e-4; /* spread for star points */ |
| 54 |
> |
double spread = 1e-4; /* spread for star points */ |
| 55 |
|
|
| 56 |
|
char *tfname = NULL; |
| 57 |
|
|
| 59 |
|
|
| 60 |
|
int order; /* scanline ordering of input */ |
| 61 |
|
int xres, yres; /* resolution of input */ |
| 62 |
< |
double inpaspect = 1.0; /* pixel aspect ratio of input */ |
| 62 |
> |
double inpaspect = 1.0; /* pixel aspect ratio of input */ |
| 63 |
|
int correctaspect = 0; /* aspect ratio correction? */ |
| 64 |
|
|
| 65 |
|
int wrongformat = 0; |
| 78 |
|
int argc; |
| 79 |
|
char **argv; |
| 80 |
|
{ |
| 75 |
– |
extern double pow(); |
| 81 |
|
extern long ftell(); |
| 82 |
|
extern int quit(), headline(); |
| 83 |
|
FILE *fin; |
| 84 |
|
float *lampcolor; |
| 85 |
|
char *lamptype = NULL; |
| 86 |
|
long fpos; |
| 87 |
< |
double outaspect = 0.0; |
| 88 |
< |
double d; |
| 87 |
> |
double outaspect = 0.0; |
| 88 |
> |
double d; |
| 89 |
|
int i, j; |
| 90 |
< |
|
| 90 |
> |
#ifdef MSDOS |
| 91 |
> |
extern int _fmode; |
| 92 |
> |
_fmode = O_BINARY; |
| 93 |
> |
setmode(fileno(stdin), O_BINARY); |
| 94 |
> |
setmode(fileno(stdout), O_BINARY); |
| 95 |
> |
#endif |
| 96 |
|
if (signal(SIGINT, quit) == SIG_IGN) |
| 97 |
|
signal(SIGINT, SIG_IGN); |
| 98 |
|
if (signal(SIGHUP, quit) == SIG_IGN) |
| 99 |
|
signal(SIGINT, SIG_IGN); |
| 100 |
|
signal(SIGTERM, quit); |
| 101 |
|
signal(SIGPIPE, quit); |
| 102 |
< |
#ifdef SIGXCPU |
| 102 |
> |
#ifdef SIGXCPU |
| 103 |
|
signal(SIGXCPU, quit); |
| 104 |
|
signal(SIGXFSZ, quit); |
| 105 |
|
#endif |
| 359 |
|
int yread; |
| 360 |
|
int ycent, xcent; |
| 361 |
|
int r, c; |
| 362 |
< |
|
| 362 |
> |
|
| 363 |
|
pass2init(); |
| 364 |
|
scan2init(); |
| 365 |
|
yread = 0; |
| 402 |
|
scan2init() /* prepare scanline arrays */ |
| 403 |
|
{ |
| 404 |
|
COLOR ctmp; |
| 405 |
< |
double d; |
| 405 |
> |
double d; |
| 406 |
|
register int i; |
| 407 |
|
|
| 408 |
|
if (rad <= 0.0) { |