Skip to content

Commit

Permalink
Remove deprecated method DumpPGM (#1420)
Browse files Browse the repository at this point in the history
It was deprecated in commit a18816f more than 7 years ago.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil authored and zdenop committed Mar 25, 2018
1 parent ee201e1 commit d13b862
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
19 changes: 0 additions & 19 deletions api/baseapi.cpp
Expand Up @@ -760,25 +760,6 @@ int TessBaseAPI::GetThresholdedImageScaleFactor() const {
return thresholder_->GetScaleFactor();
}

/** Dump the internal binary image to a PGM file. */
void TessBaseAPI::DumpPGM(const char* filename) {
if (tesseract_ == NULL)
return;
FILE *fp = fopen(filename, "wb");
Pix* pix = tesseract_->pix_binary();
int width = pixGetWidth(pix);
int height = pixGetHeight(pix);
l_uint32* data = pixGetData(pix);
fprintf(fp, "P5 %d %d 255\n", width, height);
for (int y = 0; y < height; ++y, data += pixGetWpl(pix)) {
for (int x = 0; x < width; ++x) {
uint8_t b = GET_DATA_BIT(data, x) ? 0 : 255;
fwrite(&b, 1, 1, fp);
}
}
fclose(fp);
}

/**
* Runs page layout analysis in the mode set by SetPageSegMode.
* May optionally be called prior to Recognize to get access to just
Expand Down
7 changes: 0 additions & 7 deletions api/baseapi.h
Expand Up @@ -471,13 +471,6 @@ class TESS_API TessBaseAPI {
*/
int GetThresholdedImageScaleFactor() const;

/**
* Dump the internal binary image to a PGM file.
* @deprecated Use GetThresholdedImage and write the image using pixWrite
* instead if possible.
*/
void DumpPGM(const char* filename);

/**
* Runs page layout analysis in the mode set by SetPageSegMode.
* May optionally be called prior to Recognize to get access to just
Expand Down
5 changes: 0 additions & 5 deletions api/capi.cpp
Expand Up @@ -419,11 +419,6 @@ TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor(const TessBaseA
return handle->GetThresholdedImageScaleFactor();
}

TESS_API void TESS_CALL TessBaseAPIDumpPGM(TessBaseAPI* handle, const char* filename)
{
handle->DumpPGM(filename);
}

TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout(TessBaseAPI* handle)
{
return handle->AnalyseLayout();
Expand Down
2 changes: 0 additions & 2 deletions api/capi.h
Expand Up @@ -246,8 +246,6 @@ TESS_API struct Boxa*

TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor(const TessBaseAPI* handle);

TESS_API void TESS_CALL TessBaseAPIDumpPGM(TessBaseAPI* handle, const char* filename);

TESS_API TessPageIterator*
TESS_CALL TessBaseAPIAnalyseLayout(TessBaseAPI* handle);

Expand Down

0 comments on commit d13b862

Please sign in to comment.