Files
pdf/engine/include/pdfengine/document/raw_ocr_document.hpp
T

53 lines
1.1 KiB
C++
Raw Normal View History

2026-08-07 19:09:44 +05:30
#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;
2026-08-10 14:21:54 +05:30
std::string fontFace;
int fontWeight = 400;
std::string fontStyle = "normal";
2026-08-07 19:09:44 +05:30
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