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

Comparing ray/src/meta/meta2bmp.c (file contents):
Revision 1.1 by greg, Wed May 4 23:43:19 2005 UTC vs.
Revision 1.4 by greg, Mon Nov 18 22:12:32 2019 UTC

# Line 12 | Line 12 | static const char RCSid[] = "$Id$";
12   #include  "plot.h"
13   #include  "rast.h"
14   #include  "bmpfile.h"
15 + #include  "targa.h"
16  
17 < #define  MAXALLOC  30000
17 > #define  MAXALLOC  100000
18   #define  DXSIZE  400            /* default x resolution */
19   #define  DYSIZE  400            /* default y resolution */
20   #define  XCOM  "pexpand +vOCImsp -DP %s | psort +y"
# Line 23 | Line 24 | char  *progname;
24  
25   SCANBLOCK       outblock;
26  
27 < int  dxsize = DXSIZE, dysize = DYSIZE;
27 > int  dxsiz = DXSIZE, dysiz = DYSIZE;
28  
29   int  maxalloc = MAXALLOC;
30  
# Line 39 | Line 40 | static int  lineno = 0;
40   static short  condonly = FALSE,
41                conditioned = FALSE;
42  
42 static int putthead(struct hdStruct  *hp, char  *ip, FILE  *fp);
43  
44  
45  
# Line 82 | Line 82 | main(
82            argc--;
83            break;
84         case 'x':
85 <          dxsize = atoi(*++argv);
85 >          dxsiz = atoi(*++argv);
86            argc--;
87            break;
88         case 'y':
89 <          dysize = atoi(*++argv);
89 >          dysiz = atoi(*++argv);
90            argc--;
91            break;
92         case 'o':
# Line 156 | Line 156 | initfile(void)         /* initialize this file */
156      static unsigned char  cmap[24] = {255,255,255, 255,152,0, 0,188,0, 0,0,255,
157                          179,179,0, 255,0,255, 0,200,200, 0,0,0};
158       */
159 <    static const unsigned char  cmap[8][3] = {0,0,0, 0,0,255, 0,188,0, 255,152,0,
160 <                        0,200,200, 255,0,255, 179,179,0, 255,255,255};
159 >    static const unsigned char  cmap[8][3] = {{0,0,0}, {0,0,255}, {0,188,0},
160 >                {255,152,0}, {0,200,200}, {255,0,255}, {179,179,0}, {255,255,255}};
161      static int  filenum = 0;
162      BMPHeader  *hp;
163      register int  i;
164  
165 <    hp = BMPmappedHeader(dxsize, dysize, 0, 256);
165 >    hp = BMPmappedHeader(dxsiz, dysiz, 0, 256);
166      hp->compr = BI_RLE8;
167      if (hp == NULL)
168          error(USER, "Illegal image parameter(s)");
# Line 192 | Line 192 | nextpage(void)         /* advance to next page */
192      if (lineno == 0)
193          return;
194      if (bmpw != NULL) {
195 <        while (lineno < dysize) {
195 >        while (lineno < dysiz) {
196              nextblock();
197              outputblock();
198          }
# Line 211 | Line 211 | extern void
211   printblock(void)                /* output scanline block to file */
212  
213   {
214 <    int  i, c2;
214 >    int  i;
215      register unsigned char  *scanline;
216    register int  j, beg, cnt = 0;
216  
217      if (lineno == 0)
218          initfile();
219 <    for (i = outblock.ybot; i <= outblock.ytop && i < dysize; i++) {
219 >    for (i = outblock.ybot; i <= outblock.ytop && i < dysiz; i++) {
220          scanline = outblock.cols[i-outblock.ybot] + outblock.xleft;
221          memcpy((void *)bmpw->scanline, (void *)scanline,
222                          sizeof(uint8)*(outblock.xright-outblock.xleft+1));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines