--- ray/src/px/ra_pixar.c 1989/07/24 08:42:56 1.1 +++ ray/src/px/ra_pixar.c 2003/06/30 14:59:12 2.3 @@ -1,9 +1,6 @@ -/* Copyright 1989 Regents of the University of California */ - #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 - /* ra_pixar.c */ /* * convert from RADIANCE image file to PIXAR image file. (or vice versa) @@ -21,7 +18,9 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#include #include +#include /* PIXAR */ #include @@ -41,6 +40,7 @@ static char SCCSid[] = "$SunId$ LBL"; ((col)[RED]=(r),(col)[GRN]=(g),(col)[BLU]=(b)) typedef float COLOR[3]; /* red, green, blue */ #endif +#include "resolu.h" char *ProgramName; @@ -114,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); @@ -162,7 +162,7 @@ int *h; exit(1); } getheader(radiance_fp,NULL); - if (fscanf(radiance_fp,"-Y %d +X %d\n",h,w) != 2) + if (fgetresolu(w, h, radiance_fp) < 0) { fprintf(stderr,"bad RADIANCE format\n"); exit(1); @@ -269,7 +269,7 @@ int y; { printargs(global_argc,global_argv,fp); fputc('\n',fp); - fprintf(fp,"-Y %d +X %d\n",y,x); + fprtresolu(x, y, fp); fflush(fp); }