You are here: Start » Function Reference » Geometry 2D » Geometry 2D Spatial Transforms » AlignRectangle
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Moves a rectangle from a local coordinate system to the absolute one.
Applications: Required when there is a rectangle defined in a local coordinate system, but the next image-related filter in the program does not have any inAlignment input.
Syntax
void fil::AlignRectangle ( const fil::Rectangle2D& inRectangle, const fil::CoordinateSystem2D& inAlignment, bool inInverse, fil::Rectangle2D& outAlignedRectangle )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inRectangle | const Rectangle2D& | ||
![]() |
inAlignment | const CoordinateSystem2D& | Coordinate system to align to | |
![]() |
inInverse | bool | Switches to the inverse transform | |
![]() |
outAlignedRectangle | Rectangle2D& |
In-place Processing
This function supports in-place data processing - you can pass the same reference to inRectangle and outAlignedRectangle
Read more about In-place Computation.
Description
AlignRectangle aligns the inRectangle to the inAlignment coordinate system. The input rectangle is translated, rotated and scaled.
The inAlignment is usually a coordinate system found by some template matching algorithm.
Examples
![]() |
![]() |
AlignRectangle performed on the sample rectangle. The inAlignment is drawn on the first image in blue.
See Also
- RotateRectangle – Rotates a rectangle clockwise around a center point.
- TranslateRectangle – Translates a rectangle by a vector.
- AlignPath – Moves a path from a local coordinate system to the absolute one.