Revision Log
*** empty log message ***
#ifndef _BITMAP_FONT_H
#define _BITMAP_FONT_H
#include <vector>
#include <string>
#include <algorithm>
#include <cassert>
typedef std::pair<int,int> pixel;
class BitmapFont{
friend std::ostream& operator<<(std::ostream &os,const BitmapFont &bf);
private:
int width, height;
std::vector<bool> bitmap;
std::vector<pixel> 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<pixel> &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 */
|
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |