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

Method writeScale

ij/src/main/java/ij/io/TiffEncoder.java:338–348  ·  view source on GitHub ↗

Writes the 16 bytes of data required by the XResolution and YResolution tags.

(OutputStream out)

Source from the content-addressed store, hash-verified

336
337 /** Writes the 16 bytes of data required by the XResolution and YResolution tags. */
338 void writeScale(OutputStream out) throws IOException {
339 double xscale = 1.0/fi.pixelWidth;
340 double yscale = 1.0/fi.pixelHeight;
341 double scale = 1000000.0;
342 if (xscale*scale>Integer.MAX_VALUE||yscale*scale>Integer.MAX_VALUE)
343 scale = (int)(Integer.MAX_VALUE/Math.max(xscale,yscale));
344 writeInt(out, (int)(xscale*scale));
345 writeInt(out, (int)scale);
346 writeInt(out, (int)(yscale*scale));
347 writeInt(out, (int)scale);
348 }
349
350 /** Writes the variable length ImageDescription string. */
351 void writeDescription(OutputStream out) throws IOException {

Callers 1

writeMethod · 0.95

Calls 2

writeIntMethod · 0.95
maxMethod · 0.45

Tested by

no test coverage detected