MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getCode

Method getCode

ij/src/main/java/ij/io/FileInfo.java:222–244  ·  view source on GitHub ↗

Returns JavaScript code that can be used to recreate this FileInfo.

()

Source from the content-addressed store, hash-verified

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) {

Callers 3

openImageMethod · 0.95
installMethod · 0.45
openAllMethod · 0.45

Calls 1

getOffsetMethod · 0.95

Tested by

no test coverage detected