mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-15 14:02:20 +00:00
LibGfx: Add const overloads of Bitmap::begin() / end()
This commit is contained in:
parent
c421a3d7ce
commit
65d166e570
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/nico
Commit: 65d166e570
Pull-request: https://github.com/SerenityOS/serenity/pull/24212
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 12 additions and 0 deletions
|
@ -147,7 +147,9 @@ public:
|
|||
[[nodiscard]] ARGB32 const* scanline(int physical_y) const;
|
||||
|
||||
[[nodiscard]] ARGB32* begin();
|
||||
[[nodiscard]] ARGB32 const* begin() const;
|
||||
[[nodiscard]] ARGB32* end();
|
||||
[[nodiscard]] ARGB32 const* end() const;
|
||||
[[nodiscard]] size_t data_size() const;
|
||||
|
||||
[[nodiscard]] IntRect rect() const { return { {}, m_size }; }
|
||||
|
@ -277,11 +279,21 @@ ALWAYS_INLINE ARGB32* Bitmap::begin()
|
|||
return scanline(0);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE ARGB32 const* Bitmap::begin() const
|
||||
{
|
||||
return scanline(0);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE ARGB32* Bitmap::end()
|
||||
{
|
||||
return reinterpret_cast<ARGB32*>(reinterpret_cast<u8*>(m_data) + data_size());
|
||||
}
|
||||
|
||||
ALWAYS_INLINE ARGB32 const* Bitmap::end() const
|
||||
{
|
||||
return reinterpret_cast<ARGB32 const*>(reinterpret_cast<u8 const*>(m_data) + data_size());
|
||||
}
|
||||
|
||||
ALWAYS_INLINE size_t Bitmap::data_size() const
|
||||
{
|
||||
return m_size.height() * m_pitch;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue