package transformer;

import timedistortion.PixelData;
import timedistortion.Point;
import timedistortion.ITransform;

public class HalfReverse extends AbstractTransformer implements ITransform {
	@Override
	public void t(Point p) {
		int in2d_index = 3 * (p.dy * ictx.width + p.dx);
		PixelData pd0 = ictx.at(p.dy % 2 == 0 ? p.ti : ictx.len - p.ti - 1);
		p.r = PixelData.unsigned(pd0.at(in2d_index));
		p.g = PixelData.unsigned(pd0.at(in2d_index + 1));
		p.b = PixelData.unsigned(pd0.at(in2d_index + 2));
	}

}
