Add new transform types and utility functions #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #67 which adds
IdentityTransform
andCompositeTransform
, as well as various new transform-related QoL features.Identity transforms
New
IdentityTransform
class which doesn't apply any transform to the inputs. Useful for explicitly defining a map between two coordinate spaces that are inherently aligned.Example transform file:
Composite transforms
New
CompositeTransform
class which stores a list of transforms. When applied, each transform in the list is applied in sequence:If the transforms are all composable, the transform can be simplified with the
CompositeTransform::simplify()
member function:Example transform file:
Other changes
Transform3D::Compose()
static member function for composing two composable transforms into a single transform. Alternatively, use the*
operator with two composable transforms:auto res = affine0 * affine1;
Transform3D::composable()
function which returns whether the derived class supports composition. Derived transform classes which are composable should override both this function and the private member functioncompose_()
.Transform3D::clear()
is now derived only in the base class.Transform3D::Serialize
and Transform3D::Deserialize` protected static member functions for storing/restoring a transform to/from metadata.examples/files/
.