def get_bbox_transform(boxin, boxout): """ return the transform that maps transform one bounding box to another """ return SeparableTransformation(boxin, boxout, Func(IDENTITY), Func(IDENTITY))
def identity_transform(): """ Get an affine transformation that maps x,y -> x,y """ return SeparableTransformation(unit_bbox(), unit_bbox(), Func(IDENTITY), Func(IDENTITY))
def scale_sep_transform(sx, sy): """ Return a pure scale transformation as a SeparableTransformation; sx and sy are LazyValue instances (Values or binary opertations on values) """ bboxin = unit_bbox() bboxout = Bbox(Point(zero(), zero()), Point(sx, sy)) return SeparableTransformation(bboxin, bboxout, Func(IDENTITY), Func(IDENTITY))
def identity_funcxy(): """ Get funcxy instance that maps x,y -> x,y """ return FuncXY(Func(IDENTITY), Func(IDENTITY))