public static Rectangle transformRect(AffineTransform af, Rectangle src) {
        Rectangle dest = new Rectangle(0, 0, 0, 0);
        src = absRect(src);
        Point p1 = new Point(src.x, src.y);
        p1 = transformPoint(af, p1);
        dest.x = p1.x;
        dest.y = p1.y;
        dest.width = (int) (src.width * af.getScaleX());
        dest.height = (int) (src.height * af.getScaleY());
        return dest;
    }
Given an arbitrary rectangle, get the rectangle with the given transform.
The result rectangle is positive width and positive height.

@param af  AffineTransform
@param src source rectangle
@return rectangle after transform with positive width and height
plugins/org.jkiss.dbeaver.ui.editors.image/src/org/jkiss/dbeaver/ui/controls/imageview/ImageViewUtil.java