⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chunk_splt.java

📁 Mapserver的一个java客户端,包含两个applet支持地图显示。
💻 JAVA
字号:
// Copyright (C) 1998, 1999, 2001 Chris Nokleberg// Please see included LICENSE.TXTpackage com.sixlegs.image.png;import java.util.Hashtable;import java.io.IOException;final class Chunk_sPLTextends Chunk{    Chunk_sPLT()    {        super(sPLT);    }    protected boolean beforeIDAT()    {        return true;    }        protected void readData()    throws IOException    {        String name;        if ((name = in_data.readString()).length() > 79)            throw new PngExceptionSoft("sPLT palette name too long");        name = KeyValueChunk.repairKey(name);        if (img.data.palettes.containsKey(name))            throw new PngExceptionSoft("Duplicate sPLT names");        int depth = in_data.readUnsignedByte();        int L = length - name.length();        int[][] prop;        if (depth == 8) {            if (L % 6 != 0) badLength();            int n = L / 6;            prop = new int[5][n];            for (int i = 0; i < n; i++) {                prop[0][i] = in_data.readUnsignedByte();                prop[1][i] = in_data.readUnsignedByte();                prop[2][i] = in_data.readUnsignedByte();                prop[3][i] = in_data.readUnsignedByte();                prop[4][i] = in_data.readUnsignedShort();            }        } else if (depth == 16) {            if (L % 10 != 0) badLength();            int n = L / 10;            prop = new int[5][n];            for (int i = 0; i < n; i++) {                prop[0][i] = in_data.readUnsignedShort();                prop[1][i] = in_data.readUnsignedShort();                prop[2][i] = in_data.readUnsignedShort();                prop[3][i] = in_data.readUnsignedShort();                prop[4][i] = in_data.readUnsignedShort();            }        } else {            throw new PngExceptionSoft("Bad sPLT sample depth: " + depth);        }        img.data.palettes.put(name, prop);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -