Moved bit input and output streams into Svjatoslav Commons library.
[imagesqueeze.git] / src / main / java / eu / svjatoslav / imagesqueeze / codec / ColorStats.java
index b856fe5..8d206cf 100755 (executable)
@@ -1,3 +1,12 @@
+/*
+ * Imagesqueeze - Image codec optimized for photos.
+ * Copyright (C) 2012, 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.
+ */
+
 package eu.svjatoslav.imagesqueeze.codec;
 
 public class ColorStats {
@@ -5,33 +14,30 @@ public class ColorStats {
        int ySum;
        int uSum;
        int vSum;
-       
+
        int pixelCount;
-       
-       
-       public ColorStats(){            
+
+       public ColorStats() {
                reset();
        }
 
-       public void reset(){
-               ySum = 0;
-               uSum = 0;
-               vSum = 0;
-               pixelCount = 0;
-       }
-               
-       public int getAverageY(){
-               return ySum / pixelCount;
+       public int getAverageU() {
+               return uSum / pixelCount;
        }
 
-       public int getAverageU(){
-               return uSum / pixelCount;
+       public int getAverageV() {
+               return vSum / pixelCount;
        }
 
-       public int getAverageV(){
-               return vSum / pixelCount;               
+       public int getAverageY() {
+               return ySum / pixelCount;
        }
-       
-}
 
+       public void reset() {
+               ySum = 0;
+               uSum = 0;
+               vSum = 0;
+               pixelCount = 0;
+       }
 
+}