Back to FabImage Library website
You are here: Start » Function Reference » Geometry 2D » Geometry 2D Normalizations » NormalizeRectangleOrientation
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Changes orientation of the given rectangle according to parameters.
Syntax
C++
C#
void fil::NormalizeRectangleOrientation ( const fil::Rectangle2D& inRectangle, const float inReferenceAngle, const fil::RectangleOrientation::Type inRectangleOrientation, fil::Rectangle2D& outRectangle )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inRectangle | const Rectangle2D& | Input rectangle | |
![]() |
inReferenceAngle | const float | 0.0f | The middle angle of the valid range of the output rectangle's angle |
![]() |
inRectangleOrientation | const RectangleOrientation::Type | Horizontal | Orientation of the output rectangle |
![]() |
outRectangle | Rectangle2D& |
In-place Processing
This function supports in-place data processing - you can pass the same reference to inRectangle and outRectangle
Read more about In-place Computation.
Description
The operation changes the input rectangle's marked corner so the output rectangle's rotation angle is the lowest possible not lower than inReferenceAngle - 90 satisfying the inRectangleOrientation parameter at the same time. Some sample parameters configurations are:
- inReferenceAngle = 90, inRectangleOrientation = Any – the marked corner will have the least y coordinate possible
- inReferenceAngle = 0, inRectangleOrientation = Any – the marked corner will have the least x coordinate possible
- inRectangleOrientation = Horizontal – the output rectangle's width will be not shorter than its height
- inRectangleOrientation = Vertical – the output rectangle's height will be not shorter than its width
Examples
![]() |
![]() |
NormalizeRectangleOrientation performed on a sample rectangle with inReferenceAngle = 90 and inRectangleOrientation = Any.