129 |
|
/* convert image */ |
130 |
|
for (y = ymax-1; y >= 0; y--) { |
131 |
|
for (x = 0; x < xmax; x++) { |
132 |
– |
scanout[x][RED] = getc(stdin); |
133 |
– |
scanout[x][GRN] = getc(stdin); |
132 |
|
scanout[x][BLU] = getc(stdin); |
133 |
+ |
scanout[x][GRN] = getc(stdin); |
134 |
+ |
scanout[x][RED] = getc(stdin); |
135 |
|
} |
136 |
|
if (feof(stdin) || ferror(stdin)) |
137 |
|
quiterr("error reading rasterfile"); |
159 |
|
quiterr("error reading Radiance picture"); |
160 |
|
colrs_gambs(scanin, xmax); |
161 |
|
for (x = 0; x < xmax; x++) { |
162 |
– |
putc(scanin[x][RED], stdout); |
163 |
– |
putc(scanin[x][GRN], stdout); |
162 |
|
putc(scanin[x][BLU], stdout); |
163 |
+ |
putc(scanin[x][GRN], stdout); |
164 |
+ |
putc(scanin[x][RED], stdout); |
165 |
|
} |
166 |
|
if (ferror(stdout)) |
167 |
|
quiterr("error writing rasterfile"); |