private Image load(InputStream in, boolean needYFlip) throws IOException{ Format format = null; String fmtStr = readString(in); if (fmtStr.equals("PF")){ format = Format.RGB32F; String sizeStr = readString(in); int spaceIdx = sizeStr.indexOf(" "); if (spaceIdx <= 0 || spaceIdx >= sizeStr.length() - 1) throw new IOException("Invalid size specified in PFM file"); String scaleStr = readString(in); float scale = Float.parseFloat(scaleStr); ByteOrder order = scale < 0 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN; flipScanline(scanline);
public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); InputStream in = null; try { in = info.openStream(); return load(in, ((TextureKey)info.getKey()).isFlipY()); } finally { if (in != null){ in.close(); } } }
private Image load(InputStream in, boolean needYFlip) throws IOException{ Format format = null; String fmtStr = readString(in); if (fmtStr.equals("PF")){ format = Format.RGB32F; String sizeStr = readString(in); int spaceIdx = sizeStr.indexOf(" "); if (spaceIdx <= 0 || spaceIdx >= sizeStr.length() - 1) throw new IOException("Invalid size specified in PFM file"); String scaleStr = readString(in); float scale = Float.parseFloat(scaleStr); ByteOrder order = scale < 0 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN; flipScanline(scanline);
public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); InputStream in = null; try { in = info.openStream(); return load(in, ((TextureKey)info.getKey()).isFlipY()); } finally { if (in != null){ in.close(); } } }
private Image load(InputStream in, boolean needYFlip) throws IOException{ Format format = null; String fmtStr = readString(in); if (fmtStr.equals("PF")){ format = Format.RGB32F; String sizeStr = readString(in); int spaceIdx = sizeStr.indexOf(" "); if (spaceIdx <= 0 || spaceIdx >= sizeStr.length() - 1) throw new IOException("Invalid size specified in PFM file"); String scaleStr = readString(in); float scale = Float.parseFloat(scaleStr); ByteOrder order = scale < 0 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN; flipScanline(scanline);
public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); InputStream in = null; try { in = info.openStream(); return load(in, ((TextureKey)info.getKey()).isFlipY()); } finally { if (in != null){ in.close(); } } }