Definition at line 23 of file imagedata_test.cc.
◆ ImagedataTest()
tesseract::ImagedataTest::ImagedataTest |
( |
| ) |
|
|
protecteddefault |
◆ MakeFakeDoc()
std::string tesseract::ImagedataTest::MakeFakeDoc |
( |
int |
num_pages, |
|
|
unsigned |
doc_id, |
|
|
std::vector< std::string > * |
page_texts |
|
) |
| |
|
inlineprotected |
Definition at line 33 of file imagedata_test.cc.
35 const int kImageSize = 1048576;
38 std::vector<char> fake_image(kImageSize, 0);
39 DocumentData write_doc(
"My document");
40 for (
int p = 0; p < num_pages; ++p) {
43 snprintf(text,
sizeof(text),
"Page %d of %d in doc %u", p, num_pages, doc_id);
44 page_texts->push_back(text);
46 ImageData *imagedata =
ImageData::Build(
"noname", p,
"eng", fake_image.data(),
47 fake_image.size(), (*page_texts)[p].c_str(),
nullptr);
48 EXPECT_EQ(kImageSize, imagedata->MemoryUsed());
49 write_doc.AddPageToDocument(imagedata);
52 std::string filename =
54 filename += std::to_string(doc_id) +
".lstmf";
55 EXPECT_TRUE(write_doc.SaveDocument(filename.c_str(),
nullptr));
static ImageData * Build(const char *name, int page_number, const char *lang, const char *imagedata, int imagedatasize, const char *truth_text, const char *box_text)
static std::string JoinPath(const std::string &s1, const std::string &s2)
◆ SetUp()
void tesseract::ImagedataTest::SetUp |
( |
| ) |
|
|
inlineoverrideprotected |
The documentation for this class was generated from the following file: