summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx/Bitmap.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-10 10:57:59 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-10 10:59:04 +0200
commit116cf92156090bb3f5c15d5be145f1283884d65d (patch)
tree4496ab3e8c90add1c40da2eceee71324369ec0c6 /Libraries/LibGfx/Bitmap.h
parent656b01eb0fb659fb2d3ee4e6e4413a82543414e3 (diff)
downloadserenity-116cf92156090bb3f5c15d5be145f1283884d65d.zip
LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
Diffstat (limited to 'Libraries/LibGfx/Bitmap.h')
-rw-r--r--Libraries/LibGfx/Bitmap.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/Libraries/LibGfx/Bitmap.h b/Libraries/LibGfx/Bitmap.h
index 75be882187..4d1a0ef90b 100644
--- a/Libraries/LibGfx/Bitmap.h
+++ b/Libraries/LibGfx/Bitmap.h
@@ -49,11 +49,11 @@ enum RotationDirection {
class Bitmap : public RefCounted<Bitmap> {
public:
- static RefPtr<Bitmap> create(BitmapFormat, const Size&);
- static RefPtr<Bitmap> create_purgeable(BitmapFormat, const Size&);
- static RefPtr<Bitmap> create_wrapper(BitmapFormat, const Size&, size_t pitch, RGBA32*);
+ static RefPtr<Bitmap> create(BitmapFormat, const IntSize&);
+ static RefPtr<Bitmap> create_purgeable(BitmapFormat, const IntSize&);
+ static RefPtr<Bitmap> create_wrapper(BitmapFormat, const IntSize&, size_t pitch, RGBA32*);
static RefPtr<Bitmap> load_from_file(const StringView& path);
- static RefPtr<Bitmap> create_with_shared_buffer(BitmapFormat, NonnullRefPtr<SharedBuffer>&&, const Size&);
+ static RefPtr<Bitmap> create_with_shared_buffer(BitmapFormat, NonnullRefPtr<SharedBuffer>&&, const IntSize&);
RefPtr<Gfx::Bitmap> rotated(Gfx::RotationDirection) const;
RefPtr<Gfx::Bitmap> flipped(Gfx::Orientation) const;
@@ -69,8 +69,8 @@ public:
u8* bits(int y);
const u8* bits(int y) const;
- Rect rect() const { return { {}, m_size }; }
- Size size() const { return m_size; }
+ IntRect rect() const { return { {}, m_size }; }
+ IntSize size() const { return m_size; }
int width() const { return m_size.width(); }
int height() const { return m_size.height(); }
size_t pitch() const { return m_pitch; }
@@ -121,7 +121,7 @@ public:
Color get_pixel(int x, int y) const;
- Color get_pixel(const Point& position) const
+ Color get_pixel(const IntPoint& position) const
{
return get_pixel(position.x(), position.y());
}
@@ -136,7 +136,7 @@ public:
void set_pixel(int x, int y, Color);
- void set_pixel(const Point& position, Color color)
+ void set_pixel(const IntPoint& position, Color color)
{
set_pixel(position.x(), position.y(), color);
}
@@ -149,11 +149,11 @@ public:
private:
enum class Purgeable { No,
Yes };
- Bitmap(BitmapFormat, const Size&, Purgeable);
- Bitmap(BitmapFormat, const Size&, size_t pitch, RGBA32*);
- Bitmap(BitmapFormat, NonnullRefPtr<SharedBuffer>&&, const Size&);
+ Bitmap(BitmapFormat, const IntSize&, Purgeable);
+ Bitmap(BitmapFormat, const IntSize&, size_t pitch, RGBA32*);
+ Bitmap(BitmapFormat, NonnullRefPtr<SharedBuffer>&&, const IntSize&);
- Size m_size;
+ IntSize m_size;
RGBA32* m_data { nullptr };
RGBA32* m_palette { nullptr };
size_t m_pitch { 0 };