--- nono/lib/bitmap.h 2026/04/29 17:05:26 1.1.1.5 +++ nono/lib/bitmap.h 2026/04/29 17:05:47 1.1.1.7 @@ -27,6 +27,11 @@ class BitmapBase public: virtual ~BitmapBase(); + // コピーコンストラクタ + BitmapBase(const BitmapBase& src); + // コピー代入演算子 + BitmapBase& operator=(const BitmapBase& src); + // サイズを指定してキャンバスを作成。 void Create(uint width_, uint height_) { Create(width_, height_, NULL); @@ -76,6 +81,11 @@ class BitmapI1 : public BitmapBase ~BitmapI1() override; uint8 *GetPtr(int x, int y) const override; + + // このビットマップ(フォント)をボールドにした新しいビットマップを返す。 + BitmapI1 ConvertToBold() const; + // このビットマップ(フォント)をイタリックにした新しいビットマップを返す。 + BitmapI1 ConvertToItalic() const; }; // 8bpp ビットマップ @@ -123,6 +133,8 @@ class BitmapRGBX : public BitmapBase // rect の一番上のラスターを rect の残りのラスターにコピーする void CopyFromTop(const Rect& rect); + void DrawPoint(Color c, int x, int y); + void DrawLine(Color c, int x1, int y1, int x2, int y2); void DrawLineH(Color c, int x1, int y1, int x2); void DrawLineV(Color c, int x1, int y1, int y2); @@ -132,6 +144,11 @@ class BitmapRGBX : public BitmapBase } void DrawRect(Color c, const Rect& rect); + void DrawFillCircle(Color b, Color f, int dx, int dy, uint dw, uint dh) { + DrawFillCircle(b, f, Rect(dx, dy, dw, dh)); + } + void DrawFillCircle(Color border, Color fill, const Rect& rect); + // I1 画像を描画 void DrawBitmapI1(int dx, int dy, const BitmapI1& src, const Color *palette); @@ -158,7 +175,10 @@ class BitmapRGBX : public BitmapBase int sxN, int sxD, int sxS, int syN, int syD, int syS); // RGBX 画像を描画 - void DrawBitmap(int dx, int dy, const BitmapRGBX& src); + void DrawBitmap(int dx, int dy, const BitmapRGBX& src, const Rect& sr); + void DrawBitmap(int dx, int dy, const BitmapRGBX& src) { + DrawBitmap(dx, dy, src, Rect(0, 0, src.GetWidth(), src.GetHeight())); + } // RGBX 画像が dr のサイズになるよう拡大縮小して描画 void DrawBitmapStretch(const Rect& dr, const BitmapRGBX& src);