Skip to content

Commit 2a6a1f5

Browse files
committed
OBF: Support complex data stacks
1 parent 00cd30b commit 2a6a1f5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

components/formats-bsd/src/loci/formats/in/OBFReader.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,19 @@ private long initStack(long current) throws FormatException, IOException {
374374
final int type = in.readInt();
375375
meta_data.pixelType = getPixelType(type);
376376
meta_data.bitsPerPixel = getBitsPerPixel(type);
377+
meta_data.interleaved = false;
378+
379+
380+
if((type & 0x40000000) != 0)
381+
{
382+
meta_data.interleaved = true;
383+
meta_data.sizeC *= 2;
384+
}
377385

378386
stack.bytesPerSample = meta_data.bitsPerPixel / 8;
379387

380388
meta_data.indexed = false;
381-
meta_data.rgb = false;
382-
meta_data.interleaved = false;
389+
meta_data.rgb = meta_data.interleaved;
383390

384391
final int compression = in.readInt();
385392
stack.compression = getCompression(compression);
@@ -610,7 +617,7 @@ private boolean isFLIMLabel(String label) {
610617
}
611618

612619
private int getPixelType(int type) throws FormatException {
613-
switch (type) {
620+
switch (type & 0xFFFFFFF) {
614621
case 0x01: return FormatTools.UINT8;
615622
case 0x02: return FormatTools.INT8;
616623
case 0x04: return FormatTools.UINT16;
@@ -633,6 +640,8 @@ private int getBitsPerPixel(int type) throws FormatException {
633640
case 0x20: return 32;
634641
case 0x40: return 32;
635642
case 0x80: return 64;
643+
case 0x40000040: return 64;
644+
case 0x40000080: return 128;
636645
default: throw new FormatException("Unsupported data type " + type);
637646
}
638647
}

0 commit comments

Comments
 (0)