domain/helpers library

Functions

computeSizeWithRatio(Size layout, double r) Size
Returns a desired dimension of layout that respect r aspect ratio
resizeCropToRatio(Size layout, Rect crop, double r) Rect
Returns a new crop Rect that respect r aspect ratio inside a layout and based on an existing crop area
scaleToSize(Size layout, Rect rect) double
Return the scale for rect to fit layout
translateRectIntoBounds(Size layout, Rect rect) Rect
Returns a translated Rect that fit layout size