Lines Matching refs:node
111 // Color space types for Chroma->ColorSpaceType node
469 IIOMetadataNode node = null; // scratch node
516 node = new IIOMetadataNode("bKGD_Palette");
517 node.setAttribute("index", Integer.toString(bKGD_index));
519 node = new IIOMetadataNode("bKGD_Grayscale");
520 node.setAttribute("gray", Integer.toString(bKGD_gray));
522 node = new IIOMetadataNode("bKGD_RGB");
523 node.setAttribute("red", Integer.toString(bKGD_red));
524 node.setAttribute("green", Integer.toString(bKGD_green));
525 node.setAttribute("blue", Integer.toString(bKGD_blue));
527 bKGD_node.appendChild(node);
629 node = new IIOMetadataNode("sBIT_Grayscale");
630 node.setAttribute("gray",
633 node = new IIOMetadataNode("sBIT_GrayAlpha");
634 node.setAttribute("gray",
636 node.setAttribute("alpha",
639 node = new IIOMetadataNode("sBIT_RGB");
640 node.setAttribute("red",
642 node.setAttribute("green",
644 node.setAttribute("blue",
647 node = new IIOMetadataNode("sBIT_RGBAlpha");
648 node.setAttribute("red",
650 node.setAttribute("green",
652 node.setAttribute("blue",
654 node.setAttribute("alpha",
657 node = new IIOMetadataNode("sBIT_Palette");
658 node.setAttribute("red",
660 node.setAttribute("green",
662 node.setAttribute("blue",
665 sBIT_node.appendChild(node);
735 node = new IIOMetadataNode("tRNS_Palette");
743 node.appendChild(entry);
746 node = new IIOMetadataNode("tRNS_Grayscale");
747 node.setAttribute("gray", Integer.toString(tRNS_gray));
749 node = new IIOMetadataNode("tRNS_RGB");
750 node.setAttribute("red", Integer.toString(tRNS_red));
751 node.setAttribute("green", Integer.toString(tRNS_green));
752 node.setAttribute("blue", Integer.toString(tRNS_blue));
754 tRNS_node.appendChild(node);
811 IIOMetadataNode node = null; // scratch node
813 node = new IIOMetadataNode("ColorSpaceType");
814 node.setAttribute("name", colorSpaceTypeNames[IHDR_colorType]);
815 chroma_node.appendChild(node);
817 node = new IIOMetadataNode("NumChannels");
818 node.setAttribute("value", Integer.toString(getNumChannels()));
819 chroma_node.appendChild(node);
822 node = new IIOMetadataNode("Gamma");
823 node.setAttribute("value", Float.toString(gAMA_gamma*1.0e-5F));
824 chroma_node.appendChild(node);
827 node = new IIOMetadataNode("BlackIsZero");
828 node.setAttribute("value", "TRUE");
829 chroma_node.appendChild(node);
835 node = new IIOMetadataNode("Palette");
851 node.appendChild(entry);
853 chroma_node.appendChild(node);
858 node = new IIOMetadataNode("BackgroundIndex");
859 node.setAttribute("value", Integer.toString(bKGD_index));
861 node = new IIOMetadataNode("BackgroundColor");
871 node.setAttribute("red", Integer.toString(r));
872 node.setAttribute("green", Integer.toString(g));
873 node.setAttribute("blue", Integer.toString(b));
875 chroma_node.appendChild(node);
883 IIOMetadataNode node = null; // scratch node
885 node = new IIOMetadataNode("CompressionTypeName");
886 node.setAttribute("value", "deflate");
887 compression_node.appendChild(node);
889 node = new IIOMetadataNode("Lossless");
890 node.setAttribute("value", "TRUE");
891 compression_node.appendChild(node);
893 node = new IIOMetadataNode("NumProgressiveScans");
894 node.setAttribute("value",
896 compression_node.appendChild(node);
916 IIOMetadataNode node = null; // scratch node
918 node = new IIOMetadataNode("PlanarConfiguration");
919 node.setAttribute("value", "PixelInterleaved");
920 data_node.appendChild(node);
922 node = new IIOMetadataNode("SampleFormat");
923 node.setAttribute("value",
926 data_node.appendChild(node);
929 node = new IIOMetadataNode("BitsPerSample");
930 node.setAttribute("value", repeat(bitDepth, getNumChannels()));
931 data_node.appendChild(node);
934 node = new IIOMetadataNode("SignificantBitsPerSample");
951 node.setAttribute("value", sbits);
952 data_node.appendChild(node);
962 IIOMetadataNode node = null; // scratch node
964 node = new IIOMetadataNode("PixelAspectRatio");
967 node.setAttribute("value", Float.toString(ratio));
968 dimension_node.appendChild(node);
970 node = new IIOMetadataNode("ImageOrientation");
971 node.setAttribute("value", "Normal");
972 dimension_node.appendChild(node);
975 node = new IIOMetadataNode("HorizontalPixelSize");
976 node.setAttribute("value",
978 dimension_node.appendChild(node);
980 node = new IIOMetadataNode("VerticalPixelSize");
981 node.setAttribute("value",
983 dimension_node.appendChild(node);
995 IIOMetadataNode node = null; // scratch node
997 node = new IIOMetadataNode("ImageModificationTime");
998 node.setAttribute("year", Integer.toString(tIME_year));
999 node.setAttribute("month", Integer.toString(tIME_month));
1000 node.setAttribute("day", Integer.toString(tIME_day));
1001 node.setAttribute("hour", Integer.toString(tIME_hour));
1002 node.setAttribute("minute", Integer.toString(tIME_minute));
1003 node.setAttribute("second", Integer.toString(tIME_second));
1004 document_node.appendChild(node);
1017 IIOMetadataNode node = null; // scratch node
1020 node = new IIOMetadataNode("TextEntry");
1021 node.setAttribute("keyword", (String)tEXt_keyword.get(i));
1022 node.setAttribute("value", (String)tEXt_text.get(i));
1023 node.setAttribute("encoding", "ISO-8859-1");
1024 node.setAttribute("compression", "none");
1026 text_node.appendChild(node);
1030 node = new IIOMetadataNode("TextEntry");
1031 node.setAttribute("keyword", iTXt_keyword.get(i));
1032 node.setAttribute("value", iTXt_text.get(i));
1033 node.setAttribute("language",
1036 node.setAttribute("compression", "zip");
1038 node.setAttribute("compression", "none");
1041 text_node.appendChild(node);
1045 node = new IIOMetadataNode("TextEntry");
1046 node.setAttribute("keyword", (String)zTXt_keyword.get(i));
1047 node.setAttribute("value", (String)zTXt_text.get(i));
1048 node.setAttribute("compression", "zip");
1050 text_node.appendChild(node);
1059 IIOMetadataNode node = null; // scratch node
1061 node = new IIOMetadataNode("Alpha");
1069 node.setAttribute("value", hasAlpha ? "nonpremultipled" : "none");
1070 transparency_node.appendChild(node);
1073 node = new IIOMetadataNode("TransparentColor");
1075 node.setAttribute("value",
1080 node.setAttribute("value", Integer.toString(tRNS_gray));
1082 transparency_node.appendChild(node);
1089 private void fatal(Node node, String reason)
1091 throw new IIOInvalidTreeException(reason, node);
1095 private String getStringAttribute(Node node, String name,
1098 Node attr = node.getAttributes().getNamedItem(name);
1103 fatal(node, "Required attribute " + name + " not present!");
1111 private int getIntAttribute(Node node, String name,
1114 String value = getStringAttribute(node, name, null, required);
1122 private float getFloatAttribute(Node node, String name,
1125 String value = getStringAttribute(node, name, null, required);
1133 private int getIntAttribute(Node node, String name)
1135 return getIntAttribute(node, name, -1, true);
1139 private float getFloatAttribute(Node node, String name)
1141 return getFloatAttribute(node, name, -1.0F, true);
1145 private boolean getBooleanAttribute(Node node, String name,
1149 Node attr = node.getAttributes().getNamedItem(name);
1154 fatal(node, "Required attribute " + name + " not present!");
1164 fatal(node, "Attribute " + name + " must be 'TRUE' or 'FALSE'!");
1170 private boolean getBooleanAttribute(Node node, String name)
1172 return getBooleanAttribute(node, name, false, true);
1176 private int getEnumeratedAttribute(Node node,
1180 Node attr = node.getAttributes().getNamedItem(name);
1185 fatal(node, "Required attribute " + name + " not present!");
1195 fatal(node, "Illegal value for attribute " + name + "!");
1200 private int getEnumeratedAttribute(Node node,
1203 return getEnumeratedAttribute(node, name, legalNames, -1, true);
1207 private String getAttribute(Node node, String name,
1210 Node attr = node.getAttributes().getNamedItem(name);
1215 fatal(node, "Required attribute " + name + " not present!");
1222 private String getAttribute(Node node, String name)
1224 return getAttribute(node, name, null, true);
1247 Node node = root;
1248 if (!node.getNodeName().equals(nativeMetadataFormatName)) {
1249 fatal(node, "Root must be " + nativeMetadataFormatName);
1252 node = node.getFirstChild();
1253 while (node != null) {
1254 String name = node.getNodeName();
1257 IHDR_width = getIntAttribute(node, "width");
1258 IHDR_height = getIntAttribute(node, "height");
1259 IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth",
1261 IHDR_colorType = getEnumeratedAttribute(node, "colorType",
1264 getEnumeratedAttribute(node, "compressionMethod",
1267 getEnumeratedAttribute(node,
1271 getEnumeratedAttribute(node, "interlaceMethod",
1280 Node PLTE_entry = node.getFirstChild();
1282 fatal(node, "Palette has no entries!");
1287 fatal(node,
1293 fatal(node,
1319 Node bKGD_node = node.getFirstChild();
1321 fatal(node, "bKGD node has no children!");
1336 fatal(node, "Bad child of a bKGD node!");
1339 fatal(node, "bKGD node has more than one child!");
1344 cHRM_whitePointX = getIntAttribute(node, "whitePointX");
1345 cHRM_whitePointY = getIntAttribute(node, "whitePointY");
1346 cHRM_redX = getIntAttribute(node, "redX");
1347 cHRM_redY = getIntAttribute(node, "redY");
1348 cHRM_greenX = getIntAttribute(node, "greenX");
1349 cHRM_greenY = getIntAttribute(node, "greenY");
1350 cHRM_blueX = getIntAttribute(node, "blueX");
1351 cHRM_blueY = getIntAttribute(node, "blueY");
1355 gAMA_gamma = getIntAttribute(node, "value");
1361 Node hIST_entry = node.getFirstChild();
1363 fatal(node, "hIST node has no children!");
1368 fatal(node,
1374 fatal(node,
1392 iCCP_profileName = getAttribute(node, "profileName");
1394 getEnumeratedAttribute(node, "compressionMethod",
1397 ((IIOMetadataNode)node).getUserObject();
1399 fatal(node, "No ICCP profile present in user object!");
1402 fatal(node, "User object not a byte array!");
1410 Node iTXt_node = node.getFirstChild();
1413 fatal(node,
1447 getIntAttribute(node, "pixelsPerUnitXAxis");
1449 getIntAttribute(node, "pixelsPerUnitYAxis");
1451 getEnumeratedAttribute(node, "unitSpecifier",
1457 Node sBIT_node = node.getFirstChild();
1459 fatal(node, "sBIT node has no children!");
1486 fatal(node, "Bad child of an sBIT node!");
1489 fatal(node, "sBIT node has more than one child!");
1494 sPLT_paletteName = getAttribute(node, "name");
1495 sPLT_sampleDepth = getIntAttribute(node, "sampleDepth");
1504 Node sPLT_entry = node.getFirstChild();
1506 fatal(node, "sPLT node has no children!");
1511 fatal(node,
1517 fatal(node,
1549 getEnumeratedAttribute(node, "renderingIntent",
1554 Node tEXt_node = node.getFirstChild();
1557 fatal(node,
1570 tIME_year = getIntAttribute(node, "year");
1571 tIME_month = getIntAttribute(node, "month");
1572 tIME_day = getIntAttribute(node, "day");
1573 tIME_hour = getIntAttribute(node, "hour");
1574 tIME_minute = getIntAttribute(node, "minute");
1575 tIME_second = getIntAttribute(node, "second");
1580 Node tRNS_node = node.getFirstChild();
1582 fatal(node, "tRNS node has no children!");
1591 fatal(node, "tRNS_Palette node has no children!");
1596 fatal(node,
1602 fatal(node,
1629 fatal(node, "Bad child of a tRNS node!");
1632 fatal(node, "tRNS node has more than one child!");
1637 Node zTXt_node = node.getFirstChild();
1640 fatal(node,
1658 Node unknown_node = node.getFirstChild();
1661 fatal(node,
1686 fatal(node, "Unknown child of root node!");
1689 node = node.getNextSibling();
1739 Node node = root;
1740 if (!node.getNodeName()
1742 fatal(node, "Root must be " +
1746 node = node.getFirstChild();
1747 while (node != null) {
1748 String name = node.getNodeName();
1751 Node child = node.getFirstChild();
1813 Node child = node.getFirstChild();
1827 Node child = node.getFirstChild();
1894 Node child = node.getFirstChild();
1940 Node child = node.getFirstChild();
1960 Node child = node.getFirstChild();
1973 // Just ignore this node, PNG requires keywords
1976 // Use a zTXt node
1981 // Use a tEXt node
1986 // Use an iTXt node
1998 // Node child = node.getFirstChild();
2010 // // fatal(node, "Unknown child of root node!");
2013 node = node.getNextSibling();