X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=imagesqueeze.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fimagesqueeze%2Fcodec%2FChannel.java;h=edcd55b5136937c7862aaae8c4bdd11cc3925590;hp=a4f01ccf997e3b5d66f440af5d797ffce6871f3c;hb=4595d6b97aff8e6d9dcce902bc2f1119d4ab2f0e;hpb=4bcffe8896c08c9f60b2707da71bb39a64618d93 diff --git a/src/main/java/eu/svjatoslav/imagesqueeze/codec/Channel.java b/src/main/java/eu/svjatoslav/imagesqueeze/codec/Channel.java index a4f01cc..edcd55b 100755 --- a/src/main/java/eu/svjatoslav/imagesqueeze/codec/Channel.java +++ b/src/main/java/eu/svjatoslav/imagesqueeze/codec/Channel.java @@ -1,61 +1,60 @@ /* - * Imagesqueeze - Image codec optimized for photos. - * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Imagesqueeze - Image codec. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. + * modify it under the terms of version 3 of the GNU Lesser General Public License + * or later as published by the Free Software Foundation. */ package eu.svjatoslav.imagesqueeze.codec; -public class Channel { +class Channel { - byte[] rangeMap; - byte[] map; + final byte[] rangeMap; + final byte[] map; - byte[] decodedRangeMap; - byte[] decodedMap; + final byte[] decodedRangeMap; + final byte[] decodedMap; - int bitCount; + int bitCount; - public Channel(final int width, final int height) { - rangeMap = new byte[width * height]; + public Channel(final int width, final int height) { + rangeMap = new byte[width * height]; - map = new byte[width * height]; + map = new byte[width * height]; - decodedRangeMap = new byte[width * height]; - decodedRangeMap[0] = (byte) 255; + decodedRangeMap = new byte[width * height]; + decodedRangeMap[0] = (byte) 255; - decodedMap = new byte[width * height]; - }; + decodedMap = new byte[width * height]; + } - public void printStatistics() { - final float bitsPerPixel = (float) bitCount / (float) rangeMap.length; - System.out.println((bitCount / 8) + " bytes. " + bitsPerPixel - + " bits per pixel."); - } + public void printStatistics() { + final float bitsPerPixel = (float) bitCount / (float) rangeMap.length; + System.out.println((bitCount / 8) + " bytes. " + bitsPerPixel + + " bits per pixel."); + } - public void reset() { + public void reset() { - for (int i = 0; i < decodedMap.length; i++) { - decodedMap[i] = 0; - } + for (int i = 0; i < decodedMap.length; i++) { + decodedMap[i] = 0; + } - for (int i = 0; i < decodedRangeMap.length; i++) { - decodedRangeMap[i] = 0; - } - decodedRangeMap[0] = (byte) 255; + for (int i = 0; i < decodedRangeMap.length; i++) { + decodedRangeMap[i] = 0; + } + decodedRangeMap[0] = (byte) 255; - for (int i = 0; i < map.length; i++) { - map[i] = 0; - } + for (int i = 0; i < map.length; i++) { + map[i] = 0; + } - for (int i = 0; i < rangeMap.length; i++) { - rangeMap[i] = 0; - } + for (int i = 0; i < rangeMap.length; i++) { + rangeMap[i] = 0; + } - bitCount = 0; - } + bitCount = 0; + } }