transformAffine

Transform an image by given affine transformation.

Slice!(kind, packs, V*)
transformAffine
(
alias interp = linear
V
TransformMatrix
SliceKind kind
size_t[] packs
)
(
Slice!(kind, packs, V*) slice
,
inout TransformMatrix transform
,
size_t[2] outSize = [0, 0]
)

Parameters

interp

(template parameter) Interpolation function. Default linear.

slice Slice!(kind, packs, V*)

Slice of an image which is transformed.

transform TransformMatrix

2D Transformation matrix (3x3). Its element type must be floating point type, and it can be defined as Slice object, dynamic or static 2D array.

outSize size_t[2]

Output image size - if transformation potentially moves parts of image out of input image bounds, output image can be sized differently to maintain information.

Note: Given transformation is considered to be an affine transformation. If it is not, result is undefined.

Return Value

Type: Slice!(kind, packs, V*)

Transformed image.

Meta