| 1 |
|
#ifndef lint |
| 2 |
< |
static const char RCSid[] = "$Id$"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 4 |
|
/* |
| 5 |
|
* pfilt.c - program to post-process picture file. |
| 8 |
|
* 6/23/93 Added additional buffers for value spreading |
| 9 |
|
*/ |
| 10 |
|
|
| 11 |
< |
#include "standard.h" |
| 11 |
> |
#include "copyright.h" |
| 12 |
|
|
| 13 |
|
#include <signal.h> |
| 14 |
+ |
#include <string.h> |
| 15 |
|
|
| 16 |
+ |
#include "standard.h" |
| 17 |
+ |
#include "platform.h" |
| 18 |
|
#include "color.h" |
| 16 |
– |
|
| 19 |
|
#include "view.h" |
| 18 |
– |
|
| 20 |
|
#include "paths.h" |
| 21 |
|
|
| 22 |
|
extern float *matchlamp(); |
| 23 |
|
|
| 24 |
|
#define FEQ(a,b) ((a) >= .98*(b) && (a) <= 1.02*(b)) |
| 25 |
|
|
| 26 |
< |
double CHECKRAD = 1.5; /* radius to check for filtering */ |
| 26 |
> |
double CHECKRAD = 2.0; /* radius to check for filtering */ |
| 27 |
|
|
| 28 |
|
#define THRESHRAD 5.0 /* maximum sample spread in output */ |
| 29 |
|
|
| 96 |
|
double outaspect = 0.0; |
| 97 |
|
double d; |
| 98 |
|
int i, j; |
| 99 |
< |
#ifdef MSDOS |
| 100 |
< |
extern int _fmode; |
| 101 |
< |
_fmode = O_BINARY; |
| 101 |
< |
setmode(fileno(stdin), O_BINARY); |
| 102 |
< |
setmode(fileno(stdout), O_BINARY); |
| 103 |
< |
#endif |
| 99 |
> |
SET_DEFAULT_BINARY(); |
| 100 |
> |
SET_FILE_BINARY(stdin); |
| 101 |
> |
SET_FILE_BINARY(stdout); |
| 102 |
|
if (signal(SIGINT, quit) == SIG_IGN) |
| 103 |
|
signal(SIGINT, SIG_IGN); |
| 104 |
+ |
#ifdef SIGHUP |
| 105 |
|
if (signal(SIGHUP, quit) == SIG_IGN) |
| 106 |
|
signal(SIGHUP, SIG_IGN); |
| 107 |
+ |
#endif |
| 108 |
|
signal(SIGTERM, quit); |
| 109 |
+ |
#ifdef SIGPIPE |
| 110 |
|
signal(SIGPIPE, quit); |
| 111 |
+ |
#endif |
| 112 |
|
#ifdef SIGXCPU |
| 113 |
|
signal(SIGXCPU, quit); |
| 114 |
|
signal(SIGXFSZ, quit); |
| 490 |
|
if (obarsize > 0) { |
| 491 |
|
scoutbar = (COLOR **)malloc(obarsize*sizeof(COLOR *)); |
| 492 |
|
greybar = (float **)malloc(obarsize*sizeof(float *)); |
| 493 |
< |
if (scoutbar == NULL | greybar == NULL) |
| 493 |
> |
if ((scoutbar == NULL) | (greybar == NULL)) |
| 494 |
|
goto memerr; |
| 495 |
|
for (i = 0; i < obarsize; i++) { |
| 496 |
|
scoutbar[i] = (COLOR *)malloc(ncols*sizeof(COLOR)); |
| 497 |
|
greybar[i] = (float *)malloc(ncols*sizeof(float)); |
| 498 |
< |
if (scoutbar[i] == NULL | greybar[i] == NULL) |
| 498 |
> |
if ((scoutbar[i] == NULL) | (greybar[i] == NULL)) |
| 499 |
|
goto memerr; |
| 500 |
|
} |
| 501 |
|
} else { |
| 544 |
|
greybar[nextrow%obarsize][c] = (*ourbright)(ctmp); |
| 545 |
|
} |
| 546 |
|
/* and zero output scanline */ |
| 547 |
< |
bzero((char *)scoutbar[nextrow%obarsize], ncols*sizeof(COLOR)); |
| 547 |
> |
memset((char *)scoutbar[nextrow%obarsize], '\0', ncols*sizeof(COLOR)); |
| 548 |
|
nextrow++; |
| 549 |
|
} |
| 550 |
|
/* point to top scanline for output */ |