2 * Imagesqueeze - Image codec. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public License
6 * or later as published by the Free Software Foundation.
9 package eu.svjatoslav.imagesqueeze.codec;
13 final byte[] rangeMap;
16 final byte[] decodedRangeMap;
17 final byte[] decodedMap;
21 public Channel(final int width, final int height) {
22 rangeMap = new byte[width * height];
24 map = new byte[width * height];
26 decodedRangeMap = new byte[width * height];
27 decodedRangeMap[0] = (byte) 255;
29 decodedMap = new byte[width * height];
32 public void printStatistics() {
33 final float bitsPerPixel = (float) bitCount / (float) rangeMap.length;
34 System.out.println((bitCount / 8) + " bytes. " + bitsPerPixel
35 + " bits per pixel.");
40 for (int i = 0; i < decodedMap.length; i++) {
44 for (int i = 0; i < decodedRangeMap.length; i++) {
45 decodedRangeMap[i] = 0;
47 decodedRangeMap[0] = (byte) 255;
49 for (int i = 0; i < map.length; i++) {
53 for (int i = 0; i < rangeMap.length; i++) {