[wadalabfont-kit] / jis2prim / BitmapFont.h  

View of /jis2prim/BitmapFont.h

Parent Directory | Revision Log
Revision: 1.6 - (download) (as text) (annotate)
Tue Aug 20 11:10:36 2002 UTC (22 years, 3 months ago) by ktanaka
Branch: MAIN
CVS Tags: SNAP-20040518, SNAP-20030702, SNAP-20030630, SNAP-20030624, HEAD
Changes since 1.5: +12 -55 lines
*** 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