Back to Aurora Vision Library website

You are here: Start » Function Reference » Region » Region Spatial Transforms » RotateRegion

RotateRegion


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Rotates a region around a specified point.

Syntax

C++
C#
 
void avl::RotateRegion
(
	const avl::Region& inRegion,
	atl::Optional<const avl::Point2D&> inCenter,
	float inAngle,
	const bool inInverse,
	avl::RotationSizeMode::Type inSizeMode,
	atl::Optional<int> inFrameWidth,
	atl::Optional<int> inFrameHeight,
	avl::Region& outRegion,
	atl::Optional<avl::CoordinateSystem2D&> outOutputAlignment = atl::NIL
)

Parameters

Name Type Range Default Description
Input value inRegion const Region& Input region
Input value inCenter Optional<const Point2D&> NIL Center of rotation
Input value inAngle float Clockwise rotation angle
Input value inInverse const bool Switches to counter-clockwise rotation
Input value inSizeMode RotationSizeMode::Type Preserve Determines whether to extent the region size to fit the rotated region.
Input value inFrameWidth Optional<int> 0 - 65535 NIL Output region frame width, ignored when inSizeMode is set to RotationSizeMode::Fit.
Input value inFrameHeight Optional<int> 0 - 65535 NIL Output region frame height, ignored when inSizeMode is set to RotationSizeMode::Fit.
Output value outRegion Region& Output region
Output value outOutputAlignment Optional<CoordinateSystem2D&> NIL Alignment of the output region

Optional Outputs

The computation of following outputs can be switched off by passing value atl::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.