0
|
1 |
#ifndef __PAGE_H__
|
|
2 |
#define __PAGE_H__
|
|
3 |
extern "C" {
|
|
4 |
#include <pam.h>
|
|
5 |
}
|
|
6 |
#include "Bitmap.h"
|
|
7 |
#include "Histogram.h"
|
|
8 |
#include "Text.h"
|
|
9 |
|
|
10 |
typedef char *tRow;
|
|
11 |
|
|
12 |
class Page
|
|
13 |
{
|
|
14 |
public:
|
|
15 |
Page(const char *filename);
|
|
16 |
~Page();
|
|
17 |
|
|
18 |
int imageWidth() const { return width; };
|
|
19 |
int imageHeight() const { return height;};
|
|
20 |
|
|
21 |
//writeMap(char *filename) const;
|
|
22 |
|
|
23 |
/*
|
|
24 |
Angle skewAngle();
|
|
25 |
*/
|
|
26 |
void rotateMap(float angle);
|
|
27 |
void rotateMap(float angle, Bitmap* &mapNew);
|
|
28 |
|
|
29 |
void calcHistogram();
|
|
30 |
|
|
31 |
/* Funció una mica inútil */
|
|
32 |
void tryAngles(float min, float max, float step);
|
|
33 |
float getSkew(int depth = 5, float margin = 3);
|
|
34 |
|
|
35 |
float ratioBlackWhite() const;
|
|
36 |
|
|
37 |
// OCR
|
|
38 |
void getText();
|
|
39 |
|
|
40 |
//static void Initialize();
|
|
41 |
|
|
42 |
void writeMap(const char *filename) const;
|
|
43 |
void readMap(const char *filename);
|
|
44 |
|
|
45 |
private:
|
|
46 |
float std_dev_lines_angle(float angle);
|
|
47 |
|
|
48 |
int width;
|
|
49 |
int height;
|
|
50 |
|
|
51 |
pam pamImage;
|
|
52 |
Bitmap *map;
|
|
53 |
Text *text;
|
|
54 |
|
|
55 |
Histogram *hist;
|
|
56 |
};
|
|
57 |
#endif
|