Skip to content

Commit

Permalink
Added a function to retrieve the rotation of the page
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed May 28, 2012
1 parent c0ab636 commit 1b1f7e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions api/PageLayoutAnalyzer.cpp
Expand Up @@ -81,6 +81,19 @@ DocumentLayout* TesseractProcessor::AnalyseLayout(System::Drawing::Image* image)
}
}

int TesseractProcessor::GetRotation()
{
int blockrotation = 0;
int* blockpointer = &blockrotation;

bool dummy = true;
bool* dummypointer = &dummy;

this->EngineAPI->GetBlockTextOrientations(&blockpointer, &dummypointer);

return (*blockpointer) * 90;
}

DocumentLayout* TesseractProcessor::AnalyseLayoutBinaryImage(
unsigned char* binData, int width, int height)
{
Expand Down
6 changes: 4 additions & 2 deletions api/TesseractEngineWrapper.h
Expand Up @@ -125,6 +125,7 @@ __gc public class TesseractProcessor : public IDisposable
bool GetDoubleVariable(System::String* name, double __gc* value);
System::String* GetStringVariable(System::String* name);


bool SetVariable(System::String* nam, System::String* value);

void DisableThresholder();
Expand Down Expand Up @@ -163,7 +164,7 @@ __gc public class TesseractProcessor : public IDisposable
//
String* RecognizeGreyImage(unsigned short* greyData, int width, int height);




private:
Expand Down Expand Up @@ -191,7 +192,8 @@ __gc public class TesseractProcessor : public IDisposable
DocumentLayout* AnalyseLayoutBinaryImage(unsigned char* binData, int width, int height);
DocumentLayout* AnalyseLayoutGreyImage(unsigned char* greyData, int width, int height);
DocumentLayout* AnalyseLayoutGreyImage(unsigned short* greyData, int width, int height);


int GetRotation();



Expand Down

0 comments on commit 1b1f7e9

Please sign in to comment.