1865 int numEntries = maxindex + 1;
1866 PLTE_red = new byte[numEntries];
1867 PLTE_green = new byte[numEntries];
1868 PLTE_blue = new byte[numEntries];
1869 System.arraycopy(red, 0, PLTE_red, 0, numEntries);
1870 System.arraycopy(green, 0, PLTE_green, 0, numEntries);
1871 System.arraycopy(blue, 0, PLTE_blue, 0, numEntries);
1872 PLTE_present = true;
1873 } else if (childName.equals("BackgroundIndex")) {
1874 bKGD_present = true;
1875 bKGD_colorType = PNGImageReader.PNG_COLOR_PALETTE;
1876 bKGD_index = getIntAttribute(child, "value");
1877 } else if (childName.equals("BackgroundColor")) {
1878 int red = getIntAttribute(child, "red");
1879 int green = getIntAttribute(child, "green");
1880 int blue = getIntAttribute(child, "blue");
1881 if (red == green && red == blue) {
1882 bKGD_colorType = PNGImageReader.PNG_COLOR_GRAY;
1883 bKGD_gray = red;
1884 } else {
1885 bKGD_red = red;
1886 bKGD_green = green;
1887 bKGD_blue = blue;
1888 }
1889 bKGD_present = true;
1890 }
1891 // } else if (childName.equals("ColorSpaceType")) {
1892 // } else if (childName.equals("NumChannels")) {
1893
1894 child = child.getNextSibling();
1895 }
1896 } else if (name.equals("Compression")) {
1897 Node child = node.getFirstChild();
1898 while (child != null) {
1899 String childName = child.getNodeName();
1900 if (childName.equals("NumProgressiveScans")) {
1901 // Use Adam7 if NumProgressiveScans > 1
1902 int scans = getIntAttribute(child, "value");
1903 IHDR_interlaceMethod = (scans > 1) ? 1 : 0;
1904 // } else if (childName.equals("CompressionTypeName")) {
|
1865 int numEntries = maxindex + 1;
1866 PLTE_red = new byte[numEntries];
1867 PLTE_green = new byte[numEntries];
1868 PLTE_blue = new byte[numEntries];
1869 System.arraycopy(red, 0, PLTE_red, 0, numEntries);
1870 System.arraycopy(green, 0, PLTE_green, 0, numEntries);
1871 System.arraycopy(blue, 0, PLTE_blue, 0, numEntries);
1872 PLTE_present = true;
1873 } else if (childName.equals("BackgroundIndex")) {
1874 bKGD_present = true;
1875 bKGD_colorType = PNGImageReader.PNG_COLOR_PALETTE;
1876 bKGD_index = getIntAttribute(child, "value");
1877 } else if (childName.equals("BackgroundColor")) {
1878 int red = getIntAttribute(child, "red");
1879 int green = getIntAttribute(child, "green");
1880 int blue = getIntAttribute(child, "blue");
1881 if (red == green && red == blue) {
1882 bKGD_colorType = PNGImageReader.PNG_COLOR_GRAY;
1883 bKGD_gray = red;
1884 } else {
1885 bKGD_colorType = PNGImageReader.PNG_COLOR_RGB;
1886 bKGD_red = red;
1887 bKGD_green = green;
1888 bKGD_blue = blue;
1889 }
1890 bKGD_present = true;
1891 }
1892 // } else if (childName.equals("ColorSpaceType")) {
1893 // } else if (childName.equals("NumChannels")) {
1894
1895 child = child.getNextSibling();
1896 }
1897 } else if (name.equals("Compression")) {
1898 Node child = node.getFirstChild();
1899 while (child != null) {
1900 String childName = child.getNodeName();
1901 if (childName.equals("NumProgressiveScans")) {
1902 // Use Adam7 if NumProgressiveScans > 1
1903 int scans = getIntAttribute(child, "value");
1904 IHDR_interlaceMethod = (scans > 1) ? 1 : 0;
1905 // } else if (childName.equals("CompressionTypeName")) {
|