planes = new byte[r.getRGBChannelCount()][]; for (int c=0; c<planes.length; c++) { planes[c] = ImageTools.splitChannels(plane, c, r.getRGBChannelCount(), bpp, false, r.isInterleaved());
planes = new byte[r.getRGBChannelCount()][]; for (int c=0; c<planes.length; c++) { planes[c] = ImageTools.splitChannels(plane, c, r.getRGBChannelCount(), bpp, false, r.isInterleaved());
int nPixels = w * h * getRGBChannelCount(); int nBytes = float16 ? 2 : 3; int mantissaBits = float16 ? 10 : 16;
int nPixels = w * h * getRGBChannelCount(); int nBytes = float16 ? 2 : 3; int mantissaBits = float16 ? 10 : 16;
@Override public byte[] openThumbBytes(int no) throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (thumbnailIFDs == null || thumbnailIFDs.size() <= no) { return super.openThumbBytes(no); } if (tiffParser == null) { initTiffParser(); } tiffParser.fillInIFD(thumbnailIFDs.get(no)); int[] bps = null; try { bps = thumbnailIFDs.get(no).getBitsPerSample(); } catch (FormatException e) { } if (bps == null) { return super.openThumbBytes(no); } int b = bps[0]; while ((b % 8) != 0) b++; b /= 8; if (b != FormatTools.getBytesPerPixel(getPixelType()) || bps.length != getRGBChannelCount()) { return super.openThumbBytes(no); } byte[] buf = new byte[getThumbSizeX() * getThumbSizeY() * getRGBChannelCount() * FormatTools.getBytesPerPixel(getPixelType())]; return tiffParser.getSamples(thumbnailIFDs.get(no), buf); }
@Override public byte[] openThumbBytes(int no) throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); if (thumbnailIFDs == null || thumbnailIFDs.size() <= no) { return super.openThumbBytes(no); } if (tiffParser == null) { initTiffParser(); } tiffParser.fillInIFD(thumbnailIFDs.get(no)); int[] bps = null; try { bps = thumbnailIFDs.get(no).getBitsPerSample(); } catch (FormatException e) { } if (bps == null) { return super.openThumbBytes(no); } int b = bps[0]; while ((b % 8) != 0) b++; b /= 8; if (b != FormatTools.getBytesPerPixel(getPixelType()) || bps.length != getRGBChannelCount()) { return super.openThumbBytes(no); } byte[] buf = new byte[getThumbSizeX() * getThumbSizeY() * getRGBChannelCount() * FormatTools.getBytesPerPixel(getPixelType())]; return tiffParser.getSamples(thumbnailIFDs.get(no), buf); }