This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
438 changed files
with
83,952 additions
and
35,694 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,9 @@ | |
// Copyright (C) 2005 Kristian Høgsberg <[email protected]> | ||
// Copyright (C) 2012 Fabio D'Urso <[email protected]> | ||
// Copyright (C) 2013 Thomas Freitag <[email protected]> | ||
// Copyright (C) 2017, 2018 Albert Astals Cid <[email protected]> | ||
// Copyright (C) 2017-2019 Albert Astals Cid <[email protected]> | ||
// Copyright (C) 2017 Adrian Johnson <[email protected]> | ||
// Copyright (C) 2018 Adam Reichold <[email protected]> | ||
// Copyright (C) 2018, 2019 Adam Reichold <[email protected]> | ||
// | ||
// To see a description of the changes please see the Changelog file that | ||
// came with your tarball or type make ChangeLog if you are building from git | ||
|
@@ -33,6 +33,7 @@ | |
#include <vector> | ||
|
||
#include "poppler-config.h" | ||
#include "poppler_private_export.h" | ||
#include "Object.h" | ||
|
||
class XRef; | ||
|
@@ -41,47 +42,49 @@ class XRef; | |
// Array | ||
//------------------------------------------------------------------------ | ||
|
||
class Array { | ||
class POPPLER_PRIVATE_EXPORT Array | ||
{ | ||
public: | ||
// Constructor. | ||
Array(XRef *xrefA); | ||
|
||
// Constructor. | ||
Array(XRef *xrefA); | ||
// Destructor. | ||
~Array(); | ||
|
||
// Destructor. | ||
~Array(); | ||
Array(const Array &) = delete; | ||
Array &operator=(const Array &) = delete; | ||
|
||
Array(const Array &) = delete; | ||
Array& operator=(const Array &) = delete; | ||
// Get number of elements. | ||
int getLength() const { return elems.size(); } | ||
|
||
// Get number of elements. | ||
int getLength() const { return elems.size(); } | ||
// Copy array with new xref | ||
Array *copy(XRef *xrefA) const; | ||
|
||
// Copy array with new xref | ||
Object copy(XRef *xrefA) const; | ||
// Add an element | ||
// elem becomes a dead object after this call | ||
void add(Object &&elem); | ||
|
||
// Add an element | ||
// elem becomes a dead object after this call | ||
void add(Object &&elem); | ||
// Remove an element by position | ||
void remove(int i); | ||
|
||
// Remove an element by position | ||
void remove(int i); | ||
|
||
// Accessors. | ||
Object get(int i, int recursion = 0) const; | ||
Object getNF(int i) const; | ||
bool getString(int i, GooString *string) const; | ||
// Accessors. | ||
Object get(int i, int recursion = 0) const; | ||
// Same as above but if the returned object is a fetched Ref returns such Ref in returnRef, otherwise returnRef is Ref::INVALID() | ||
Object get(int i, Ref *returnRef, int recursion = 0) const; | ||
const Object &getNF(int i) const; | ||
bool getString(int i, GooString *string) const; | ||
|
||
private: | ||
friend class Object; // for incRef/decRef | ||
friend class Object; // for incRef/decRef | ||
|
||
// Reference counting. | ||
int incRef() { return ++ref; } | ||
int decRef() { return --ref; } | ||
// Reference counting. | ||
int incRef() { return ++ref; } | ||
int decRef() { return --ref; } | ||
|
||
XRef *xref; // the xref table for this PDF file | ||
std::vector<Object> elems; // array of elements | ||
std::atomic_int ref; // reference count | ||
mutable std::recursive_mutex mutex; | ||
XRef *xref; // the xref table for this PDF file | ||
std::vector<Object> elems; // array of elements | ||
std::atomic_int ref; // reference count | ||
mutable std::recursive_mutex mutex; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//======================================================================== | ||
// | ||
// BBoxOutputDev.cc | ||
// | ||
// This file is licensed under the GPLv2 or later | ||
// | ||
// Copyright 2020 sgerwk <[email protected]> | ||
// | ||
//======================================================================== | ||
|
||
#include <PDFDoc.h> | ||
#include <GfxState.h> | ||
#include <OutputDev.h> | ||
|
||
class POPPLER_PRIVATE_EXPORT BBoxOutputDev : public OutputDev | ||
{ | ||
public: | ||
bool upsideDown() override { return false; } | ||
bool useDrawChar() override { return true; } | ||
bool interpretType3Chars() override { return false; } | ||
|
||
BBoxOutputDev(); | ||
BBoxOutputDev(bool text, bool vector, bool raster); | ||
BBoxOutputDev(bool text, bool vector, bool raster, bool lwidth); | ||
void endPage() override; | ||
void stroke(GfxState *state) override; | ||
void fill(GfxState *state) override; | ||
void eoFill(GfxState *state) override; | ||
void drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen) override; | ||
void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool interpolate, bool inlineImg) override; | ||
void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, const int *maskColors, bool inlineImg) override; | ||
void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert, bool maskInterpolate) override; | ||
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap, | ||
bool maskInterpolate) override; | ||
|
||
double getX1() const; | ||
double getY1() const; | ||
double getX2() const; | ||
double getY2() const; | ||
double getHasGraphics() const; | ||
|
||
private: | ||
PDFRectangle bb; | ||
bool hasGraphics; | ||
|
||
bool text; | ||
bool vector; | ||
bool raster; | ||
bool lwidth; | ||
|
||
void updatePoint(PDFRectangle *bbA, double x, double y, const GfxState *state); | ||
void updatePath(PDFRectangle *bbA, const GfxPath *path, const GfxState *state); | ||
void updateImage(PDFRectangle *bbA, const GfxState *state); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.