Writes the 16 bytes of data required by the XResolution and YResolution tags.
(OutputStream out)
| 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 { |