1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
– |
|
5 |
– |
/* Copyright 1989 Regents of the University of California */ |
6 |
– |
|
7 |
– |
#ifndef lint |
8 |
– |
static char SCCSid[] = "@(#)ra_pixar.c 1.2 9/12/89 LBL"; |
9 |
– |
#endif |
10 |
– |
|
4 |
|
/* ra_pixar.c */ |
5 |
|
/* |
6 |
|
* convert from RADIANCE image file to PIXAR image file. (or vice versa) |
18 |
|
*/ |
19 |
|
|
20 |
|
#include <stdio.h> |
21 |
+ |
#include <string.h> |
22 |
|
#include <math.h> |
23 |
+ |
#include <time.h> |
24 |
|
|
25 |
|
/* PIXAR */ |
26 |
|
#include <picio.h> |
31 |
|
#ifdef undef |
32 |
|
#include "color.h" |
33 |
|
#else |
39 |
– |
#define XDECR 1 |
40 |
– |
#define YDECR 2 |
41 |
– |
#define YMAJOR 4 |
42 |
– |
|
34 |
|
#define RED 0 |
35 |
|
#define GRN 1 |
36 |
|
#define BLU 2 |
40 |
|
((col)[RED]=(r),(col)[GRN]=(g),(col)[BLU]=(b)) |
41 |
|
typedef float COLOR[3]; /* red, green, blue */ |
42 |
|
#endif |
43 |
+ |
#include "resolu.h" |
44 |
|
|
45 |
|
|
46 |
|
char *ProgramName; |
114 |
|
perror("malloc"); |
115 |
|
exit(1); |
116 |
|
} |
117 |
< |
bzero(pixar_scanline,width*sizeof(RGBAPixelType)); |
117 |
> |
memset(pixar_scanline, '\0', width*sizeof(RGBAPixelType)); |
118 |
|
|
119 |
|
PicSetForce(1); |
120 |
|
PicSetPsize(width,height); |
162 |
|
exit(1); |
163 |
|
} |
164 |
|
getheader(radiance_fp,NULL); |
165 |
< |
if (fgetresolu(w, h, radiance_fp) != (YMAJOR|YDECR)) |
165 |
> |
if (fgetresolu(w, h, radiance_fp) < 0) |
166 |
|
{ |
167 |
|
fprintf(stderr,"bad RADIANCE format\n"); |
168 |
|
exit(1); |
269 |
|
{ |
270 |
|
printargs(global_argc,global_argv,fp); |
271 |
|
fputc('\n',fp); |
272 |
< |
fputresolu(YMAJOR|YDECR, x, y, fp); |
272 |
> |
fprtresolu(x, y, fp); |
273 |
|
fflush(fp); |
274 |
|
} |
275 |
|
|