?? chunk_pcal.java
字號:
// Copyright (C) 1998, 1999, 2001 Chris Nokleberg// Please see included LICENSE.TXTpackage com.sixlegs.image.png;import java.io.IOException;final class Chunk_pCALextends Chunk{ Chunk_pCAL() { super(pCAL); } protected boolean multipleOK() { return false; } protected boolean beforeIDAT() { return true; } protected void readData() throws IOException { String purpose, unit_string; if ((purpose = in_data.readString()).length() > 79) { throw new PngExceptionSoft("pCAL purpose too long"); } purpose = KeyValueChunk.repairKey(purpose); int X0 = in_data.readInt(); int X1 = in_data.readInt(); if (X1 == X0) { throw new PngExceptionSoft("X1 == X0 in pCAL chunk"); } int equation_type = in_data.readUnsignedByte(); int N = in_data.readUnsignedByte(); if ((unit_string = in_data.readString()).length() > 79) { throw new PngExceptionSoft("pCAL unit string too long"); } double[] P = new double[N]; for (int i = 0; i < N; i++) { P[i] = in_data.readFloatingPoint(); } img.data.properties.put("pixel calibration purpose", purpose); img.data.properties.put("pixel calibration x0", new Integer(X0)); img.data.properties.put("pixel calibration x1", new Integer(X1)); img.data.properties.put("pixel calibration type", new Integer(equation_type)); img.data.properties.put("pixel calibration n", new Integer(N)); img.data.properties.put("pixel calibration unit", unit_string); img.data.properties.put("pixel calibration parameters", P); } }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -