@Override public byte[][] get8BitLookupTable() { if (FormatTools.getBytesPerPixel(getPixelType()) != 1 || !isIndexed() || lastChannel < 0 || lastChannel >= colors.length) { return null; } int color = colors[lastChannel]; if (color == 0) return null; byte[][] lut = new byte[3][256]; int redMax = color & 0xff; int greenMax = (color & 0xff00) >> 8; int blueMax = (color & 0xff0000) >> 16; for (int i=0; i<256; i++) { double scale = i / 255.0; lut[0][i] = (byte) (redMax * scale); lut[1][i] = (byte) (greenMax * scale); lut[2][i] = (byte) (blueMax * scale); } return lut; }
@Override public byte[][] get8BitLookupTable() { if (FormatTools.getBytesPerPixel(getPixelType()) != 1 || !isIndexed() || lastChannel < 0 || lastChannel >= colors.length) { return null; } int color = colors[lastChannel]; if (color == 0) return null; byte[][] lut = new byte[3][256]; int redMax = color & 0xff; int greenMax = (color & 0xff00) >> 8; int blueMax = (color & 0xff0000) >> 16; for (int i=0; i<256; i++) { double scale = i / 255.0; lut[0][i] = (byte) (redMax * scale); lut[1][i] = (byte) (greenMax * scale); lut[2][i] = (byte) (blueMax * scale); } return lut; }
@Override public short[][] get16BitLookupTable() { if (FormatTools.getBytesPerPixel(getPixelType()) != 2 || !isIndexed() || lastChannel < 0 || lastChannel >= colors.length) { return null; } int color = colors[lastChannel]; if (color == 0) return null; short[][] lut = new short[3][65536]; int redMax = color & 0xff; int greenMax = (color & 0xff00) >> 8; int blueMax = (color & 0xff0000) >> 16; for (int i=0; i<65536; i++) { // *Max values are from 0-255; we want LUT values from 0-65535 double scale = i / 255.0; lut[0][i] = (short) (redMax * scale); lut[1][i] = (short) (greenMax * scale); lut[2][i] = (short) (blueMax * scale); } return lut; }
@Override public short[][] get16BitLookupTable() { if (FormatTools.getBytesPerPixel(getPixelType()) != 2 || !isIndexed() || lastChannel < 0 || lastChannel >= colors.length) { return null; } int color = colors[lastChannel]; if (color == 0) return null; short[][] lut = new short[3][65536]; int redMax = color & 0xff; int greenMax = (color & 0xff00) >> 8; int blueMax = (color & 0xff0000) >> 16; for (int i=0; i<65536; i++) { // *Max values are from 0-255; we want LUT values from 0-65535 double scale = i / 255.0; lut[0][i] = (short) (redMax * scale); lut[1][i] = (short) (greenMax * scale); lut[2][i] = (short) (blueMax * scale); } return lut; }
getPixelType() == FormatTools.INT8) FormatTools.getBytesPerPixel(getPixelType()); FormatTools.getBytesPerPixel(getPixelType()); core.get(0, 0).sizeC = 3; core.get(0, 0).rgb = true; if (getPixelType() == FormatTools.INT8) { core.get(0, 0).pixelType = availableBytes > planeSize * 5 ? FormatTools.UINT16 : FormatTools.UINT8; getSizeC() > 3) && getPixelType() == FormatTools.INT8) else if (getSizeC() == 2 && getPixelType() == FormatTools.INT8 && availableBytes >= planeSize * 2) else if (getPixelType() == FormatTools.INT8) { core.get(0, 0).pixelType = FormatTools.UINT8; (getSizeC() * FormatTools.getBytesPerPixel(getPixelType()))); core.get(0, 0).sizeY = getSizeX(); int rowSize = getSizeX() * FormatTools.getBytesPerPixel(getPixelType()) * getSizeC(); long sizeY = availableBytes / rowSize; FormatTools.getBytesPerPixel(getPixelType()))); for (int q=0; q<getSeriesCount(); q++) {
getPixelType() == FormatTools.INT8) FormatTools.getBytesPerPixel(getPixelType()); FormatTools.getBytesPerPixel(getPixelType()); core.get(0, 0).sizeC = 3; core.get(0, 0).rgb = true; if (getPixelType() == FormatTools.INT8) { core.get(0, 0).pixelType = availableBytes > planeSize * 5 ? FormatTools.UINT16 : FormatTools.UINT8; getSizeC() > 3) && getPixelType() == FormatTools.INT8) else if (getSizeC() == 2 && getPixelType() == FormatTools.INT8 && availableBytes >= planeSize * 2) else if (getPixelType() == FormatTools.INT8) { core.get(0, 0).pixelType = FormatTools.UINT8; (getSizeC() * FormatTools.getBytesPerPixel(getPixelType()))); core.get(0, 0).sizeY = getSizeX(); int rowSize = getSizeX() * FormatTools.getBytesPerPixel(getPixelType()) * getSizeC(); long sizeY = availableBytes / rowSize; FormatTools.getBytesPerPixel(getPixelType()))); for (int q=0; q<getSeriesCount(); q++) {
in.seek(offsets[getSeries()][planeIndex]); int bpp = FormatTools.getBytesPerPixel(getPixelType()); int pixel = bpp * getRGBChannelCount(); if (split) pixel *= getSizeC();
in.seek(offsets[getSeries()][planeIndex]); int bpp = FormatTools.getBytesPerPixel(getPixelType()); int pixel = bpp * getRGBChannelCount(); if (split) pixel *= getSizeC();