MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / insidebbox

Function insidebbox

Engine/CoonsRegularization.cpp:1238–1257  ·  view source on GitHub ↗

Returns true if the point z lies in or on the bounding box of a,b,c, and d.

Source from the content-addressed store, hash-verified

1236// Returns true if the point z lies in or on the bounding box
1237// of a,b,c, and d.
1238static bool
1239insidebbox(const Point& a,
1240 const Point& b,
1241 const Point& c,
1242 const Point& d,
1243 const Point& z)
1244{
1245 RectD bbox;
1246
1247 bbox.x1 = std::numeric_limits<double>::infinity();
1248 bbox.x2 = -std::numeric_limits<double>::infinity();
1249 bbox.y1 = std::numeric_limits<double>::infinity();
1250 bbox.y2 = -std::numeric_limits<double>::infinity();
1251 bbox.merge( RectD(a.x, a.y, a.x, a.y) );
1252 bbox.merge( RectD(b.x, b.y, b.x, b.y) );
1253 bbox.merge( RectD(c.x, c.y, c.x, c.y) );
1254 bbox.merge( RectD(d.x, d.y, d.x, d.y) );
1255
1256 return bbox.contains(z.x, z.y);
1257}
1258
1259inline static
1260bool

Callers 1

checkCurveFunction · 0.85

Calls 3

RectDClass · 0.70
mergeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected