@@ -126,18 +126,7 @@ class Bitmap : public AtomicRefCounted<Bitmap> {
126126 [[nodiscard]] size_t size_in_bytes () const { return size_in_bytes (m_pitch, height ()); }
127127
128128 [[nodiscard]] Color get_pixel (int physical_x, int physical_y) const ;
129- [[nodiscard]] Color get_pixel (IntPoint physical_position) const
130- {
131- return get_pixel (physical_position.x (), physical_position.y ());
132- }
133-
134- template <StorageFormat>
135- void set_pixel (int physical_x, int physical_y, Color);
136129 void set_pixel (int physical_x, int physical_y, Color);
137- void set_pixel (IntPoint physical_position, Color color)
138- {
139- set_pixel (physical_position.x (), physical_position.y (), color);
140- }
141130
142131 [[nodiscard]] Core::AnonymousBuffer& anonymous_buffer () { return m_buffer; }
143132 [[nodiscard]] Core::AnonymousBuffer const & anonymous_buffer () const { return m_buffer; }
@@ -276,37 +265,18 @@ ALWAYS_INLINE Color Bitmap::get_pixel(int x, int y) const
276265 }
277266}
278267
279- template <StorageFormat storage_format>
280- ALWAYS_INLINE void Bitmap::set_pixel (int x, int y, Color color)
281- {
282- VERIFY (x >= 0 );
283- VERIFY (x < width ());
284-
285- if constexpr (storage_format == StorageFormat::BGRx8888 || storage_format == StorageFormat::BGRA8888) {
286- scanline (y)[x] = color.value ();
287- } else if constexpr (storage_format == StorageFormat::RGBA8888) {
288- scanline (y)[x] = (color.alpha () << 24 ) | (color.blue () << 16 ) | (color.green () << 8 ) | color.red ();
289- } else if constexpr (storage_format == StorageFormat::RGBx8888) {
290- scanline (y)[x] = (color.blue () << 16 ) | (color.green () << 8 ) | color.red ();
291- } else {
292- static_assert (false , " There's a new storage format not in Bitmap::set_pixel" );
293- }
294- }
295-
296268ALWAYS_INLINE void Bitmap::set_pixel (int x, int y, Color color)
297269{
298270 switch (determine_storage_format (m_format)) {
299271 case StorageFormat::BGRx8888:
300- set_pixel<StorageFormat::BGRx8888>(x, y, color);
301- return ;
302272 case StorageFormat::BGRA8888:
303- set_pixel<StorageFormat::BGRA8888>(x, y, color);
273+ scanline (y)[x] = color. value ( );
304274 return ;
305275 case StorageFormat::RGBA8888:
306- set_pixel<StorageFormat::RGBA8888>(x, y, color);
276+ scanline (y)[x] = ( color. alpha () << 24 ) | (color. blue () << 16 ) | (color. green () << 8 ) | color. red ( );
307277 return ;
308278 case StorageFormat::RGBx8888:
309- set_pixel<StorageFormat::RGBx8888>(x, y, color);
279+ scanline (y)[x] = ( color. blue () << 16 ) | (color. green () << 8 ) | color. red ( );
310280 return ;
311281 }
312282 VERIFY_NOT_REACHED ();
0 commit comments