404 const int x0 = max(xc-
fBoxX, 0);
405 const int y0 = max(yc-
fBoxY, 0);
406 const int x1 = min(xc+
fBoxX,
fW);
407 const int y1 = min(yc+
fBoxY,
fH);
414 const double sqrt2 = sqrt(2.);
416 const int xa = max(xc-(
int)nearbyint(
fBoxX*sqrt2), 0);
417 const int ya = max(yc-(
int)nearbyint(
fBoxY*sqrt2), 0);
418 const int xb = min(xc+(
int)nearbyint(
fBoxX*sqrt2),
fW);
419 const int yb = min(yc+(
int)nearbyint(
fBoxY*sqrt2),
fH);
430 for (
int x=xa; x<xb; x++)
431 for (
int y=ya; y<yb; y++)
433 if (x>=x0 && x<x1 && y>=y0 && y<y1)
436 uint8_t &b =
fImg[y*
fW+x];
447 const double sdev = sqrt(sq-sum*sum);
448 const uint8_t max = sum+
fCut*sdev>254 ? 254 : (uint8_t)(sum+
fCut*sdev);
455 for (
int x=x0; x<x1; x++)
456 for (
int y=y0; y<y1; y++)
458 uint8_t &b =
fImg[y*
fW+x];
468 for (
int x=xa; x<xb; x+=2)
473 for (
int y=ya; y<yb; y+=2)
499 leds.push_back(
Led(mx, my, 0, -2.5*log10((
float)mag)+13.7));
int GetMeanPositionBox(const int x, const int y, const int boxx, const int boxy) const
int GetMeanPosition(const int x, const int y, const int boxx, const int boxy) const