reference/ocr-simple/bitmap.h
author viric@llimona
Thu, 18 May 2006 23:12:51 +0200
changeset 0 6b8091ca909a
permissions -rw-r--r--
Init from working directory of svn repository.

#ifndef BITMAP
#define BITMAP 1

class Bitmap
{
 private:
  char* bits;
  int height;
  int width;
 public:
  Bitmap(char* b, int h, int w);
  Bitmap(char* filename);
  void WriteToFile(char* filename);
  inline int Height() 
      {
	return height;
      }
  inline int Width()
      {
	return width;
      }
  inline int PixelAt(int x, int y)
      {
	int offset = (y * (width / 8)) + (x / 8);
	char mask = (char) (1 << (x % 8));
	return (bits[offset] & mask);
      }

};

#endif