ported affine transforms