Back to FabImage Library Lite websiteYou are here:
Start »
Geometry 2D »
Geometry 2D Spatial Transforms »
RescaleRectangle
Header: |
FIL.h
|
Namespace: |
fil |
Changes the corners and the dimensions of a rectangle.
Syntax
void fil::RescaleRectangle
(
const fil::Rectangle2D& inRectangle,
ftl::Optional<const fil::Point2D&> inReferencePoint,
float inScale,
bool inInverse,
fil::Rectangle2D& outRectangle
)
Parameters
|
Name |
Type |
Default |
Description |
 |
inRectangle |
const Rectangle2D& |
|
|
 |
inReferencePoint |
Optional<const Point2D&> |
NIL |
The point, to which all distance will be changed proportionally |
 |
inScale |
float |
1.0f |
Scaling factor |
 |
inInverse |
bool |
|
Switches to the inverse operation |
 |
outRectangle |
Rectangle2D& |
|
|
In-place Processing
This function supports in-place data processing - you can pass the same reference to inRectangle and outRectangle
Read more about In-place Computation.
Examples
RescaleRectangle performed on the sample rectangle, inReferencePoint = (0.0, 0.0), inScale = 2.0 and inInverse = false.
Errors
List of possible exceptions:
Error type |
Description |
DomainError |
Scale cannot be zero in inverse scaling of rectangle in RescaleRectangle. |