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

Method write8BitImage

ij/src/main/java/ij/io/ImageWriter.java:21–33  ·  view source on GitHub ↗
(OutputStream out, byte[] pixels)

Source from the content-addressed store, hash-verified

19 }
20
21 void write8BitImage(OutputStream out, byte[] pixels) throws IOException {
22 int bytesWritten = 0;
23 int size = fi.width*fi.height;
24 int count = getCount(size);
25 while (bytesWritten<size) {
26 if ((bytesWritten + count)>size)
27 count = size - bytesWritten;
28 //System.out.println(bytesWritten + " " + count + " " + size);
29 out.write(pixels, bytesWritten, count);
30 bytesWritten += count;
31 showProgress((double)bytesWritten/size);
32 }
33 }
34
35 void write8BitStack(OutputStream out, Object[] stack) throws IOException {
36 showProgressBar = false;

Callers 3

write8BitStackMethod · 0.95
write8BitVirtualStackMethod · 0.95
writeMethod · 0.95

Calls 3

getCountMethod · 0.95
showProgressMethod · 0.95
writeMethod · 0.65

Tested by

no test coverage detected