MCPcopy Create free account
hub / github.com/davisking/dlib / scale_rect

Function scale_rect

dlib/geometry/rectangle.h:646–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644// ----------------------------------------------------------------------------------------
645
646 inline const rectangle scale_rect (
647 const rectangle& rect,
648 double scale
649 )
650 {
651 DLIB_ASSERT(scale > 0, "scale factor must be > 0");
652
653 const long l = std::lround(rect.left()*scale);
654 const long t = std::lround(rect.top()*scale);
655 const long r = std::lround(rect.right()*scale);
656 const long b = std::lround(rect.bottom()*scale);
657 return rectangle(l, t, r, b);
658 }
659
660// ----------------------------------------------------------------------------------------
661

Callers 1

bind_rectanglesFunction · 0.50

Calls 5

rectangleClass · 0.70
leftMethod · 0.45
topMethod · 0.45
rightMethod · 0.45
bottomMethod · 0.45

Tested by

no test coverage detected