node-poppler 5.1.4 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +13 -13
- package/src/index.js +20 -8
- package/API.md +0 -465
- package/CHANGELOG.md +0 -976
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Annot.h +0 -1783
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/AnnotStampImageHelper.h +0 -68
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Array.h +0 -92
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/BBoxOutputDev.h +0 -54
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CMap.h +0 -128
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CachedFile.h +0 -149
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoFontEngine.h +0 -122
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoOutputDev.h +0 -468
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoRescaleBox.h +0 -60
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Catalog.h +0 -318
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CertificateInfo.h +0 -129
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharCodeToUnicode.h +0 -143
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharTypes.h +0 -24
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlCachedFile.h +0 -37
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlPDFDocBuilder.h +0 -32
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/DateInfo.h +0 -44
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Decrypt.h +0 -147
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Dict.h +0 -126
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Error.h +0 -59
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ErrorCodes.h +0 -54
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FDPDFDocBuilder.h +0 -36
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FILECacheLoader.h +0 -34
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FileSpec.h +0 -85
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontEncodingTables.h +0 -20
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontInfo.h +0 -109
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Form.h +0 -734
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Function.h +0 -251
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Gfx.h +0 -373
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxFont.h +0 -466
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState.h +0 -1759
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState_helpers.h +0 -90
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GlobalParams.h +0 -221
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Hints.h +0 -91
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JArithmeticDecoder.h +0 -131
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JBIG2Stream.h +0 -130
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JPEG2000Stream.h +0 -54
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JSInfo.h +0 -65
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Lexer.h +0 -113
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Linearization.h +0 -43
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Link.h +0 -566
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/LocalPDFDocBuilder.h +0 -32
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/MarkedContentOutputDev.h +0 -132
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Movie.h +0 -123
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToCharCode.h +0 -52
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToUnicodeTable.h +0 -4300
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Object.h +0 -678
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OptionalContent.h +0 -117
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Outline.h +0 -122
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OutputDev.h +0 -379
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDoc.h +0 -419
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocBuilder.h +0 -47
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocEncoding.h +0 -43
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocFactory.h +0 -58
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSOutputDev.h +0 -549
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSTokenizer.h +0 -47
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Page.h +0 -273
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PageTransition.h +0 -105
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Parser.h +0 -76
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PopplerCache.h +0 -65
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PreScanOutputDev.h +0 -148
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ProfileData.h +0 -35
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Rendition.h +0 -164
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SecurityHandler.h +0 -131
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Sound.h +0 -82
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SplashOutputDev.h +0 -413
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream-CCITT.h +0 -334
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream.h +0 -1504
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructElement.h +0 -406
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructTreeRoot.h +0 -89
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/TextOutputDev.h +0 -918
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UTF.h +0 -112
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCClassTables.h +0 -983
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCompTables.h +0 -328
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeDecompTables.h +0 -7181
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMap.h +0 -128
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapFuncs.h +0 -35
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapTables.h +0 -84
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeTypeTable.h +0 -49
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ViewerPreferences.h +0 -87
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/XRef.h +0 -325
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-destination.h +0 -69
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-document.h +0 -135
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-embedded-file.h +0 -55
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font-private.h +0 -68
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font.h +0 -95
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-global.h +0 -132
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-image.h +0 -74
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-renderer.h +0 -77
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-transition.h +0 -85
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page.h +0 -225
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-rectangle.h +0 -66
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-toc.h +0 -72
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-version.h +0 -39
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler_cpp_export.h +0 -42
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiBase.h +0 -66
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiEncodings.h +0 -43
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiIdentifier.h +0 -52
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiTrueType.h +0 -190
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1.h +0 -70
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1C.h +0 -263
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-action.h +0 -454
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-annot.h +0 -333
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-attachment.h +0 -123
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-date.h +0 -32
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-document.h +0 -541
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-enums.h +0 -191
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-features.h +0 -88
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-form-field.h +0 -254
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-layer.h +0 -50
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-macros.h +0 -42
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-media.h +0 -80
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-movie.h +0 -81
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-page.h +0 -424
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-structure-element.h +0 -425
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler.h +0 -259
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooCheckedOps.h +0 -116
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooLikely.h +0 -22
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooString.h +0 -262
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooTimer.h +0 -59
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/ImgWriter.h +0 -39
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/JpegWriter.h +0 -69
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/PNGWriter.h +0 -68
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/TiffWriter.h +0 -70
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gdir.h +0 -96
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gfile.h +0 -156
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gmem.h +0 -201
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/grandom.h +0 -21
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gstrtod.h +0 -45
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler-config.h +0 -155
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler_private_export.h +0 -42
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/Splash.h +0 -336
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashBitmap.h +0 -127
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashClip.h +0 -131
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashErrorCodes.h +0 -50
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFont.h +0 -71
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontEngine.h +0 -72
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontFile.h +0 -64
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFont.h +0 -116
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontEngine.h +0 -89
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFile.h +0 -98
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFileID.h +0 -40
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashGlyphBitmap.h +0 -23
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashMath.h +0 -215
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPath.h +0 -138
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPattern.h +0 -107
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashScreen.h +0 -87
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashState.h +0 -132
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashTypes.h +0 -248
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPath.h +0 -95
- package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPathScanner.h +0 -136
- package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-cpp.pc +0 -12
- package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-glib.pc +0 -12
- package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler.pc +0 -10
- package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-cpp.lib +0 -0
- package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-glib.lib +0 -0
- package/src/lib/win32/poppler-22.04.0/Library/lib/poppler.lib +0 -0
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfattach.1 +0 -60
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfdetach.1 +0 -94
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdffonts.1 +0 -128
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfimages.1 +0 -265
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfinfo.1 +0 -198
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfseparate.1 +0 -60
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftocairo.1 +0 -346
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftohtml.1 +0 -118
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftoppm.1 +0 -230
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftops.1 +0 -267
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftotext.1 +0 -157
- package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfunite.1 +0 -43
- package/src/lib/win32/poppler-22.04.0/share/poppler/CMakeLists.txt +0 -309
- package/src/lib/win32/poppler-22.04.0/share/poppler/Makefile +0 -333
- package/tsconfig.json +0 -9
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// SplashScreen.h
|
|
4
|
-
//
|
|
5
|
-
//========================================================================
|
|
6
|
-
|
|
7
|
-
//========================================================================
|
|
8
|
-
//
|
|
9
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
10
|
-
//
|
|
11
|
-
// All changes made under the Poppler project to this file are licensed
|
|
12
|
-
// under GPL version 2 or later
|
|
13
|
-
//
|
|
14
|
-
// Copyright (C) 2009, 2018, 2020, 2021 Albert Astals Cid <aacid@kde.org>
|
|
15
|
-
//
|
|
16
|
-
// To see a description of the changes please see the Changelog file that
|
|
17
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
18
|
-
//
|
|
19
|
-
//========================================================================
|
|
20
|
-
|
|
21
|
-
#ifndef SPLASHSCREEN_H
|
|
22
|
-
#define SPLASHSCREEN_H
|
|
23
|
-
|
|
24
|
-
#include "SplashTypes.h"
|
|
25
|
-
|
|
26
|
-
#include <cstdlib>
|
|
27
|
-
|
|
28
|
-
//------------------------------------------------------------------------
|
|
29
|
-
// SplashScreen
|
|
30
|
-
//------------------------------------------------------------------------
|
|
31
|
-
|
|
32
|
-
class SplashScreen
|
|
33
|
-
{
|
|
34
|
-
public:
|
|
35
|
-
explicit SplashScreen(const SplashScreenParams *params);
|
|
36
|
-
explicit SplashScreen(const SplashScreen *screen);
|
|
37
|
-
~SplashScreen();
|
|
38
|
-
|
|
39
|
-
SplashScreen(const SplashScreen &) = delete;
|
|
40
|
-
SplashScreen &operator=(const SplashScreen &) = delete;
|
|
41
|
-
|
|
42
|
-
SplashScreen *copy() const { return new SplashScreen(this); }
|
|
43
|
-
|
|
44
|
-
// Return the computed pixel value (0=black, 1=white) for the gray
|
|
45
|
-
// level <value> at (<x>, <y>).
|
|
46
|
-
int test(int x, int y, unsigned char value)
|
|
47
|
-
{
|
|
48
|
-
int xx, yy;
|
|
49
|
-
if (mat == nullptr) {
|
|
50
|
-
createMatrix();
|
|
51
|
-
}
|
|
52
|
-
xx = x & sizeM1;
|
|
53
|
-
yy = y & sizeM1;
|
|
54
|
-
return value < mat[(yy << log2Size) + xx] ? 0 : 1;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Returns true if value is above the white threshold or below the
|
|
58
|
-
// black threshold, i.e., if the corresponding halftone will be
|
|
59
|
-
// solid white or black.
|
|
60
|
-
bool isStatic(unsigned char value)
|
|
61
|
-
{
|
|
62
|
-
if (mat == nullptr) {
|
|
63
|
-
createMatrix();
|
|
64
|
-
}
|
|
65
|
-
return value < minVal || value >= maxVal;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
private:
|
|
69
|
-
void createMatrix();
|
|
70
|
-
|
|
71
|
-
void buildDispersedMatrix(int i, int j, int val, int delta, int offset);
|
|
72
|
-
void buildClusteredMatrix();
|
|
73
|
-
int distance(int x0, int y0, int x1, int y1);
|
|
74
|
-
void buildSCDMatrix(int r);
|
|
75
|
-
|
|
76
|
-
const SplashScreenParams *screenParams; // params to create the other members
|
|
77
|
-
unsigned char *mat; // threshold matrix
|
|
78
|
-
int size; // size of the threshold matrix
|
|
79
|
-
int sizeM1; // size - 1
|
|
80
|
-
int log2Size; // log2(size)
|
|
81
|
-
unsigned char minVal; // any pixel value below minVal generates
|
|
82
|
-
// solid black
|
|
83
|
-
unsigned char maxVal; // any pixel value above maxVal generates
|
|
84
|
-
// solid white
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
#endif
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// SplashState.h
|
|
4
|
-
//
|
|
5
|
-
//========================================================================
|
|
6
|
-
|
|
7
|
-
//========================================================================
|
|
8
|
-
//
|
|
9
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
10
|
-
//
|
|
11
|
-
// All changes made under the Poppler project to this file are licensed
|
|
12
|
-
// under GPL version 2 or later
|
|
13
|
-
//
|
|
14
|
-
// Copyright (C) 2011, 2012, 2015 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
15
|
-
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
|
|
16
|
-
// Copyright (C) 2018, 2021 Albert Astals Cid <aacid@kde.org>
|
|
17
|
-
//
|
|
18
|
-
// To see a description of the changes please see the Changelog file that
|
|
19
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
20
|
-
//
|
|
21
|
-
//========================================================================
|
|
22
|
-
|
|
23
|
-
#ifndef SPLASHSTATE_H
|
|
24
|
-
#define SPLASHSTATE_H
|
|
25
|
-
|
|
26
|
-
#include "SplashTypes.h"
|
|
27
|
-
|
|
28
|
-
class SplashPattern;
|
|
29
|
-
class SplashScreen;
|
|
30
|
-
class SplashClip;
|
|
31
|
-
class SplashBitmap;
|
|
32
|
-
|
|
33
|
-
//------------------------------------------------------------------------
|
|
34
|
-
// line cap values
|
|
35
|
-
//------------------------------------------------------------------------
|
|
36
|
-
|
|
37
|
-
#define splashLineCapButt 0
|
|
38
|
-
#define splashLineCapRound 1
|
|
39
|
-
#define splashLineCapProjecting 2
|
|
40
|
-
|
|
41
|
-
//------------------------------------------------------------------------
|
|
42
|
-
// line join values
|
|
43
|
-
//------------------------------------------------------------------------
|
|
44
|
-
|
|
45
|
-
#define splashLineJoinMiter 0
|
|
46
|
-
#define splashLineJoinRound 1
|
|
47
|
-
#define splashLineJoinBevel 2
|
|
48
|
-
|
|
49
|
-
//------------------------------------------------------------------------
|
|
50
|
-
// SplashState
|
|
51
|
-
//------------------------------------------------------------------------
|
|
52
|
-
|
|
53
|
-
class SplashState
|
|
54
|
-
{
|
|
55
|
-
public:
|
|
56
|
-
// Create a new state object, initialized with default settings.
|
|
57
|
-
SplashState(int width, int height, bool vectorAntialias, SplashScreenParams *screenParams);
|
|
58
|
-
SplashState(int width, int height, bool vectorAntialias, SplashScreen *screenA);
|
|
59
|
-
|
|
60
|
-
// Copy a state object.
|
|
61
|
-
SplashState *copy() const { return new SplashState(this); }
|
|
62
|
-
|
|
63
|
-
~SplashState();
|
|
64
|
-
|
|
65
|
-
SplashState(const SplashState &) = delete;
|
|
66
|
-
SplashState &operator=(const SplashState &) = delete;
|
|
67
|
-
|
|
68
|
-
// Set the stroke pattern. This does not copy <strokePatternA>.
|
|
69
|
-
void setStrokePattern(SplashPattern *strokePatternA);
|
|
70
|
-
|
|
71
|
-
// Set the fill pattern. This does not copy <fillPatternA>.
|
|
72
|
-
void setFillPattern(SplashPattern *fillPatternA);
|
|
73
|
-
|
|
74
|
-
// Set the screen. This does not copy <screenA>.
|
|
75
|
-
void setScreen(SplashScreen *screenA);
|
|
76
|
-
|
|
77
|
-
// Set the line dash pattern. This copies the <lineDashA> array.
|
|
78
|
-
void setLineDash(SplashCoord *lineDashA, int lineDashLengthA, SplashCoord lineDashPhaseA);
|
|
79
|
-
|
|
80
|
-
// Set the soft mask bitmap.
|
|
81
|
-
void setSoftMask(SplashBitmap *softMaskA);
|
|
82
|
-
|
|
83
|
-
// Set the overprint parametes.
|
|
84
|
-
void setFillOverprint(bool fillOverprintA) { fillOverprint = fillOverprintA; }
|
|
85
|
-
void setStrokeOverprint(bool strokeOverprintA) { strokeOverprint = strokeOverprintA; }
|
|
86
|
-
void setOverprintMode(int overprintModeA) { overprintMode = overprintModeA; }
|
|
87
|
-
|
|
88
|
-
// Set the transfer function.
|
|
89
|
-
void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray);
|
|
90
|
-
|
|
91
|
-
private:
|
|
92
|
-
explicit SplashState(const SplashState *state);
|
|
93
|
-
|
|
94
|
-
SplashCoord matrix[6];
|
|
95
|
-
SplashPattern *strokePattern;
|
|
96
|
-
SplashPattern *fillPattern;
|
|
97
|
-
SplashScreen *screen;
|
|
98
|
-
SplashBlendFunc blendFunc;
|
|
99
|
-
SplashCoord strokeAlpha;
|
|
100
|
-
SplashCoord fillAlpha;
|
|
101
|
-
bool multiplyPatternAlpha;
|
|
102
|
-
SplashCoord patternStrokeAlpha;
|
|
103
|
-
SplashCoord patternFillAlpha;
|
|
104
|
-
SplashCoord lineWidth;
|
|
105
|
-
int lineCap;
|
|
106
|
-
int lineJoin;
|
|
107
|
-
SplashCoord miterLimit;
|
|
108
|
-
SplashCoord flatness;
|
|
109
|
-
SplashCoord *lineDash;
|
|
110
|
-
int lineDashLength;
|
|
111
|
-
SplashCoord lineDashPhase;
|
|
112
|
-
bool strokeAdjust;
|
|
113
|
-
SplashClip *clip;
|
|
114
|
-
SplashBitmap *softMask;
|
|
115
|
-
bool deleteSoftMask;
|
|
116
|
-
bool inNonIsolatedGroup;
|
|
117
|
-
bool fillOverprint;
|
|
118
|
-
bool strokeOverprint;
|
|
119
|
-
int overprintMode;
|
|
120
|
-
unsigned char rgbTransferR[256], rgbTransferG[256], rgbTransferB[256];
|
|
121
|
-
unsigned char grayTransfer[256];
|
|
122
|
-
unsigned char cmykTransferC[256], cmykTransferM[256], cmykTransferY[256], cmykTransferK[256];
|
|
123
|
-
unsigned char deviceNTransfer[SPOT_NCOMPS + 4][256];
|
|
124
|
-
unsigned int overprintMask;
|
|
125
|
-
bool overprintAdditive;
|
|
126
|
-
|
|
127
|
-
SplashState *next; // used by Splash class
|
|
128
|
-
|
|
129
|
-
friend class Splash;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
#endif
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// SplashTypes.h
|
|
4
|
-
//
|
|
5
|
-
//========================================================================
|
|
6
|
-
|
|
7
|
-
//========================================================================
|
|
8
|
-
//
|
|
9
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
10
|
-
//
|
|
11
|
-
// All changes made under the Poppler project to this file are licensed
|
|
12
|
-
// under GPL version 2 or later
|
|
13
|
-
//
|
|
14
|
-
// Copyright (C) 2006, 2010, 2019, 2020 Albert Astals Cid <aacid@kde.org>
|
|
15
|
-
// Copyright (C) 2008 Tomas Are Haavet <tomasare@gmail.com>
|
|
16
|
-
// Copyright (C) 2009, 2011-2013 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
17
|
-
// Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
|
|
18
|
-
// Copyright (C) 2010 William Bader <williambader@hotmail.com>
|
|
19
|
-
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
|
|
20
|
-
// Copyright (C) 2018 Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
|
21
|
-
//
|
|
22
|
-
// To see a description of the changes please see the Changelog file that
|
|
23
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
24
|
-
//
|
|
25
|
-
//========================================================================
|
|
26
|
-
|
|
27
|
-
#ifndef SPLASHTYPES_H
|
|
28
|
-
#define SPLASHTYPES_H
|
|
29
|
-
|
|
30
|
-
#include <cstddef>
|
|
31
|
-
|
|
32
|
-
//------------------------------------------------------------------------
|
|
33
|
-
// coordinates
|
|
34
|
-
//------------------------------------------------------------------------
|
|
35
|
-
|
|
36
|
-
#if defined(USE_FLOAT)
|
|
37
|
-
typedef float SplashCoord;
|
|
38
|
-
#else
|
|
39
|
-
typedef double SplashCoord;
|
|
40
|
-
#endif
|
|
41
|
-
|
|
42
|
-
//------------------------------------------------------------------------
|
|
43
|
-
// antialiasing
|
|
44
|
-
//------------------------------------------------------------------------
|
|
45
|
-
|
|
46
|
-
#define splashAASize 4
|
|
47
|
-
|
|
48
|
-
#ifndef SPOT_NCOMPS
|
|
49
|
-
# define SPOT_NCOMPS 4
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
//------------------------------------------------------------------------
|
|
53
|
-
// colors
|
|
54
|
-
//------------------------------------------------------------------------
|
|
55
|
-
|
|
56
|
-
enum SplashColorMode
|
|
57
|
-
{
|
|
58
|
-
splashModeMono1, // 1 bit per component, 8 pixels per byte,
|
|
59
|
-
// MSbit is on the left
|
|
60
|
-
splashModeMono8, // 1 byte per component, 1 byte per pixel
|
|
61
|
-
splashModeRGB8, // 1 byte per component, 3 bytes per pixel:
|
|
62
|
-
// RGBRGB...
|
|
63
|
-
splashModeBGR8, // 1 byte per component, 3 bytes per pixel:
|
|
64
|
-
// BGRBGR...
|
|
65
|
-
splashModeXBGR8, // 1 byte per component, 4 bytes per pixel:
|
|
66
|
-
// XBGRXBGR...
|
|
67
|
-
splashModeCMYK8, // 1 byte per component, 4 bytes per pixel:
|
|
68
|
-
// CMYKCMYK...
|
|
69
|
-
splashModeDeviceN8 // 1 byte per component,
|
|
70
|
-
// 4 bytes + n bytes spot colors per pixel:
|
|
71
|
-
// CMYKSSSSCMYKSSSS...
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
enum SplashThinLineMode
|
|
75
|
-
{
|
|
76
|
-
splashThinLineDefault, // if SA on: draw solid if requested line width, transformed into
|
|
77
|
-
// device space, is less than half a pixel and a shaped line else
|
|
78
|
-
splashThinLineSolid, // draw line solid at least with 1 pixel
|
|
79
|
-
splashThinLineShape // draw line shaped at least with 1 pixel
|
|
80
|
-
};
|
|
81
|
-
// number of components in each color mode
|
|
82
|
-
// (defined in SplashState.cc)
|
|
83
|
-
extern int splashColorModeNComps[];
|
|
84
|
-
|
|
85
|
-
// max number of components in any SplashColor
|
|
86
|
-
constexpr std::size_t splashMaxColorComps = SPOT_NCOMPS + 4;
|
|
87
|
-
|
|
88
|
-
typedef unsigned char SplashColor[splashMaxColorComps];
|
|
89
|
-
typedef unsigned char *SplashColorPtr;
|
|
90
|
-
typedef const unsigned char *SplashColorConstPtr;
|
|
91
|
-
|
|
92
|
-
// RGB8
|
|
93
|
-
static inline unsigned char splashRGB8R(SplashColorPtr rgb8)
|
|
94
|
-
{
|
|
95
|
-
return rgb8[0];
|
|
96
|
-
}
|
|
97
|
-
static inline unsigned char splashRGB8G(SplashColorPtr rgb8)
|
|
98
|
-
{
|
|
99
|
-
return rgb8[1];
|
|
100
|
-
}
|
|
101
|
-
static inline unsigned char splashRGB8B(SplashColorPtr rgb8)
|
|
102
|
-
{
|
|
103
|
-
return rgb8[2];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// BGR8
|
|
107
|
-
static inline unsigned char splashBGR8R(SplashColorPtr bgr8)
|
|
108
|
-
{
|
|
109
|
-
return bgr8[2];
|
|
110
|
-
}
|
|
111
|
-
static inline unsigned char splashBGR8G(SplashColorPtr bgr8)
|
|
112
|
-
{
|
|
113
|
-
return bgr8[1];
|
|
114
|
-
}
|
|
115
|
-
static inline unsigned char splashBGR8B(SplashColorPtr bgr8)
|
|
116
|
-
{
|
|
117
|
-
return bgr8[0];
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// CMYK8
|
|
121
|
-
static inline unsigned char splashCMYK8C(SplashColorPtr cmyk8)
|
|
122
|
-
{
|
|
123
|
-
return cmyk8[0];
|
|
124
|
-
}
|
|
125
|
-
static inline unsigned char splashCMYK8M(SplashColorPtr cmyk8)
|
|
126
|
-
{
|
|
127
|
-
return cmyk8[1];
|
|
128
|
-
}
|
|
129
|
-
static inline unsigned char splashCMYK8Y(SplashColorPtr cmyk8)
|
|
130
|
-
{
|
|
131
|
-
return cmyk8[2];
|
|
132
|
-
}
|
|
133
|
-
static inline unsigned char splashCMYK8K(SplashColorPtr cmyk8)
|
|
134
|
-
{
|
|
135
|
-
return cmyk8[3];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// DEVICEN8
|
|
139
|
-
static inline unsigned char splashDeviceN8C(SplashColorPtr deviceN8)
|
|
140
|
-
{
|
|
141
|
-
return deviceN8[0];
|
|
142
|
-
}
|
|
143
|
-
static inline unsigned char splashDeviceN8M(SplashColorPtr deviceN8)
|
|
144
|
-
{
|
|
145
|
-
return deviceN8[1];
|
|
146
|
-
}
|
|
147
|
-
static inline unsigned char splashDeviceN8Y(SplashColorPtr deviceN8)
|
|
148
|
-
{
|
|
149
|
-
return deviceN8[2];
|
|
150
|
-
}
|
|
151
|
-
static inline unsigned char splashDeviceN8K(SplashColorPtr deviceN8)
|
|
152
|
-
{
|
|
153
|
-
return deviceN8[3];
|
|
154
|
-
}
|
|
155
|
-
static inline unsigned char splashDeviceN8S(SplashColorPtr deviceN8, int nSpot)
|
|
156
|
-
{
|
|
157
|
-
return deviceN8[4 + nSpot];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
static inline void splashClearColor(SplashColorPtr dest)
|
|
161
|
-
{
|
|
162
|
-
dest[0] = 0;
|
|
163
|
-
dest[1] = 0;
|
|
164
|
-
dest[2] = 0;
|
|
165
|
-
dest[3] = 0;
|
|
166
|
-
for (int i = 4; i < SPOT_NCOMPS + 4; i++) {
|
|
167
|
-
dest[i] = 0;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
static inline void splashColorCopy(SplashColorPtr dest, SplashColorConstPtr src)
|
|
172
|
-
{
|
|
173
|
-
dest[0] = src[0];
|
|
174
|
-
dest[1] = src[1];
|
|
175
|
-
dest[2] = src[2];
|
|
176
|
-
dest[3] = src[3];
|
|
177
|
-
for (int i = 4; i < SPOT_NCOMPS + 4; i++) {
|
|
178
|
-
dest[i] = src[i];
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
static inline bool splashColorEqual(SplashColorConstPtr dest, SplashColorConstPtr src)
|
|
183
|
-
{
|
|
184
|
-
for (int i = 0; i < SPOT_NCOMPS + 4; i++) {
|
|
185
|
-
if (dest[i] != src[i]) {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return true;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
static inline void splashColorXor(SplashColorPtr dest, SplashColorConstPtr src)
|
|
193
|
-
{
|
|
194
|
-
dest[0] ^= src[0];
|
|
195
|
-
dest[1] ^= src[1];
|
|
196
|
-
dest[2] ^= src[2];
|
|
197
|
-
dest[3] ^= src[3];
|
|
198
|
-
for (int i = 4; i < SPOT_NCOMPS + 4; i++) {
|
|
199
|
-
dest[i] ^= src[i];
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
//------------------------------------------------------------------------
|
|
204
|
-
// blend functions
|
|
205
|
-
//------------------------------------------------------------------------
|
|
206
|
-
|
|
207
|
-
typedef void (*SplashBlendFunc)(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm);
|
|
208
|
-
|
|
209
|
-
//------------------------------------------------------------------------
|
|
210
|
-
// screen parameters
|
|
211
|
-
//------------------------------------------------------------------------
|
|
212
|
-
|
|
213
|
-
enum SplashScreenType
|
|
214
|
-
{
|
|
215
|
-
splashScreenDispersed,
|
|
216
|
-
splashScreenClustered,
|
|
217
|
-
splashScreenStochasticClustered
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
struct SplashScreenParams
|
|
221
|
-
{
|
|
222
|
-
SplashScreenType type;
|
|
223
|
-
int size;
|
|
224
|
-
int dotRadius;
|
|
225
|
-
SplashCoord gamma;
|
|
226
|
-
SplashCoord blackThreshold;
|
|
227
|
-
SplashCoord whiteThreshold;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
//------------------------------------------------------------------------
|
|
231
|
-
// error results
|
|
232
|
-
//------------------------------------------------------------------------
|
|
233
|
-
|
|
234
|
-
typedef int SplashError;
|
|
235
|
-
|
|
236
|
-
//------------------------------------------------------------------------
|
|
237
|
-
// image file formats
|
|
238
|
-
//------------------------------------------------------------------------
|
|
239
|
-
|
|
240
|
-
enum SplashImageFileFormat
|
|
241
|
-
{
|
|
242
|
-
splashFormatJpeg,
|
|
243
|
-
splashFormatPng,
|
|
244
|
-
splashFormatTiff,
|
|
245
|
-
splashFormatJpegCMYK
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
#endif
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// SplashXPath.h
|
|
4
|
-
//
|
|
5
|
-
//========================================================================
|
|
6
|
-
|
|
7
|
-
//========================================================================
|
|
8
|
-
//
|
|
9
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
10
|
-
//
|
|
11
|
-
// All changes made under the Poppler project to this file are licensed
|
|
12
|
-
// under GPL version 2 or later
|
|
13
|
-
//
|
|
14
|
-
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
15
|
-
// Copyright (C) 2018, 2021 Albert Astals Cid <aacid@kde.org>
|
|
16
|
-
//
|
|
17
|
-
// To see a description of the changes please see the Changelog file that
|
|
18
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
19
|
-
//
|
|
20
|
-
//========================================================================
|
|
21
|
-
|
|
22
|
-
#ifndef SPLASHXPATH_H
|
|
23
|
-
#define SPLASHXPATH_H
|
|
24
|
-
|
|
25
|
-
#include "SplashTypes.h"
|
|
26
|
-
|
|
27
|
-
class SplashPath;
|
|
28
|
-
struct SplashXPathAdjust;
|
|
29
|
-
|
|
30
|
-
//------------------------------------------------------------------------
|
|
31
|
-
|
|
32
|
-
#define splashMaxCurveSplits (1 << 10)
|
|
33
|
-
|
|
34
|
-
//------------------------------------------------------------------------
|
|
35
|
-
// SplashXPathSeg
|
|
36
|
-
//------------------------------------------------------------------------
|
|
37
|
-
|
|
38
|
-
struct SplashXPathSeg
|
|
39
|
-
{
|
|
40
|
-
SplashCoord x0, y0; // first endpoint
|
|
41
|
-
SplashCoord x1, y1; // second endpoint
|
|
42
|
-
SplashCoord dxdy; // slope: delta-x / delta-y
|
|
43
|
-
SplashCoord dydx; // slope: delta-y / delta-x
|
|
44
|
-
unsigned int flags;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
#define splashXPathHoriz \
|
|
48
|
-
0x01 // segment is vertical (y0 == y1)
|
|
49
|
-
// (dxdy is undef)
|
|
50
|
-
#define splashXPathVert \
|
|
51
|
-
0x02 // segment is horizontal (x0 == x1)
|
|
52
|
-
// (dydx is undef)
|
|
53
|
-
#define splashXPathFlip 0x04 // y0 > y1
|
|
54
|
-
|
|
55
|
-
//------------------------------------------------------------------------
|
|
56
|
-
// SplashXPath
|
|
57
|
-
//------------------------------------------------------------------------
|
|
58
|
-
|
|
59
|
-
class SplashXPath
|
|
60
|
-
{
|
|
61
|
-
public:
|
|
62
|
-
// Expands (converts to segments) and flattens (converts curves to
|
|
63
|
-
// lines) <path>. Transforms all points from user space to device
|
|
64
|
-
// space, via <matrix>. If <closeSubpaths> is true, closes all open
|
|
65
|
-
// subpaths.
|
|
66
|
-
SplashXPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness, bool closeSubpaths, bool adjustLines = false, int linePosI = 0);
|
|
67
|
-
|
|
68
|
-
~SplashXPath();
|
|
69
|
-
|
|
70
|
-
SplashXPath(const SplashXPath &) = delete;
|
|
71
|
-
SplashXPath &operator=(const SplashXPath &) = delete;
|
|
72
|
-
|
|
73
|
-
// Multiply all coordinates by splashAASize, in preparation for
|
|
74
|
-
// anti-aliased rendering.
|
|
75
|
-
void aaScale();
|
|
76
|
-
|
|
77
|
-
// Sort by upper coordinate (lower y), in y-major order.
|
|
78
|
-
void sort();
|
|
79
|
-
|
|
80
|
-
protected:
|
|
81
|
-
void transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo);
|
|
82
|
-
void strokeAdjust(SplashXPathAdjust *adjust, SplashCoord *xp, SplashCoord *yp);
|
|
83
|
-
void grow(int nSegs);
|
|
84
|
-
void addCurve(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1, SplashCoord x2, SplashCoord y2, SplashCoord x3, SplashCoord y3, SplashCoord flatness, bool first, bool last, bool end0, bool end1);
|
|
85
|
-
void addSegment(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1);
|
|
86
|
-
|
|
87
|
-
SplashXPathSeg *segs;
|
|
88
|
-
int length, size; // length and size of segs array
|
|
89
|
-
|
|
90
|
-
friend class SplashXPathScanner;
|
|
91
|
-
friend class SplashClip;
|
|
92
|
-
friend class Splash;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
#endif
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// SplashXPathScanner.h
|
|
4
|
-
//
|
|
5
|
-
//========================================================================
|
|
6
|
-
|
|
7
|
-
//========================================================================
|
|
8
|
-
//
|
|
9
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
10
|
-
//
|
|
11
|
-
// All changes made under the Poppler project to this file are licensed
|
|
12
|
-
// under GPL version 2 or later
|
|
13
|
-
//
|
|
14
|
-
// Copyright (C) 2013, 2014, 2021 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
15
|
-
// Copyright (C) 2018, 2021 Albert Astals Cid <aacid@kde.org>
|
|
16
|
-
// Copyright (C) 2018 Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
|
17
|
-
//
|
|
18
|
-
// To see a description of the changes please see the Changelog file that
|
|
19
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
20
|
-
//
|
|
21
|
-
//========================================================================
|
|
22
|
-
|
|
23
|
-
#ifndef SPLASHXPATHSCANNER_H
|
|
24
|
-
#define SPLASHXPATHSCANNER_H
|
|
25
|
-
|
|
26
|
-
#include "SplashTypes.h"
|
|
27
|
-
|
|
28
|
-
#include <poppler-config.h>
|
|
29
|
-
|
|
30
|
-
#ifdef USE_BOOST_HEADERS
|
|
31
|
-
# include <boost/container/small_vector.hpp>
|
|
32
|
-
#endif
|
|
33
|
-
|
|
34
|
-
#include <vector>
|
|
35
|
-
|
|
36
|
-
class SplashXPath;
|
|
37
|
-
class SplashBitmap;
|
|
38
|
-
|
|
39
|
-
struct SplashIntersect
|
|
40
|
-
{
|
|
41
|
-
int y;
|
|
42
|
-
int x0, x1; // intersection of segment with [y, y+1)
|
|
43
|
-
int count; // EO/NZWN counter increment
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
//------------------------------------------------------------------------
|
|
47
|
-
// SplashXPathScanner
|
|
48
|
-
//------------------------------------------------------------------------
|
|
49
|
-
|
|
50
|
-
class SplashXPathScanner
|
|
51
|
-
{
|
|
52
|
-
public:
|
|
53
|
-
// Create a new SplashXPathScanner object. <xPathA> must be sorted.
|
|
54
|
-
SplashXPathScanner(const SplashXPath &xPath, bool eoA, int clipYMin, int clipYMax);
|
|
55
|
-
|
|
56
|
-
~SplashXPathScanner();
|
|
57
|
-
|
|
58
|
-
SplashXPathScanner(const SplashXPathScanner &) = delete;
|
|
59
|
-
SplashXPathScanner &operator=(const SplashXPathScanner &) = delete;
|
|
60
|
-
|
|
61
|
-
// Return the path's bounding box.
|
|
62
|
-
void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA) const
|
|
63
|
-
{
|
|
64
|
-
*xMinA = xMin;
|
|
65
|
-
*yMinA = yMin;
|
|
66
|
-
*xMaxA = xMax;
|
|
67
|
-
*yMaxA = yMax;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Return the path's bounding box.
|
|
71
|
-
void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA) const;
|
|
72
|
-
|
|
73
|
-
// Returns true if at least part of the path was outside the
|
|
74
|
-
// clipYMin/clipYMax bounds passed to the constructor.
|
|
75
|
-
bool hasPartialClip() const { return partialClip; }
|
|
76
|
-
|
|
77
|
-
// Return the min/max x values for the span at <y>.
|
|
78
|
-
void getSpanBounds(int y, int *spanXMin, int *spanXMax) const;
|
|
79
|
-
|
|
80
|
-
// Returns true if (<x>,<y>) is inside the path.
|
|
81
|
-
bool test(int x, int y) const;
|
|
82
|
-
|
|
83
|
-
// Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
|
|
84
|
-
// path.
|
|
85
|
-
bool testSpan(int x0, int x1, int y) const;
|
|
86
|
-
|
|
87
|
-
// Renders one anti-aliased line into <aaBuf>. Returns the min and
|
|
88
|
-
// max x coordinates with non-zero pixels in <x0> and <x1>.
|
|
89
|
-
void renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y, bool adjustVertLine = false) const;
|
|
90
|
-
|
|
91
|
-
// Clips an anti-aliased line by setting pixels to zero. On entry,
|
|
92
|
-
// all non-zero pixels are between <x0> and <x1>. This function
|
|
93
|
-
// will update <x0> and <x1>.
|
|
94
|
-
void clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y) const;
|
|
95
|
-
|
|
96
|
-
private:
|
|
97
|
-
void computeIntersections(const SplashXPath &xPath);
|
|
98
|
-
bool addIntersection(double segYMin, double segYMax, int y, int x0, int x1, int count);
|
|
99
|
-
|
|
100
|
-
bool eo;
|
|
101
|
-
int xMin, yMin, xMax, yMax;
|
|
102
|
-
bool partialClip;
|
|
103
|
-
|
|
104
|
-
#ifdef USE_BOOST_HEADERS
|
|
105
|
-
typedef boost::container::small_vector<SplashIntersect, 4> IntersectionLine;
|
|
106
|
-
#else
|
|
107
|
-
typedef std::vector<SplashIntersect> IntersectionLine;
|
|
108
|
-
#endif
|
|
109
|
-
std::vector<IntersectionLine> allIntersections;
|
|
110
|
-
|
|
111
|
-
friend class SplashXPathScanIterator;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
class SplashXPathScanIterator
|
|
115
|
-
{
|
|
116
|
-
public:
|
|
117
|
-
SplashXPathScanIterator(const SplashXPathScanner &scanner, int y);
|
|
118
|
-
|
|
119
|
-
// Returns the next span inside the path at the current y position
|
|
120
|
-
// Returns false if there are no more spans.
|
|
121
|
-
bool getNextSpan(int *x0, int *x1);
|
|
122
|
-
|
|
123
|
-
private:
|
|
124
|
-
#ifdef USE_BOOST_HEADERS
|
|
125
|
-
typedef boost::container::small_vector<SplashIntersect, 4> IntersectionLine;
|
|
126
|
-
#else
|
|
127
|
-
typedef std::vector<SplashIntersect> IntersectionLine;
|
|
128
|
-
#endif
|
|
129
|
-
const IntersectionLine &line;
|
|
130
|
-
|
|
131
|
-
size_t interIdx; // current index into <line>
|
|
132
|
-
int interCount; // current EO/NZWN counter
|
|
133
|
-
const bool eo;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
#endif
|