DocDiff application: LCS algorithm

This commit is contained in:
Jakub Melka
2021-09-09 18:28:55 +02:00
parent b2a9342047
commit 69c988c756
6 changed files with 303 additions and 26 deletions

View File

@@ -241,9 +241,20 @@ public:
Unknown,
Text,
VectorGraphics,
Image
Image,
Shading
};
bool operator<(const GraphicPieceInfo& other) const
{
return std::tie(type, hash) < std::tie(other.type, other.hash);
}
bool isText() const { return type == Type::Text; }
bool isVectorGraphics() const { return type == Type::VectorGraphics; }
bool isImage() const { return type == Type::Image; }
bool isShading() const { return type == Type::Shading; }
Type type = Type::Unknown;
QRectF boundingRect;
std::array<uint8_t, 64> hash = { };
@@ -255,8 +266,10 @@ public:
/// for example, for comparation reasons. Parameter \p epsilon
/// is for numerical precision - values under epsilon are considered
/// as equal.
/// \param mediaBox Page's media box
/// \param epsilon Epsilon
GraphicPieceInfos calculateGraphicPieceInfos(PDFReal epsilon) const;
GraphicPieceInfos calculateGraphicPieceInfos(QRectF mediaBox,
PDFReal epsilon) const;
private:
struct PathPaintData