package timedistortion;

public class PixelData {
	private byte[] rgb;

	public PixelData(int size, int[] argbArray) {
		rgb = new byte[size];
		for(int di=0; di<size; ++di) {
			rgb[di] = (byte) argbArray[di];
		}
	}

	public static float unsigned(byte b) {
		return b >= 0 ? b : 256+b;
	}

	public byte at(int pi) {
		if(pi < 0)
			return rgb[0];
		if(pi > rgb.length-3)
			return rgb[rgb.length-3];
		return rgb[pi];
	}
}
