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

CropRegionToQuadrangle
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Creates a region from a quadrangular fragment of another one. The quadrangle must be convex.
Syntax
C++
C#
void fil::CropRegionToQuadrangle ( const fil::Region& inRegion, const fil::Path& inQuadrangle, ftl::Optional<const fil::Size&> inOutputSize, ftl::Optional<const fil::CoordinateSystem2D&> inQuadrangleAlignment, fil::Region& outRegion, ftl::Optional<fil::Path&> outAlignedShape = ftl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inRegion | const Region& | Input region | |
![]() |
inQuadrangle | const Path& | A convex quadrangle defining a region to be cropped (points must be clockwise) | |
![]() |
inOutputSize | Optional<const Size&> | NIL | Width and height of the output region |
![]() |
inQuadrangleAlignment | Optional<const CoordinateSystem2D&> | NIL | Adjusts the quadrangle to the position of the inspected object |
![]() |
outRegion | Region& | Output region | |
![]() |
outAlignedShape | Optional<Path&> | NIL | The input quadrangle after transformation (in the region coordinates) |
In-place Processing
This function supports in-place data processing - you can pass the same reference to inRegion and outRegion
Read more about In-place Computation.
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outAlignedShape.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Path given as an argument to CropRegionToQuadrangle is not closed. |
DomainError | Path given as an argument to CropRegionToQuadrangle should have exactly 4 points. |