public boolean isFloat() { return FormatTools.isFloatingPoint(reader.getPixelType()); }
/** * Converts the given BufferedImage into an image with unsigned pixel data. */ public static BufferedImage makeUnsigned(BufferedImage img) { if (img == null) return null; int pixelType = getPixelType(img); boolean signed = FormatTools.isSigned(pixelType); boolean fp = FormatTools.isFloatingPoint(pixelType); if (!signed || fp) return img; int bpp = FormatTools.getBytesPerPixel(pixelType); byte[][] pix = getPixelBytes(img, false); return makeImage(pix, img.getWidth(), img.getHeight(), bpp, fp, false, false); }
/** * Converts the given BufferedImage into an image with unsigned pixel data. */ public static BufferedImage makeUnsigned(BufferedImage img) { if (img == null) return null; int pixelType = getPixelType(img); boolean signed = FormatTools.isSigned(pixelType); boolean fp = FormatTools.isFloatingPoint(pixelType); if (!signed || fp) return img; int bpp = FormatTools.getBytesPerPixel(pixelType); byte[][] pix = getPixelBytes(img, false); return makeImage(pix, img.getWidth(), img.getHeight(), bpp, fp, false, false); }
/** Returns a subimage of the specified image. */ public static BufferedImage getSubimage(BufferedImage image, boolean littleEndian, int x, int y, int w, int h) { int pixelType = getPixelType(image); byte[][] pix = getPixelBytes(image, littleEndian, x, y, w, h); return makeImage(pix, w, h, FormatTools.getBytesPerPixel(pixelType), FormatTools.isFloatingPoint(pixelType), littleEndian, FormatTools.isSigned(pixelType)); }
/** Returns a subimage of the specified image. */ public static BufferedImage getSubimage(BufferedImage image, boolean littleEndian, int x, int y, int w, int h) { int pixelType = getPixelType(image); byte[][] pix = getPixelBytes(image, littleEndian, x, y, w, h); return makeImage(pix, w, h, FormatTools.getBytesPerPixel(pixelType), FormatTools.isFloatingPoint(pixelType), littleEndian, FormatTools.isSigned(pixelType)); }
boolean floatingPoint = FormatTools.isFloatingPoint(pixelType); Object pix = DataTools.makeDataArray(buf, bpp, floatingPoint, reader.isLittleEndian());
if (FormatTools.isFloatingPoint(bfPixelsType)) { long[] values = FormatTools.defaultMinMax(bfPixelsType); minmax[0] = values[0];
long[] values = FormatTools.defaultMinMax(type); isSigned = FormatTools.isSigned(type); isFloat = FormatTools.isFloatingPoint(type); minimum = values[0]; maximum = values[1];
/** * Determines whether the given reader represents any floating point data. * @param reader the reader to check * @return true if any of the reader's series have a floating point pixel type * @see #isFloatingPoint(int) */ public static boolean isFloatingPoint(IFormatReader reader) { int originalSeries = reader.getSeries(); for (int s=0; s<reader.getSeriesCount(); s++) { reader.setSeries(s); if (isFloatingPoint(reader.getPixelType())) { reader.setSeries(originalSeries); return true; } } reader.setSeries(originalSeries); return false; }
/** * Determines whether the given reader represents any floating point data. * @param reader the reader to check * @return true if any of the reader's series have a floating point pixel type * @see #isFloatingPoint(int) */ public static boolean isFloatingPoint(IFormatReader reader) { int originalSeries = reader.getSeries(); for (int s=0; s<reader.getSeriesCount(); s++) { reader.setSeries(s); if (isFloatingPoint(reader.getPixelType())) { reader.setSeries(originalSeries); return true; } } reader.setSeries(originalSeries); return false; }
BufferedImage thumb = thumbReader.openThumbImage(ndx); if (!FormatTools.isFloatingPoint(thumbReader.getPixelType())) { thumb = AWTImageTools.autoscale(thumb);
BufferedImage thumb = thumbReader.openThumbImage(ndx); if (!FormatTools.isFloatingPoint(thumbReader.getPixelType())) { thumb = AWTImageTools.autoscale(thumb);
FormatTools.isFloatingPoint(type), littleEndian, FormatTools.isSigned(type));
FormatTools.isFloatingPoint(type), littleEndian, FormatTools.isSigned(type));
private byte[] getTile(IFormatReader reader, int resolution, int no, int x, int y, int w, int h) throws FormatException, IOException { if (resolution < reader.getResolutionCount()) { reader.setResolution(resolution); return reader.openBytes(no, x, y, w, h); } reader.setResolution(0); IImageScaler scaler = new SimpleImageScaler(); int scale = (int) Math.pow(pyramidScale, resolution); byte[] tile = reader.openBytes(no, x * scale, y * scale, w * scale, h * scale); int type = reader.getPixelType(); return scaler.downsample(tile, w * scale, h * scale, scale, FormatTools.getBytesPerPixel(type), reader.isLittleEndian(), FormatTools.isFloatingPoint(type), reader.getRGBChannelCount(), reader.isInterleaved()); }
buf, destBytes, FormatTools.isFloatingPoint(getPixelType()), isLittleEndian()); long max = (long) Math.pow(2, destBytes * 8) - 1; for (int i=0; i<Array.getLength(s); i++) {
boolean fp = FormatTools.isFloatingPoint(type); boolean little = false; if (meta.getPixelsBigEndian(series) != null) {
ifd.putIFDValue(IFD.BITS_PER_SAMPLE, bpsArray); if (FormatTools.isFloatingPoint(pixelType)) { ifd.putIFDValue(IFD.SAMPLE_FORMAT, 3);
r = dimensionSwapper = new DimensionSwapper(r); if (options.isAutoscale() || FormatTools.isFloatingPoint(r)) { r = minMaxCalculator = new MinMaxCalculator(r);
r = dimensionSwapper = new DimensionSwapper(r); if (options.isAutoscale() || FormatTools.isFloatingPoint(r)) { r = minMaxCalculator = new MinMaxCalculator(r);