reference/ocr-simple/RLEPair.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 _RLEPair_H
#define _RLEPair_H

#include "list.h"


// Indicates a series of black pixels in a row.
class RLEPair {
public:

  RLEPair()
    :start(0),end(0) {};

  RLEPair(int first, int last, int thisRow)
    :start(first), end(last), row(thisRow) {};
  RLEPair(int first, int last)
    :start(first), end(last), row(-1) {};
  ~RLEPair() {};

  short int start;
  short int end;
  short int row;
};



class RLEPairs :public List {
 public:

  RLEPairs(int row_num);
  ~RLEPairs();

  // Create RLEPair Representation of contents read from TIFF file
  void fill(unsigned char * contents, int contentsLength, int contentsRow);
  int pixelsBetween(int start, int end);
  int numPixels;
  void shift(int);
  void draw_pairs(int y_coord, char* color, double width);
  void print_pairs();
  
  RLEPairs * extract(int startcol, int endcol);   
  // create a copy of this from  startcol to endcol.
 // and return pointer to RLEPairs
   
  void  merge(RLEPairs * pairs);
  // Merges  pairs into this.

  private:
    int row;
 
  
};

#endif