Skip to content
Snippets Groups Projects
Commit 0c09be9f authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Round CR and BPP in inspect to 4 decimal places.

parent e4292e00
No related branches found
No related tags found
No related merge requests found
...@@ -133,10 +133,10 @@ public class ImageDecompressor extends CompressorDecompressorBase { ...@@ -133,10 +133,10 @@ public class ImageDecompressor extends CompressorDecompressorBase {
final long pixelCount = header.getImageDims().multiplyTogether(); final long pixelCount = header.getImageDims().multiplyTogether();
final long uncompressedSize = 2 * pixelCount; // We assert 16 bit (2 byte) pixel. final long uncompressedSize = 2 * pixelCount; // We assert 16 bit (2 byte) pixel.
final double compressionRatio = (double) fileSize / (double) uncompressedSize; final double compressionRatio = (double) fileSize / (double) uncompressedSize;
logBuilder.append(String.format("Compression ratio:\t%.5f\n", compressionRatio)); logBuilder.append(String.format("Compression ratio:\t%.4f\n", compressionRatio));
final double BPP = ((double) fileSize * 8.0) / (double) pixelCount; final double BPP = ((double) fileSize * 8.0) / (double) pixelCount;
logBuilder.append(String.format("Bits Per Pixel (BPP):\t%.5f\n", BPP)); logBuilder.append(String.format("Bits Per Pixel (BPP):\t%.4f\n", BPP));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment