53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
namespace pdfengine::document {
|
|
|
|
struct RawOCRWord {
|
|
std::string text;
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
double width = 0.0;
|
|
double height = 0.0;
|
|
double confidence = 0.0;
|
|
std::vector<std::pair<double, double>> polygon;
|
|
};
|
|
|
|
struct RawOCRLine {
|
|
std::string text;
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
double width = 0.0;
|
|
double height = 0.0;
|
|
double baselineY = 0.0;
|
|
double confidence = 0.0;
|
|
std::vector<RawOCRWord> words;
|
|
std::string fontName;
|
|
std::string fontId;
|
|
std::string fontFace;
|
|
int fontWeight = 400;
|
|
std::string fontStyle = "normal";
|
|
double fontSize = 0.0;
|
|
double lineSpacing = 1.2;
|
|
double letterSpacing = 0.0;
|
|
bool isBold = false;
|
|
bool isItalic = false;
|
|
bool isEmbeddedFont = false;
|
|
bool isPredictedFont = true;
|
|
};
|
|
|
|
struct RawOCRPage {
|
|
int pageIndex = 0;
|
|
double imageWidth = 0.0;
|
|
double imageHeight = 0.0;
|
|
double pageWidth = 0.0;
|
|
double pageHeight = 0.0;
|
|
std::vector<RawOCRLine> lines;
|
|
double processTimeMs = 0.0;
|
|
};
|
|
|
|
} // namespace pdfengine::document
|