Back to FabImage Library Lite websiteYou are here:
Start »
Geometry 2D »
Geometry 2D Spatial Transforms »
RescaleSegment
Header: |
FIL.h
|
Namespace: |
fil |
Lengthens or shortens a segment relatively.
Syntax
void fil::RescaleSegment
(
const fil::Segment2D& inSegment,
ftl::Optional<const fil::Point2D&> inReferencePoint,
float inScale,
bool inInverse,
fil::Segment2D& outSegment
)
Parameters
|
Name |
Type |
Default |
Description |
 |
inSegment |
const Segment2D& |
|
|
 |
inReferencePoint |
Optional<const Point2D&> |
NIL |
The point to which all distances change linearly (the mass center by default) |
 |
inScale |
float |
1.0f |
Scaling factor (negative values invert the segment) |
 |
inInverse |
bool |
|
Switches to the inverse operation |
 |
outSegment |
Segment2D& |
|
|
In-place Processing
This function supports in-place data processing - you can pass the same reference to inSegment and outSegment
Read more about In-place Computation.
Examples
RescaleSegment performed on the sample segment, inReferencePoint = auto, inScale = 2.0 and inInverse = false.
Errors
List of possible exceptions:
Error type |
Description |
DomainError |
Scale cannot be zero in an inverse rescaling of a segment in RescaleSegment. |