mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Annotation painting, first part
This commit is contained in:
@ -44,6 +44,37 @@ class PDFOptionalContentActivity;
|
||||
|
||||
static constexpr const char* PDF_RESOURCE_EXTGSTATE = "ExtGState";
|
||||
|
||||
class PDFLineDashPattern
|
||||
{
|
||||
public:
|
||||
explicit inline PDFLineDashPattern() = default;
|
||||
explicit inline PDFLineDashPattern(const std::vector<PDFReal>& dashArray, PDFReal dashOffset) :
|
||||
m_dashArray(dashArray),
|
||||
m_dashOffset(dashOffset)
|
||||
{
|
||||
if (m_dashArray.size() % 2 == 1)
|
||||
{
|
||||
m_dashArray.push_back(m_dashArray.back());
|
||||
}
|
||||
}
|
||||
|
||||
inline const std::vector<PDFReal>& getDashArray() const { return m_dashArray; }
|
||||
inline void setDashArray(const std::vector<PDFReal>& dashArray) { m_dashArray = dashArray; }
|
||||
|
||||
inline PDFReal getDashOffset() const { return m_dashOffset; }
|
||||
inline void setDashOffset(PDFReal dashOffset) { m_dashOffset = dashOffset; }
|
||||
|
||||
inline bool operator==(const PDFLineDashPattern& other) const { return m_dashArray == other.m_dashArray && m_dashOffset == other.m_dashOffset; }
|
||||
inline bool operator!=(const PDFLineDashPattern& other) const { return !(*this == other); }
|
||||
|
||||
/// Is line solid? Function returns true, if yes.
|
||||
bool isSolid() const { return m_dashArray.empty(); }
|
||||
|
||||
private:
|
||||
std::vector<PDFReal> m_dashArray;
|
||||
PDFReal m_dashOffset = 0.0;
|
||||
};
|
||||
|
||||
/// Process the contents of the page.
|
||||
class PDFPageContentProcessor : public PDFRenderErrorReporter
|
||||
{
|
||||
@ -193,34 +224,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
class PDFLineDashPattern
|
||||
{
|
||||
public:
|
||||
explicit inline PDFLineDashPattern() = default;
|
||||
explicit inline PDFLineDashPattern(const std::vector<PDFReal>& dashArray, PDFReal dashOffset) :
|
||||
m_dashArray(dashArray),
|
||||
m_dashOffset(dashOffset)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
inline const std::vector<PDFReal>& getDashArray() const { return m_dashArray; }
|
||||
inline void setDashArray(const std::vector<PDFReal>& dashArray) { m_dashArray = dashArray; }
|
||||
|
||||
inline PDFReal getDashOffset() const { return m_dashOffset; }
|
||||
inline void setDashOffset(PDFReal dashOffset) { m_dashOffset = dashOffset; }
|
||||
|
||||
inline bool operator==(const PDFLineDashPattern& other) const { return m_dashArray == other.m_dashArray && m_dashOffset == other.m_dashOffset; }
|
||||
inline bool operator!=(const PDFLineDashPattern& other) const { return !(*this == other); }
|
||||
|
||||
/// Is line solid? Function returns true, if yes.
|
||||
bool isSolid() const { return m_dashArray.empty(); }
|
||||
|
||||
private:
|
||||
std::vector<PDFReal> m_dashArray;
|
||||
PDFReal m_dashOffset = 0.0;
|
||||
};
|
||||
|
||||
struct PDFTransparencyGroup
|
||||
{
|
||||
PDFColorSpacePointer colorSpacePointer;
|
||||
|
Reference in New Issue
Block a user