Back to Aurora Vision Library Lite website

You are here: Start » Geometry 2D » Geometry 2D Constructions » CreateCoordinateSystemFromRectangle

CreateCoordinateSystemFromRectangle


Header: AVL.h
Namespace: avl

Creates a coordinate system from a rectangle.

Applications: Most often used to define an object alignment from a filter like RegionBoundingRectangle.

Syntax

void avl::CreateCoordinateSystemFromRectangle
(
	const avl::Rectangle2D& inRectangle,
	const avl::Anchor2D::Type inPointAnchor,
	float inRelativeAngle,
	float inScale,
	float inScaleDivisor,
	avl::CoordinateSystem2D& outCoordinateSystem
)

Parameters

Name Type Range Default Description
Input value inRectangle const Rectangle2D&
Input value inPointAnchor const Anchor2D::Type TopLeft
Input value inRelativeAngle float
Input value inScale float 0.001 - 1.0f
Input value inScaleDivisor float 0.001 - 1.0f
Output value outCoordinateSystem CoordinateSystem2D&

Hints

  • Pass inRectangle to a computed rectangle representing a new coordinate system.
  • Optionally set inScale and inScaleDivisor to obtain a custom scale.
  • Optionally set inRelativeAngle to modify the rotation.

Examples

A local coordinate system created from a rectangle.