// Path: src/com/ezio/multiwii/helpers/LowPassFilter.java
// public class LowPassFilter {
// 	/*
// 	 * time smoothing constant for low-pass filter 0 ≤ alpha ≤ 1 ; a smaller
// 	 * value basically means more smoothing See: http://en.wikipedia.org/wiki
// 	 * /Low-pass_filter#Discrete-time_realization
// 	 */
// 	float ALPHA = 0f;
// 	float lastOutput = 0;
// 
// 	public LowPassFilter(float ALPHA) {
// 		this.ALPHA = ALPHA;
// 	}
// 
// 	public float lowPass(float input) {
// 		if (Math.abs(input - lastOutput) > 170) {
// 			lastOutput = input;
// 			return lastOutput;
// 		}
// 		lastOutput = lastOutput + ALPHA * (input - lastOutput);
// 		return lastOutput;
// 	}
// }


import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import com.ezio.multiwii.R;
import com.ezio.multiwii.helpers.LowPassFilter;
			// Must be this size
			width = widthSize;
		} else if (widthMode == MeasureSpec.AT_MOST) {
			// Can't be bigger than...
			width = Math.min(desiredWidth, widthSize);
		} else {
			// Be whatever you want
			width = desiredWidth;
		}

		// Measure Height
		if (heightMode == MeasureSpec.EXACTLY) {
			// Must be this size
			height = heightSize;
		} else if (heightMode == MeasureSpec.AT_MOST) {
			// Can't be bigger than...
			height = Math.min(desiredHeight, heightSize);
		} else {
			// Be whatever you want
			height = desiredHeight;
		}

		// MUST CALL THIS
		setMeasuredDimension(width, height);

	}

	// Scale and keep aspect ratio
	static public Bitmap scaleToFill(Bitmap b, int width, int height) {
		float factorH = height / (float) b.getWidth();
// Path: src/com/ezio/multiwii/helpers/LowPassFilter.java
// public class LowPassFilter {
// 	/*
// 	 * time smoothing constant for low-pass filter 0 ≤ alpha ≤ 1 ; a smaller
// 	 * value basically means more smoothing See: http://en.wikipedia.org/wiki
// 	 * /Low-pass_filter#Discrete-time_realization
// 	 */
// 	float ALPHA = 0f;
// 	float lastOutput = 0;
// 
// 	public LowPassFilter(float ALPHA) {
// 		this.ALPHA = ALPHA;
// 	}
// 
// 	public float lowPass(float input) {
// 		if (Math.abs(input - lastOutput) > 170) {
// 			lastOutput = input;
// 			return lastOutput;
// 		}
// 		lastOutput = lastOutput + ALPHA * (input - lastOutput);
// 		return lastOutput;
// 	}
// }


// Path: src/com/ezio/multiwii/dashboard/dashboard3/AltitudeView.java
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import com.ezio.multiwii.R;
import com.ezio.multiwii.helpers.LowPassFilter;

			// Must be this size
			width = widthSize;
		} else if (widthMode == MeasureSpec.AT_MOST) {
			// Can't be bigger than...
			width = Math.min(desiredWidth, widthSize);
		} else {
			// Be whatever you want
			width = desiredWidth;
		}

		// Measure Height
		if (heightMode == MeasureSpec.EXACTLY) {
			// Must be this size
			height = heightSize;
		} else if (heightMode == MeasureSpec.AT_MOST) {
			// Can't be bigger than...
			height = Math.min(desiredHeight, heightSize);
		} else {
			// Be whatever you want
			height = desiredHeight;
		}

		// MUST CALL THIS
		setMeasuredDimension(width, height);

	}

	// Scale and keep aspect ratio
	static public Bitmap scaleToFill(Bitmap b, int width, int height) {
		float factorH = height / (float) b.getWidth();
		float factorW = width / (float) b.getWidth();