Returns JavaScript code that can be used to recreate this FileInfo.
()
| 220 | |
| 221 | /** Returns JavaScript code that can be used to recreate this FileInfo. */ |
| 222 | public String getCode() { |
| 223 | String code = "fi = new FileInfo();\n"; |
| 224 | String type = null; |
| 225 | if (fileType==GRAY8) |
| 226 | type = "GRAY8"; |
| 227 | else if (fileType==GRAY16_UNSIGNED) |
| 228 | type = "GRAY16_UNSIGNED"; |
| 229 | else if (fileType==GRAY32_FLOAT) |
| 230 | type = "GRAY32_FLOAT"; |
| 231 | else if (fileType==RGB) |
| 232 | type = "RGB"; |
| 233 | if (type!=null) |
| 234 | code += "fi.fileType = FileInfo."+type+";\n"; |
| 235 | code += "fi.width = "+width+";\n"; |
| 236 | code += "fi.height = "+height+";\n"; |
| 237 | if (nImages>1) |
| 238 | code += "fi.nImages = "+nImages+";\n"; |
| 239 | if (getOffset()>0) |
| 240 | code += "fi.longOffset = "+getOffset()+";\n"; |
| 241 | if (intelByteOrder) |
| 242 | code += "fi.intelByteOrder = true;\n"; |
| 243 | return code; |
| 244 | } |
| 245 | |
| 246 | private String getType() { |
| 247 | switch (fileType) { |