private void writeIHDR() throws IOException { ChunkStream cs = new ChunkStream("IHDR"); cs.writeInt(width); cs.writeInt(height); cs.writeByte((byte) bitDepth); cs.writeByte((byte) colorType); cs.writeByte((byte) 0); cs.writeByte((byte) 0); cs.writeByte(interlace ? (byte) 1 : (byte) 0); cs.writeToStream(dataOutput); cs.close(); }
private void writeSRGB() throws IOException { if (param.isSRGBIntentSet()) { ChunkStream cs = new ChunkStream("sRGB"); int intent = param.getSRGBIntent(); cs.write(intent); cs.writeToStream(dataOutput); cs.close(); } }
private void writeIEND() throws IOException { ChunkStream cs = new ChunkStream("IEND"); cs.writeToStream(dataOutput); cs.close(); }
private void writeIEND() throws IOException { ChunkStream cs = new ChunkStream("IEND"); cs.writeToStream(dataOutput); cs.close(); }
private void writeIHDR() throws IOException { ChunkStream cs = new ChunkStream("IHDR"); cs.writeInt(width); cs.writeInt(height); cs.writeByte((byte) bitDepth); cs.writeByte((byte) colorType); cs.writeByte((byte) 0); cs.writeByte((byte) 0); cs.writeByte(interlace ? (byte) 1 : (byte) 0); cs.writeToStream(dataOutput); cs.close(); }
private void writeICCP() throws IOException { if (param.isICCProfileDataSet()) { ChunkStream cs = new ChunkStream("iCCP"); byte[] ICCProfileData = param.getICCProfileData(); cs.write(ICCProfileData); cs.writeToStream(dataOutput); cs.close(); } }
private void writeSPLT() throws IOException { if (param.isSuggestedPaletteSet()) { ChunkStream cs = new ChunkStream("sPLT"); log.severe("sPLT not supported yet."); cs.writeToStream(dataOutput); cs.close(); } }
private void writePLTE() throws IOException { if (redPalette == null) { return; } ChunkStream cs = new ChunkStream("PLTE"); for (int i = 0; i < redPalette.length; i++) { cs.writeByte(redPalette[i]); cs.writeByte(greenPalette[i]); cs.writeByte(bluePalette[i]); } cs.writeToStream(dataOutput); cs.close(); }
private void writeICCP() throws IOException { if (param.isICCProfileDataSet()) { ChunkStream cs = new ChunkStream("iCCP"); byte[] ICCProfileData = param.getICCProfileData(); cs.write(ICCProfileData); cs.writeToStream(dataOutput); cs.close(); } }
private void writeSPLT() throws IOException { if (param.isSuggestedPaletteSet()) { ChunkStream cs = new ChunkStream("sPLT"); System.out.println("sPLT not supported yet."); cs.writeToStream(dataOutput); cs.close(); } }
private void writePLTE() throws IOException { if (redPalette == null) { return; } ChunkStream cs = new ChunkStream("PLTE"); for (int i = 0; i < redPalette.length; i++) { cs.writeByte(redPalette[i]); cs.writeByte(greenPalette[i]); cs.writeByte(bluePalette[i]); } cs.writeToStream(dataOutput); cs.close(); }
private void writeSRGB() throws IOException { if (param.isSRGBIntentSet()) { ChunkStream cs = new ChunkStream("sRGB"); int intent = param.getSRGBIntent(); cs.write(intent); cs.writeToStream(dataOutput); cs.close(); } }
private void writePHYS() throws IOException { if (param.isPhysicalDimensionSet()) { ChunkStream cs = new ChunkStream("pHYs"); int[] dims = param.getPhysicalDimension(); cs.writeInt(dims[0]); cs.writeInt(dims[1]); cs.writeByte((byte) dims[2]); cs.writeToStream(dataOutput); cs.close(); } }
private void writeTEXT() throws IOException { if (param.isTextSet()) { String[] text = param.getText(); for (int i = 0; i < text.length / 2; i++) { byte[] keyword = text[2 * i].getBytes(); byte[] value = text[2 * i + 1].getBytes(); ChunkStream cs = new ChunkStream("tEXt"); cs.write(keyword, 0, Math.min(keyword.length, 79)); cs.write(0); cs.write(value); cs.writeToStream(dataOutput); cs.close(); } } }
private void writePHYS() throws IOException { if (param.isPhysicalDimensionSet()) { ChunkStream cs = new ChunkStream("pHYs"); int[] dims = param.getPhysicalDimension(); cs.writeInt(dims[0]); cs.writeInt(dims[1]); cs.writeByte((byte) dims[2]); cs.writeToStream(dataOutput); cs.close(); } }
private void writeTEXT() throws IOException { if (param.isTextSet()) { String[] text = param.getText(); for (int i = 0; i < text.length / 2; i++) { byte[] keyword = text[2 * i].getBytes(); byte[] value = text[2 * i + 1].getBytes(); ChunkStream cs = new ChunkStream("tEXt"); cs.write(keyword, 0, Math.min(keyword.length, 79)); cs.write(0); cs.write(value); cs.writeToStream(dataOutput); cs.close(); } } }
private void writeHIST() throws IOException { if (param.isPaletteHistogramSet()) { ChunkStream cs = new ChunkStream("hIST"); int[] hist = param.getPaletteHistogram(); for (int i = 0; i < hist.length; i++) { cs.writeShort(hist[i]); } cs.writeToStream(dataOutput); cs.close(); } }
private void writePrivateChunks() throws IOException { int numChunks = param.getNumPrivateChunks(); for (int i = 0; i < numChunks; i++) { String type = param.getPrivateChunkType(i); byte[] data = param.getPrivateChunkData(i); ChunkStream cs = new ChunkStream(type); cs.write(data); cs.writeToStream(dataOutput); cs.close(); } }
private void writeHIST() throws IOException { if (param.isPaletteHistogramSet()) { ChunkStream cs = new ChunkStream("hIST"); int[] hist = param.getPaletteHistogram(); for (int i = 0; i < hist.length; i++) { cs.writeShort(hist[i]); } cs.writeToStream(dataOutput); cs.close(); } }
private void writePrivateChunks() throws IOException { int numChunks = param.getNumPrivateChunks(); for (int i = 0; i < numChunks; i++) { String type = param.getPrivateChunkType(i); byte[] data = param.getPrivateChunkData(i); ChunkStream cs = new ChunkStream(type); cs.write(data); cs.writeToStream(dataOutput); cs.close(); } }