| 951 | |
| 952 | |
| 953 | void |
| 954 | ImageSpec::from_xml (const char *xml) |
| 955 | { |
| 956 | xml_document doc; |
| 957 | doc.load (xml); |
| 958 | xml_node n = doc.child ("ImageSpec"); |
| 959 | |
| 960 | //int version = n.attribute ("version").as_int(); |
| 961 | |
| 962 | // Fields for version == 10 (current) |
| 963 | x = atoi (n.child_value ("x")); |
| 964 | y = atoi (n.child_value ("y")); |
| 965 | z = atoi (n.child_value ("z")); |
| 966 | width = atoi (n.child_value ("width")); |
| 967 | height = atoi (n.child_value ("height")); |
| 968 | depth = atoi (n.child_value ("depth")); |
| 969 | full_x = atoi (n.child_value ("full_x")); |
| 970 | full_y = atoi (n.child_value ("full_y")); |
| 971 | full_z = atoi (n.child_value ("full_z")); |
| 972 | full_width = atoi (n.child_value ("full_width")); |
| 973 | full_height = atoi (n.child_value ("full_height")); |
| 974 | full_depth = atoi (n.child_value ("full_depth")); |
| 975 | tile_width = atoi (n.child_value ("tile_width")); |
| 976 | tile_height = atoi (n.child_value ("tile_height")); |
| 977 | tile_depth = atoi (n.child_value ("tile_depth")); |
| 978 | format = TypeDesc (n.child_value ("format")); |
| 979 | nchannels = atoi (n.child_value ("nchannels")); |
| 980 | get_channelnames (n, channelnames); |
| 981 | alpha_channel = atoi (n.child_value ("alpha_channel")); |
| 982 | z_channel = atoi (n.child_value ("z_channel")); |
| 983 | deep = atoi (n.child_value ("deep")); |
| 984 | |
| 985 | // FIXME: What about extra attributes? |
| 986 | |
| 987 | // If version == 11 {fill new fields} |
| 988 | } |
| 989 | |
| 990 | |
| 991 | } |
no test coverage detected