[PR #4967] til::bitmap #26065

Open
opened 2026-01-31 09:13:42 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/4967

State: closed
Merged: Yes


Summary of the Pull Request

Introduces type til::bitmap which implements an NxM grid of bits that can be used to track dirty/clean state on a per-cell basis throughout a rectangle.

PR Checklist

  • In support of Differential Rendering #778
  • I work here.
  • Tests added/passed
  • I'm a core contributor.

Detailed Description of the Pull Request / Additional comments

  • Adds const_iterator to til::rectangle that will walk from top to bottom, left to right every position in the rectangle as a til::point and associated test.
  • Adds bool til::rectangle::contains(til::point) to determine if a point lies within the rectangle and the associated test
  • Adds complementary methods to til::rectangle of index_of(til::point) and point_at(ptrdiff_t) which will convert between a valid point position that lies inside the rectangle and the index as a count of cells from the top left corner (origin) in a top to bottom & left to right counting fashion (and associated tests).
  • Adds til::some<T, N>::clear() to empty out the contents of the some and associated test.
    THEN with all that support...
  • Adds til::bitmap which represents a 2 dimensional grid of boolean/bit flags. This class contains set and reset methods for the entire region, and set only for a single til::point or a subregion as specified by a til::rectangle (and associated tests.)
  • Adds convenience methods of any(), one(), none(), and all() to the til::bitmap to check some of its state.
  • Adds convenience method of resize() to til::bitmap that will grow or shrink the bitmap, copying whatever is left of the previous one that still fits and optionally filling or blanking the new space.
  • Adds a const_iterator for til::bitmap that will walk top to bottom, left to right and return a til::rectangle representing a run of bits that are all on sequentially in a row. Breaks per row. Exactly as we expect to be drawing things (and associated tests.)

Validation Steps Performed

  • See automated tests of functionality.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/4967 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Introduces type `til::bitmap` which implements an NxM grid of bits that can be used to track dirty/clean state on a per-cell basis throughout a rectangle. ## PR Checklist * [x] In support of Differential Rendering #778 * [X] I work here. * [x] Tests added/passed * [x] I'm a core contributor. ## Detailed Description of the Pull Request / Additional comments - Adds `const_iterator` to `til::rectangle` that will walk from top to bottom, left to right every position in the rectangle as a `til::point` and associated test. - Adds `bool til::rectangle::contains(til::point)` to determine if a point lies within the rectangle and the associated test - Adds complementary methods to `til::rectangle` of `index_of(til::point)` and `point_at(ptrdiff_t)` which will convert between a valid `point` position that lies inside the `rectangle` and the index as a count of cells from the top left corner (origin) in a top to bottom & left to right counting fashion (and associated tests). - Adds `til::some<T, N>::clear()` to empty out the contents of the `some` and associated test. THEN with all that support... - Adds `til::bitmap` which represents a 2 dimensional grid of boolean/bit flags. This class contains set and reset methods for the entire region, and set only for a single `til::point` or a subregion as specified by a `til::rectangle` (and associated tests.) - Adds convenience methods of `any()`, `one()`, `none()`, and `all()` to the `til::bitmap` to check some of its state. - Adds convenience method of `resize()` to `til::bitmap` that will grow or shrink the bitmap, copying whatever is left of the previous one that still fits and optionally filling or blanking the new space. - Adds a `const_iterator` for `til::bitmap` that will walk top to bottom, left to right and return a `til::rectangle` representing a run of bits that are all on sequentially in a row. Breaks per row. Exactly as we expect to be drawing things (and associated tests.) ## Validation Steps Performed - See automated tests of functionality.
claunia added the pull-request label 2026-01-31 09:13:42 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26065