ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/ra_bmp.c
(Generate patch)

Comparing ray/src/px/ra_bmp.c (file contents):
Revision 2.5 by greg, Fri Apr 30 17:30:33 2004 UTC vs.
Revision 2.7 by greg, Fri Apr 30 21:16:58 2004 UTC

# Line 41 | Line 41 | main(int argc, char *argv[])
41          progname = argv[0];
42  
43          for (i = 1; i < argc; i++)
44 <                if (argv[i][0] == '-')
44 >                if (argv[i][0] == '-' && argv[i][1])
45                          switch (argv[i][1]) {
46                          case 'b':
47                                  rgbp = NULL;
# Line 72 | Line 72 | main(int argc, char *argv[])
72                          case 'r':
73                                  reverse = !reverse;
74                                  break;
75                        case '\0':
76                                break;
75                          default:
76                                  goto userr;
77                          }
# Line 164 | Line 162 | main(int argc, char *argv[])
162                  if (hdr == NULL)
163                          quiterr("cannot initialize BMP header");
164                                          /* set up output direction */
165 <                hdr->yIsDown = (rs.rt & YDECR) &&
168 <                                ((outfile == NULL) | (hdr->compr == BI_RLE8));
165 >                hdr->yIsDown = ((outfile == NULL) | (hdr->compr == BI_RLE8));
166                                          /* open BMP output */
167                  if (outfile != NULL)
168                          wtr = BMPopenOutputFile(outfile, hdr);
# Line 174 | Line 171 | main(int argc, char *argv[])
171                  if (wtr == NULL)
172                          quiterr("cannot allocate writer structure");
173                                          /* convert file */
174 <                rad2bmp(stdin, wtr, !hdr->yIsDown && rs.rt&YDECR, rgbp==NULL);
174 >                rad2bmp(stdin, wtr, !hdr->yIsDown, rgbp==NULL);
175                                          /* flush output */
176                  if (fflush((FILE *)wtr->c_data) < 0)
177                          quiterr("error writing BMP output");
# Line 351 | Line 348 | tmap2bmp(char *fnin, char *fnout, char *expec, RGBPRIM
348                                          /* write to BMP file */
349          while (wtr->yscan < yr) {
350                  BYTE    *scn = pa + xr*((tmflags & TM_F_BW) ? 1 : 3)*
351 <                                        ((rs.rt & YDECR) ?
355 <                                                (yr-1 - wtr->yscan) :
356 <                                                wtr->yscan);
351 >                                                (yr-1 - wtr->yscan);
352                  if (tmflags & TM_F_BW)
353                          memcpy((void *)wtr->scanline, (void *)scn, xr);
354                  else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines