Remove unused ifdef.

This commit is contained in:
Egor Pugin 2021-03-31 21:53:27 +03:00
parent 722767633e
commit 4fa05b9147
2 changed files with 0 additions and 24 deletions

View File

@ -47,9 +47,6 @@ ImageData::ImageData(bool vertical, Pix *pix) : page_number_(0), vertical_text_(
SetPix(pix);
}
ImageData::~ImageData() {
#ifdef TESSERACT_IMAGEDATA_AS_PIX
pixDestroy(&internal_pix_);
#endif
}
// Builds and returns an ImageData from the basic data. Note that imagedata,
@ -180,28 +177,12 @@ bool ImageData::SkipDeSerialize(TFile *fp) {
// In case of missing PNG support in Leptonica use PNM format,
// which requires more memory.
void ImageData::SetPix(Pix *pix) {
#ifdef TESSERACT_IMAGEDATA_AS_PIX
internal_pix_ = pix;
#else
SetPixInternal(pix, &image_data_);
#endif
}
// Returns the Pix image for *this. Must be pixDestroyed after use.
Pix *ImageData::GetPix() const {
#ifdef TESSERACT_IMAGEDATA_AS_PIX
# ifdef GRAPHICS_DISABLED
/* The only caller of this is the scaling functions to prescale the
* source. Thus we can just return a new pointer to the same data. */
return pixClone(internal_pix_);
# else
/* pixCopy always does an actual copy, so the caller can modify the
* changed data. */
return pixCopy(NULL, internal_pix_);
# endif
#else
return GetPixInternal(image_data_);
#endif
}
// Gets anything and everything with a non-nullptr pointer, prescaled to a
@ -322,7 +303,6 @@ void ImageData::AddBoxes(const std::vector<TBOX> &boxes, const std::vector<std::
}
}
#ifndef TESSERACT_IMAGEDATA_AS_PIX
// Saves the given Pix as a PNG-encoded string and destroys it.
// In case of missing PNG support in Leptonica use PNM format,
// which requires more memory.
@ -351,7 +331,6 @@ Pix *ImageData::GetPixInternal(const std::vector<char> &image_data) {
}
return pix;
}
#endif
// Parses the text string as a box file and adds any discovered boxes that
// match the page number. Returns false on error.

View File

@ -151,9 +151,6 @@ private:
private:
std::string imagefilename_; // File to read image from.
int32_t page_number_; // Page number if multi-page tif or -1.
#ifdef TESSERACT_IMAGEDATA_AS_PIX
Pix *internal_pix_;
#endif
std::vector<char> image_data_; // PNG/PNM file data.
std::string language_; // Language code for image.
std::string transcription_; // UTF-8 ground truth of image.