replacing affine transforms by sequence of flip/flop/rotate operations