Back to FabImage Library website
You are here: Start » Function Reference » Region » Region Spatial Transforms » RotateRegion

RotateRegion
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Rotates a region around a specified point.
Syntax
C++
C#
void fil::RotateRegion ( const fil::Region& inRegion, ftl::Optional<const fil::Point2D&> inCenter, float inAngle, const bool inInverse, fil::RotationSizeMode::Type inSizeMode, ftl::Optional<int> inFrameWidth, ftl::Optional<int> inFrameHeight, fil::Region& outRegion, ftl::Optional<fil::CoordinateSystem2D&> outOutputAlignment = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inRegion | const Region& | Input region | ||
![]() |
inCenter | Optional<const Point2D&> | NIL | Center of rotation | |
![]() |
inAngle | float | Clockwise rotation angle | ||
![]() |
inInverse | const bool | Switches to counter-clockwise rotation | ||
![]() |
inSizeMode | RotationSizeMode::Type | Preserve | Determines whether to extent the region size to fit the rotated region. | |
![]() |
inFrameWidth | Optional<int> | 0 - 65535 | NIL | Output region frame width, ignored when inSizeMode is set to RotationSizeMode::Fit. |
![]() |
inFrameHeight | Optional<int> | 0 - 65535 | NIL | Output region frame height, ignored when inSizeMode is set to RotationSizeMode::Fit. |
![]() |
outRegion | Region& | Output region | ||
![]() |
outOutputAlignment | Optional<CoordinateSystem2D&> | NIL | Alignment of the output region |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outOutputAlignment.
Read more about Optional Outputs.
Description
The operation rotates a region by the inAngle degrees around inCenter point. If the inCenter is not provided, the rotation is conducted around the mass center of the region.
Examples
![]() |
![]() |
RotateRegion performed on the sample region with inAngle set to 45.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty region on input when rotation center is Nil in RotateRegion. |
See Also
- TranslateRegion – Translates a region by a given number of pixels along each axis.