MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / clampRect

Function clampRect

src/CVTracker.cpp:31–37  ·  view source on GitHub ↗

Clamp a rectangle to image bounds and ensure a minimal size

Source from the content-addressed store, hash-verified

29
30// Clamp a rectangle to image bounds and ensure a minimal size
31static inline void clampRect(cv::Rect2d &r, int width, int height)
32{
33 r.x = std::clamp(r.x, 0.0, double(width - 1));
34 r.y = std::clamp(r.y, 0.0, double(height - 1));
35 r.width = std::clamp(r.width, 1.0, double(width - r.x));
36 r.height = std::clamp(r.height, 1.0, double(height - r.y));
37}
38
39// Constructor
40CVTracker::CVTracker(std::string processInfoJson, ProcessingController &processingController)

Callers 1

initTrackerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected