Skip to content

Commit

Permalink
ZarrReader: No need for x offset when unpacking bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgault committed Mar 10, 2022
1 parent 13c9bbc commit be19208
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/loci/formats/in/ZarrReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ else if (image instanceof short[]) {
for (int row = 0; row < h; row++) {
int base = row * w * bpp;
for (int i = 0; i < w; i++) {
DataTools.unpackBytes(data[(row * w) + i + x], buf, base + 2 * i, 2, little);
DataTools.unpackBytes(data[(row * w) + i], buf, base + 2 * i, 2, little);
}
}
}
Expand All @@ -423,7 +423,7 @@ else if (image instanceof int[]) {
for (int row = 0; row < h; row++) {
int base = row * w * bpp;
for (int i = 0; i < w; i++) {
DataTools.unpackBytes(data[(row * w) + i + x], buf, base + 4 * i, 4, little);
DataTools.unpackBytes(data[(row * w) + i], buf, base + 4 * i, 4, little);
}
}
}
Expand All @@ -432,7 +432,7 @@ else if (image instanceof float[]) {
for (int row = 0; row < h; row++) {
int base = row * w * bpp;
for (int i = 0; i < w; i++) {
int value = Float.floatToIntBits(data[(row * w) + i + x]);
int value = Float.floatToIntBits(data[(row * w) + i]);
DataTools.unpackBytes(value, buf, base + 4 * i, 4, little);
}
}
Expand All @@ -442,7 +442,7 @@ else if (image instanceof double[]) {
for (int row = 0; row < h; row++) {
int base = row * w * bpp;
for (int i = 0; i < w; i++) {
long value = Double.doubleToLongBits(data[(row * w) + i + x]);
long value = Double.doubleToLongBits(data[(row * w) + i]);
DataTools.unpackBytes(value, buf, base + 8 * i, 8, little);
}
}
Expand Down

0 comments on commit be19208

Please sign in to comment.