summaryrefslogtreecommitdiff
path: root/AK/BitmapView.h
AgeCommit message (Collapse)Author
2021-05-19Bitmap: De-duplicate bitmasksLenny Maiorani
Problem: - Bitmasks are duplicated. - Bitmasks are C-style arrays. Solution: - Move bitmasks to BitmapView.h. - Change C-style arrays to be AK::Array for added safety.
2021-05-18BitmapView: Disable mutations of the underlying BitmapLenny Maiorani
Problem: - `BitmapView` permits changing the underlying `Bitmap`. This violates the idea of a "view" since views are simply overlays which can themselves change but do not change the underlying data. Solution: - Migrate all non-`const` member functions to Bitmap.
2021-05-17Revert "BitmapView: Disable mutations of the underlying Bitmap"Andreas Kling
This reverts commit f25209113fcd15df5778938c4accf13c5139d278.
2021-05-17BitmapView: Disable mutations of the underlying BitmapLenny Maiorani
Problem: - `BitmapView` permits changing the underlying `Bitmap`. This violates the idea of a "view" since views are simply overlays which can themselves change but do not change the underlying data. Solution: - Migrate all non-`const` member functions to Bitmap.
2021-05-16AK: Don't read past the end in BitmapView::count_in_range()Andrew Kaster
The current code is factored such that reads to the entirety of the last byte should be dropped. This was relying on the fact that last would be one past the end in that case. Instead of actually reading that byte when it's completely out of bounds of the bitmask, just skip reads that would be invalid. Add more tests to make sure that the behavior is correct for byte aligned reads of byte aligned bitmaps.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-09AK: Add BitmapView::set_range_and_verify_that_all_bits_flip()Andreas Kling
This function sets a range of bits to the same value while also verifying that all bits in the range get flipped in the process.
2021-03-04AK: Add BitmapView class (like StringView but for bitmaps)Andreas Kling
AK::Bitmap is an awkwardly modal class which can either own or wrap the underlying data. To get ourselves out of this unpleasant situation, this patch adds BitmapView to replace the wrapped mode. A BitmapView is simply a { data pointer, bit count } tuple internally and provides all the convenient functionality of a bitmap class.