Skip to content

Improve description of structure Simd::Rectangle - #1009

Merged
ermig1979 merged 1 commit into
devfrom
cursor/improve-rectangle-descriptions-13b7
Sep 23, 2026
Merged

ermig1979 merged 1 commit into
devfrom
cursor/improve-rectangle-descriptions-13b7

Conversation

@ermig1979

Copy link
Copy Markdown
Owner

Summary

Documentation-only update of Simd::Rectangle, written from how the type is used in views, drawing, motion, detection, contours and shift detection.

  • The rectangle is the half-open range [left, right) x [top, bottom) in image coordinates (origin at the top-left, X to the right, Y downward).
  • Rectangle(view.Size()) is the whole image. Floating sides converted to ptrdiff_t round to the nearest integer, halves away from zero.
  • operator |= is the bounding union (a point grows the box by one pixel). operator &= and Intersection clip. operator +=, operator +, operator * and operator / combine or scale the four sides. Shift writes a translation; Shifted returns one.
  • OpenCV cv::Rect stays (x, y, width, height) on conversion.
  • Release notes for 7.2.166 in docs/2026.html record the documentation change.

Code changes are limited to comments in src/Simd/SimdRectangle.hpp and that release-note line. The rectangle implementation is unchanged.

Open in Web Open in Cursor 

Document Simd::Rectangle from real usage in views, drawing, motion,
detection, contours and shift detection: the half-open range
[left, right) x [top, bottom), rounding of floating sides to ptrdiff_t,
and the difference between union, intersection, side addition and shift.

Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
@ermig1979
ermig1979 marked this pull request as ready for review September 23, 2026 10:06
@ermig1979
ermig1979 merged commit a1a8f9d into dev Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants