@@ -138,7 +138,7 @@ else if (b >= 0 && b < 0x80) {
138
138
139
139
for (int y =0 ; y <4 ; y ++) {
140
140
for (int x =3 ; x >=0 ; x --) {
141
- int ndx = options .width *(column + y ) + row + x ;
141
+ int ndx = options .width *(column + ( 3 - y ) ) + row + x ;
142
142
short flag = y < 2 ? b : a ;
143
143
int shift = 4 - 4 *(y % 2 ) + x ;
144
144
int cmp = 1 << shift ;
@@ -163,8 +163,8 @@ else if (b >= 0 && b < 0x80) {
163
163
short q4b = in .readShort ();
164
164
165
165
for (int y =0 ; y <4 ; y ++) {
166
- for (int x =3 ; x >= 0 ; x --) {
167
- int ndx = options .width *(column + y ) + row + x ;
166
+ for (int x =3 ; x >=0 ; x --) {
167
+ int ndx = options .width *(column + ( 3 - y ) ) + row + x ;
168
168
169
169
short colorA =
170
170
x < 2 ? (y < 2 ? q3a : q1a ) : (y < 2 ? q4a : q2a );
@@ -189,7 +189,7 @@ else if (b >= 0 && b < 0x80) {
189
189
190
190
for (int y =0 ; y <4 ; y ++) {
191
191
for (int x =3 ; x >=0 ; x --) {
192
- int ndx = options .width *(column + y ) + row + x ;
192
+ int ndx = options .width *(column + ( 3 - y ) ) + row + x ;
193
193
if (ndx >= shorts .length ) break ;
194
194
short flag = y < 2 ? b : a ;
195
195
int shift = 4 - 4 *(y % 2 ) + x ;
@@ -213,7 +213,7 @@ else if (options.bitsPerSample == 8 && 0x90 < b) {
213
213
214
214
for (int y =0 ; y <4 ; y ++) {
215
215
for (int x =3 ; x >=0 ; x --) {
216
- int ndx = options .width *(column + y ) + row + x ;
216
+ int ndx = options .width *(column + ( 3 - y ) ) + row + x ;
217
217
byte colorA = y < 2 ? (x < 2 ? colors [4 ] : colors [6 ]) :
218
218
(x < 2 ? colors [0 ] : colors [2 ]);
219
219
byte colorB = y < 2 ? (x < 2 ? colors [5 ] : colors [7 ]) :
@@ -236,7 +236,7 @@ else if (options.bitsPerSample == 8 && 0x90 < b) {
236
236
else {
237
237
for (int y =0 ; y <4 ; y ++) {
238
238
for (int x =0 ; x <4 ; x ++) {
239
- int ndx = options .width *(column + y ) + row + x ;
239
+ int ndx = options .width *(column + ( 3 - y ) ) + row + x ;
240
240
if (options .bitsPerSample == 8 ) {
241
241
if (ndx < bytes .length ) {
242
242
bytes [ndx ] = (byte ) (a & 0xff );
0 commit comments