From d13b86205017c88bfc620277431bc933bfb20fee Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 25 Mar 2018 17:29:11 +0200 Subject: [PATCH] Remove deprecated method DumpPGM (#1420) It was deprecated in commit a18816f83 more than 7 years ago. Signed-off-by: Stefan Weil --- api/baseapi.cpp | 19 ------------------- api/baseapi.h | 7 ------- api/capi.cpp | 5 ----- api/capi.h | 2 -- 4 files changed, 33 deletions(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index bd7f483595..afd9dce943 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -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 diff --git a/api/baseapi.h b/api/baseapi.h index a15ea30828..4263445e12 100644 --- a/api/baseapi.h +++ b/api/baseapi.h @@ -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 diff --git a/api/capi.cpp b/api/capi.cpp index 4f69731400..423f070224 100644 --- a/api/capi.cpp +++ b/api/capi.cpp @@ -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(); diff --git a/api/capi.h b/api/capi.h index f3fc3833cf..4c258231de 100644 --- a/api/capi.h +++ b/api/capi.h @@ -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);