MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / ShapeMinMax

Function ShapeMinMax

jni/stasm/misc.cpp:353–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void ShapeMinMax( // get min and max ccords in the given shape
354 double& xmin, // out
355 double& xmax, // out
356 double& ymin, // out
357 double& ymax, // out
358 const Shape& shape) // in
359{
360 xmin = FLT_MAX, xmax = -FLT_MAX, ymin = FLT_MAX, ymax = -FLT_MAX;
361 for (int i = 0; i < shape.rows; i++)
362 {
363 double x = shape(i, IX), y = shape(i, IY);
364 if (PointUsed(x, y))
365 {
366 if (x < xmin) xmin = x;
367 if (x > xmax) xmax = x;
368 if (y < ymin) ymin = y;
369 if (y > ymax) ymax = y;
370 }
371 }
372 CV_Assert(xmin < FLT_MAX);
373 CV_Assert(xmin < xmax); // need at least two discrete points in shape
374}
375
376double ShapeWidth(const Shape& shape) // width of shape in pixels
377{

Callers 2

ShapeWidthFunction · 0.85
ShapeHeightFunction · 0.85

Calls 1

PointUsedFunction · 0.85

Tested by

no test coverage detected