--- ray/src/px/ra_pixar.c 1990/01/16 09:11:40 1.3 +++ ray/src/px/ra_pixar.c 2003/06/30 14:59:12 2.3 @@ -1,13 +1,6 @@ #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ra_pixar.c,v 2.3 2003/06/30 14:59:12 schorsch Exp $"; #endif - -/* Copyright 1989 Regents of the University of California */ - -#ifndef lint -static char SCCSid[] = "@(#)ra_pixar.c 1.2 9/12/89 LBL"; -#endif - /* ra_pixar.c */ /* * convert from RADIANCE image file to PIXAR image file. (or vice versa) @@ -25,7 +18,9 @@ static char SCCSid[] = "@(#)ra_pixar.c 1.2 9/12/89 LBL */ #include +#include #include +#include /* PIXAR */ #include @@ -36,10 +31,6 @@ static char SCCSid[] = "@(#)ra_pixar.c 1.2 9/12/89 LBL #ifdef undef #include "color.h" #else -#define XDECR 1 -#define YDECR 2 -#define YMAJOR 4 - #define RED 0 #define GRN 1 #define BLU 2 @@ -49,6 +40,7 @@ static char SCCSid[] = "@(#)ra_pixar.c 1.2 9/12/89 LBL ((col)[RED]=(r),(col)[GRN]=(g),(col)[BLU]=(b)) typedef float COLOR[3]; /* red, green, blue */ #endif +#include "resolu.h" char *ProgramName; @@ -122,7 +114,7 @@ char *outfile; perror("malloc"); exit(1); } - bzero(pixar_scanline,width*sizeof(RGBAPixelType)); + memset(pixar_scanline, '\0', width*sizeof(RGBAPixelType)); PicSetForce(1); PicSetPsize(width,height); @@ -170,7 +162,7 @@ int *h; exit(1); } getheader(radiance_fp,NULL); - if (fgetresolu(w, h, radiance_fp) != (YMAJOR|YDECR)) + if (fgetresolu(w, h, radiance_fp) < 0) { fprintf(stderr,"bad RADIANCE format\n"); exit(1); @@ -277,7 +269,7 @@ int y; { printargs(global_argc,global_argv,fp); fputc('\n',fp); - fputresolu(YMAJOR|YDECR, x, y, fp); + fprtresolu(x, y, fp); fflush(fp); }