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

Comparing ray/src/px/x11image.c (file contents):
Revision 2.58 by schorsch, Sun Jun 8 12:03:10 2003 UTC vs.
Revision 2.59 by greg, Fri Jun 20 00:25:50 2003 UTC

# Line 537 | Line 537 | getras()                               /* get raster file */
537                          goto fail;
538                  getmono();
539          } else if (ourvis.class == TrueColor | ourvis.class == DirectColor) {
540 <                int  datsiz = ourvis.depth>16 ? sizeof(int4) : sizeof(int2);
540 >                int  datsiz = ourvis.depth>16 ? sizeof(int32) : sizeof(int16);
541                  ourdata = (unsigned char *)malloc(datsiz*xmax*ymax);
542                  if (ourdata == NULL)
543                          goto fail;
# Line 1152 | Line 1152 | COLR  *scan;
1152   getfull()                       /* get full (24-bit) data */
1153   {
1154          int     y;
1155 <        register unsigned int4  *dp;
1156 <        register unsigned int2  *dph;
1155 >        register uint32 *dp;
1156 >        register uint16 *dph;
1157          register int    x;
1158                                          /* initialize tone mapping */
1159          make_tonemap();
1160                                          /* read and convert file */
1161 <        dp = (unsigned int4 *)ourdata;
1162 <        dph = (unsigned int2 *)ourdata;
1161 >        dp = (uint32 *)ourdata;
1162 >        dph = (uint16 *)ourdata;
1163          for (y = 0; y < ymax; y++) {
1164                  getscan(y);
1165                  add2icon(y, scanline);
# Line 1167 | Line 1167 | getfull()                      /* get full (24-bit) data */
1167                  switch (ourras->image->blue_mask) {
1168                  case 0xff:              /* 24-bit RGB */
1169                          for (x = 0; x < xmax; x++)
1170 <                                *dp++ = (unsigned int4)scanline[x][RED] << 16 |
1171 <                                        (unsigned int4)scanline[x][GRN] << 8 |
1172 <                                        (unsigned int4)scanline[x][BLU] ;
1170 >                                *dp++ = (uint32)scanline[x][RED] << 16 |
1171 >                                        (uint32)scanline[x][GRN] << 8 |
1172 >                                        (uint32)scanline[x][BLU] ;
1173                          break;
1174                  case 0xff0000:          /* 24-bit BGR */
1175                          for (x = 0; x < xmax; x++)
1176 <                                *dp++ = (unsigned int4)scanline[x][RED] |
1177 <                                        (unsigned int4)scanline[x][GRN] << 8 |
1178 <                                        (unsigned int4)scanline[x][BLU] << 16 ;
1176 >                                *dp++ = (uint32)scanline[x][RED] |
1177 >                                        (uint32)scanline[x][GRN] << 8 |
1178 >                                        (uint32)scanline[x][BLU] << 16 ;
1179                          break;
1180   #if 0
1181                  case 0x1f:              /* 15-bit RGB */
# Line 1231 | Line 1231 | getgrey()                      /* get greyscale data */
1231                  tmap_colrs(scanline, xmax);
1232                  if (maxcolors < 256)
1233                          for (x = 0; x < xmax; x++)
1234 <                                *dp++ = ((int4)scanline[x][GRN] *
1234 >                                *dp++ = ((int32)scanline[x][GRN] *
1235                                          maxcolors + maxcolors/2) >> 8;
1236                  else
1237                          for (x = 0; x < xmax; x++)
# Line 1239 | Line 1239 | getgrey()                      /* get greyscale data */
1239          }
1240          for (x = 0; x < maxcolors; x++)
1241                  clrtab[x][RED] = clrtab[x][GRN] =
1242 <                        clrtab[x][BLU] = ((int4)x*256 + 128)/maxcolors;
1242 >                        clrtab[x][BLU] = ((int32)x*256 + 128)/maxcolors;
1243   }
1244  
1245  
# Line 1252 | Line 1252 | getmapped()                    /* get color-mapped data */
1252                                          /* initialize tone mapping */
1253          make_tonemap();
1254                                          /* make histogram */
1255 <        if (new_histo((int4)xmax*ymax) == -1)
1255 >        if (new_histo((int32)xmax*ymax) == -1)
1256                  quiterr("cannot initialize histogram");
1257          for (y = 0; y < ymax; y++) {
1258                  if (getscan(y) < 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines