#ifndef _BITMAP_FONT_H #define _BITMAP_FONT_H #include #include #include #include typedef std::pair pixel; class BitmapFont{ friend std::ostream& operator<<(std::ostream &os,const BitmapFont &bf); private: int width, height; std::vector bitmap; std::vector pixels; public: int getWidth() const; int getHeight() const; int getSize() const; int getPixelSize() const; pixel getPixelAt(int index) const; BitmapFont(); BitmapFont(const BitmapFont& b); BitmapFont(int w,int h); BitmapFont(int w,int h,const std::vector &pxls); // 暗黙のうちに幅が4ビットの倍数だと仮定している。 BitmapFont(int w,int h,const std::string& hex); bool get(int x, int y) const; int getIndex(const pixel &px) const; }; #endif /* _BITMAP_FONT_H */