Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated method DumpPGM #1420

Merged
merged 1 commit into from
Mar 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions api/baseapi.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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