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.
Files changed (176) hide show
  1. package/README.md +2 -0
  2. package/package.json +13 -13
  3. package/src/index.js +20 -8
  4. package/API.md +0 -465
  5. package/CHANGELOG.md +0 -976
  6. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Annot.h +0 -1783
  7. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/AnnotStampImageHelper.h +0 -68
  8. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Array.h +0 -92
  9. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/BBoxOutputDev.h +0 -54
  10. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CMap.h +0 -128
  11. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CachedFile.h +0 -149
  12. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoFontEngine.h +0 -122
  13. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoOutputDev.h +0 -468
  14. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoRescaleBox.h +0 -60
  15. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Catalog.h +0 -318
  16. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CertificateInfo.h +0 -129
  17. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharCodeToUnicode.h +0 -143
  18. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharTypes.h +0 -24
  19. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlCachedFile.h +0 -37
  20. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlPDFDocBuilder.h +0 -32
  21. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/DateInfo.h +0 -44
  22. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Decrypt.h +0 -147
  23. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Dict.h +0 -126
  24. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Error.h +0 -59
  25. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ErrorCodes.h +0 -54
  26. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FDPDFDocBuilder.h +0 -36
  27. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FILECacheLoader.h +0 -34
  28. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FileSpec.h +0 -85
  29. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontEncodingTables.h +0 -20
  30. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontInfo.h +0 -109
  31. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Form.h +0 -734
  32. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Function.h +0 -251
  33. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Gfx.h +0 -373
  34. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxFont.h +0 -466
  35. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState.h +0 -1759
  36. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState_helpers.h +0 -90
  37. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GlobalParams.h +0 -221
  38. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Hints.h +0 -91
  39. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JArithmeticDecoder.h +0 -131
  40. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JBIG2Stream.h +0 -130
  41. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JPEG2000Stream.h +0 -54
  42. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JSInfo.h +0 -65
  43. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Lexer.h +0 -113
  44. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Linearization.h +0 -43
  45. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Link.h +0 -566
  46. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/LocalPDFDocBuilder.h +0 -32
  47. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/MarkedContentOutputDev.h +0 -132
  48. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Movie.h +0 -123
  49. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToCharCode.h +0 -52
  50. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToUnicodeTable.h +0 -4300
  51. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Object.h +0 -678
  52. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OptionalContent.h +0 -117
  53. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Outline.h +0 -122
  54. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OutputDev.h +0 -379
  55. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDoc.h +0 -419
  56. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocBuilder.h +0 -47
  57. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocEncoding.h +0 -43
  58. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocFactory.h +0 -58
  59. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSOutputDev.h +0 -549
  60. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSTokenizer.h +0 -47
  61. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Page.h +0 -273
  62. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PageTransition.h +0 -105
  63. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Parser.h +0 -76
  64. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PopplerCache.h +0 -65
  65. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PreScanOutputDev.h +0 -148
  66. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ProfileData.h +0 -35
  67. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Rendition.h +0 -164
  68. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SecurityHandler.h +0 -131
  69. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Sound.h +0 -82
  70. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SplashOutputDev.h +0 -413
  71. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream-CCITT.h +0 -334
  72. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream.h +0 -1504
  73. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructElement.h +0 -406
  74. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructTreeRoot.h +0 -89
  75. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/TextOutputDev.h +0 -918
  76. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UTF.h +0 -112
  77. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCClassTables.h +0 -983
  78. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCompTables.h +0 -328
  79. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeDecompTables.h +0 -7181
  80. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMap.h +0 -128
  81. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapFuncs.h +0 -35
  82. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapTables.h +0 -84
  83. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeTypeTable.h +0 -49
  84. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ViewerPreferences.h +0 -87
  85. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/XRef.h +0 -325
  86. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-destination.h +0 -69
  87. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-document.h +0 -135
  88. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-embedded-file.h +0 -55
  89. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font-private.h +0 -68
  90. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font.h +0 -95
  91. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-global.h +0 -132
  92. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-image.h +0 -74
  93. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-renderer.h +0 -77
  94. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-transition.h +0 -85
  95. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page.h +0 -225
  96. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-rectangle.h +0 -66
  97. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-toc.h +0 -72
  98. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-version.h +0 -39
  99. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler_cpp_export.h +0 -42
  100. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiBase.h +0 -66
  101. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiEncodings.h +0 -43
  102. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiIdentifier.h +0 -52
  103. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiTrueType.h +0 -190
  104. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1.h +0 -70
  105. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1C.h +0 -263
  106. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-action.h +0 -454
  107. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-annot.h +0 -333
  108. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-attachment.h +0 -123
  109. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-date.h +0 -32
  110. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-document.h +0 -541
  111. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-enums.h +0 -191
  112. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-features.h +0 -88
  113. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-form-field.h +0 -254
  114. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-layer.h +0 -50
  115. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-macros.h +0 -42
  116. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-media.h +0 -80
  117. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-movie.h +0 -81
  118. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-page.h +0 -424
  119. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-structure-element.h +0 -425
  120. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler.h +0 -259
  121. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooCheckedOps.h +0 -116
  122. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooLikely.h +0 -22
  123. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooString.h +0 -262
  124. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooTimer.h +0 -59
  125. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/ImgWriter.h +0 -39
  126. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/JpegWriter.h +0 -69
  127. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/PNGWriter.h +0 -68
  128. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/TiffWriter.h +0 -70
  129. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gdir.h +0 -96
  130. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gfile.h +0 -156
  131. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gmem.h +0 -201
  132. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/grandom.h +0 -21
  133. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gstrtod.h +0 -45
  134. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler-config.h +0 -155
  135. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler_private_export.h +0 -42
  136. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/Splash.h +0 -336
  137. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashBitmap.h +0 -127
  138. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashClip.h +0 -131
  139. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashErrorCodes.h +0 -50
  140. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFont.h +0 -71
  141. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontEngine.h +0 -72
  142. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontFile.h +0 -64
  143. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFont.h +0 -116
  144. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontEngine.h +0 -89
  145. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFile.h +0 -98
  146. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFileID.h +0 -40
  147. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashGlyphBitmap.h +0 -23
  148. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashMath.h +0 -215
  149. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPath.h +0 -138
  150. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPattern.h +0 -107
  151. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashScreen.h +0 -87
  152. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashState.h +0 -132
  153. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashTypes.h +0 -248
  154. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPath.h +0 -95
  155. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPathScanner.h +0 -136
  156. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-cpp.pc +0 -12
  157. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-glib.pc +0 -12
  158. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler.pc +0 -10
  159. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-cpp.lib +0 -0
  160. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-glib.lib +0 -0
  161. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler.lib +0 -0
  162. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfattach.1 +0 -60
  163. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfdetach.1 +0 -94
  164. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdffonts.1 +0 -128
  165. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfimages.1 +0 -265
  166. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfinfo.1 +0 -198
  167. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfseparate.1 +0 -60
  168. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftocairo.1 +0 -346
  169. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftohtml.1 +0 -118
  170. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftoppm.1 +0 -230
  171. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftops.1 +0 -267
  172. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftotext.1 +0 -157
  173. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfunite.1 +0 -43
  174. package/src/lib/win32/poppler-22.04.0/share/poppler/CMakeLists.txt +0 -309
  175. package/src/lib/win32/poppler-22.04.0/share/poppler/Makefile +0 -333
  176. package/tsconfig.json +0 -9
@@ -1,251 +0,0 @@
1
- //========================================================================
2
- //
3
- // Function.h
4
- //
5
- // Copyright 2001-2003 Glyph & Cog, LLC
6
- //
7
- //========================================================================
8
-
9
- //========================================================================
10
- //
11
- // Modified under the Poppler project - http://poppler.freedesktop.org
12
- //
13
- // All changes made under the Poppler project to this file are licensed
14
- // under GPL version 2 or later
15
- //
16
- // Copyright (C) 2009, 2010, 2018, 2019, 2021 Albert Astals Cid <aacid@kde.org>
17
- // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com>
18
- // Copyright (C) 2011 Andrea Canciani <ranma42@gmail.com>
19
- // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
20
- // Copyright (C) 2012 Adam Reichold <adamreichold@myopera.com>
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 FUNCTION_H
28
- #define FUNCTION_H
29
-
30
- #include "Object.h"
31
- #include <set>
32
-
33
- class Dict;
34
- class Stream;
35
- struct PSObject;
36
- class PSStack;
37
-
38
- //------------------------------------------------------------------------
39
- // Function
40
- //------------------------------------------------------------------------
41
-
42
- #define funcMaxInputs 32
43
- #define funcMaxOutputs 32
44
- #define sampledFuncMaxInputs 16
45
-
46
- class POPPLER_PRIVATE_EXPORT Function
47
- {
48
- public:
49
- Function();
50
-
51
- virtual ~Function();
52
-
53
- Function(const Function &) = delete;
54
- Function &operator=(const Function &other) = delete;
55
-
56
- // Construct a function. Returns NULL if unsuccessful.
57
- static Function *parse(Object *funcObj);
58
-
59
- // Initialize the entries common to all function types.
60
- bool init(Dict *dict);
61
-
62
- virtual Function *copy() const = 0;
63
-
64
- // Return the function type:
65
- // -1 : identity
66
- // 0 : sampled
67
- // 2 : exponential
68
- // 3 : stitching
69
- // 4 : PostScript
70
- virtual int getType() const = 0;
71
-
72
- // Return size of input and output tuples.
73
- int getInputSize() const { return m; }
74
- int getOutputSize() const { return n; }
75
-
76
- double getDomainMin(int i) const { return domain[i][0]; }
77
- double getDomainMax(int i) const { return domain[i][1]; }
78
- double getRangeMin(int i) const { return range[i][0]; }
79
- double getRangeMax(int i) const { return range[i][1]; }
80
- bool getHasRange() const { return hasRange; }
81
- virtual bool hasDifferentResultSet(const Function *func) const { return false; }
82
-
83
- // Transform an input tuple into an output tuple.
84
- virtual void transform(const double *in, double *out) const = 0;
85
-
86
- virtual bool isOk() const = 0;
87
-
88
- protected:
89
- static Function *parse(Object *funcObj, std::set<int> *usedParents);
90
-
91
- explicit Function(const Function *func);
92
-
93
- int m, n; // size of input and output tuples
94
- double // min and max values for function domain
95
- domain[funcMaxInputs][2];
96
- double // min and max values for function range
97
- range[funcMaxOutputs][2];
98
- bool hasRange; // set if range is defined
99
- };
100
-
101
- //------------------------------------------------------------------------
102
- // IdentityFunction
103
- //------------------------------------------------------------------------
104
-
105
- class IdentityFunction : public Function
106
- {
107
- public:
108
- IdentityFunction();
109
- ~IdentityFunction() override;
110
- Function *copy() const override { return new IdentityFunction(); }
111
- int getType() const override { return -1; }
112
- void transform(const double *in, double *out) const override;
113
- bool isOk() const override { return true; }
114
-
115
- private:
116
- };
117
-
118
- //------------------------------------------------------------------------
119
- // SampledFunction
120
- //------------------------------------------------------------------------
121
-
122
- class SampledFunction : public Function
123
- {
124
- public:
125
- SampledFunction(Object *funcObj, Dict *dict);
126
- ~SampledFunction() override;
127
- Function *copy() const override { return new SampledFunction(this); }
128
- int getType() const override { return 0; }
129
- void transform(const double *in, double *out) const override;
130
- bool isOk() const override { return ok; }
131
- bool hasDifferentResultSet(const Function *func) const override;
132
-
133
- int getSampleSize(int i) const { return sampleSize[i]; }
134
- double getEncodeMin(int i) const { return encode[i][0]; }
135
- double getEncodeMax(int i) const { return encode[i][1]; }
136
- double getDecodeMin(int i) const { return decode[i][0]; }
137
- double getDecodeMax(int i) const { return decode[i][1]; }
138
- const double *getSamples() const { return samples; }
139
- int getSampleNumber() const { return nSamples; }
140
-
141
- private:
142
- explicit SampledFunction(const SampledFunction *func);
143
-
144
- int // number of samples for each domain element
145
- sampleSize[funcMaxInputs];
146
- double // min and max values for domain encoder
147
- encode[funcMaxInputs][2];
148
- double // min and max values for range decoder
149
- decode[funcMaxOutputs][2];
150
- double // input multipliers
151
- inputMul[funcMaxInputs];
152
- int *idxOffset;
153
- double *samples; // the samples
154
- int nSamples; // size of the samples array
155
- double *sBuf; // buffer for the transform function
156
- mutable double cacheIn[funcMaxInputs];
157
- mutable double cacheOut[funcMaxOutputs];
158
- bool ok;
159
- };
160
-
161
- //------------------------------------------------------------------------
162
- // ExponentialFunction
163
- //------------------------------------------------------------------------
164
-
165
- class ExponentialFunction : public Function
166
- {
167
- public:
168
- ExponentialFunction(Object *funcObj, Dict *dict);
169
- ~ExponentialFunction() override;
170
- Function *copy() const override { return new ExponentialFunction(this); }
171
- int getType() const override { return 2; }
172
- void transform(const double *in, double *out) const override;
173
- bool isOk() const override { return ok; }
174
-
175
- const double *getC0() const { return c0; }
176
- const double *getC1() const { return c1; }
177
- double getE() const { return e; }
178
-
179
- private:
180
- explicit ExponentialFunction(const ExponentialFunction *func);
181
-
182
- double c0[funcMaxOutputs];
183
- double c1[funcMaxOutputs];
184
- double e;
185
- bool isLinear;
186
- bool ok;
187
- };
188
-
189
- //------------------------------------------------------------------------
190
- // StitchingFunction
191
- //------------------------------------------------------------------------
192
-
193
- class StitchingFunction : public Function
194
- {
195
- public:
196
- StitchingFunction(Object *funcObj, Dict *dict, std::set<int> *usedParents);
197
- ~StitchingFunction() override;
198
- Function *copy() const override { return new StitchingFunction(this); }
199
- int getType() const override { return 3; }
200
- void transform(const double *in, double *out) const override;
201
- bool isOk() const override { return ok; }
202
-
203
- int getNumFuncs() const { return k; }
204
- const Function *getFunc(int i) const { return funcs[i]; }
205
- const double *getBounds() const { return bounds; }
206
- const double *getEncode() const { return encode; }
207
- const double *getScale() const { return scale; }
208
-
209
- private:
210
- explicit StitchingFunction(const StitchingFunction *func);
211
-
212
- int k;
213
- Function **funcs;
214
- double *bounds;
215
- double *encode;
216
- double *scale;
217
- bool ok;
218
- };
219
-
220
- //------------------------------------------------------------------------
221
- // PostScriptFunction
222
- //------------------------------------------------------------------------
223
-
224
- class PostScriptFunction : public Function
225
- {
226
- public:
227
- PostScriptFunction(Object *funcObj, Dict *dict);
228
- ~PostScriptFunction() override;
229
- Function *copy() const override { return new PostScriptFunction(this); }
230
- int getType() const override { return 4; }
231
- void transform(const double *in, double *out) const override;
232
- bool isOk() const override { return ok; }
233
-
234
- const GooString *getCodeString() const { return codeString; }
235
-
236
- private:
237
- explicit PostScriptFunction(const PostScriptFunction *func);
238
- bool parseCode(Stream *str, int *codePtr);
239
- GooString getToken(Stream *str);
240
- void resizeCode(int newSize);
241
- void exec(PSStack *stack, int codePtr) const;
242
-
243
- GooString *codeString;
244
- PSObject *code;
245
- int codeSize;
246
- mutable double cacheIn[funcMaxInputs];
247
- mutable double cacheOut[funcMaxOutputs];
248
- bool ok;
249
- };
250
-
251
- #endif
@@ -1,373 +0,0 @@
1
- //========================================================================
2
- //
3
- // Gfx.h
4
- //
5
- // Copyright 1996-2003 Glyph & Cog, LLC
6
- //
7
- //========================================================================
8
-
9
- //========================================================================
10
- //
11
- // Modified under the Poppler project - http://poppler.freedesktop.org
12
- //
13
- // All changes made under the Poppler project to this file are licensed
14
- // under GPL version 2 or later
15
- //
16
- // Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
17
- // Copyright (C) 2007 Iñigo Martínez <inigomartinez@gmail.com>
18
- // Copyright (C) 2008 Brad Hards <bradh@kde.org>
19
- // Copyright (C) 2008, 2010 Carlos Garcia Campos <carlosgc@gnome.org>
20
- // Copyright (C) 2009-2013, 2017, 2018, 2021 Albert Astals Cid <aacid@kde.org>
21
- // Copyright (C) 2009, 2010, 2012, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
22
- // Copyright (C) 2010 David Benjamin <davidben@mit.edu>
23
- // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com>
24
- // Copyright (C) 2013 Fabio D'Urso <fabiodurso@hotmail.it>
25
- // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
26
- // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
27
- // Copyright (C) 2019, 2022 Oliver Sander <oliver.sander@tu-dresden.de>
28
- // Copyright (C) 2019 Volker Krause <vkrause@kde.org>
29
- //
30
- // To see a description of the changes please see the Changelog file that
31
- // came with your tarball or type make ChangeLog if you are building from git
32
- //
33
- //========================================================================
34
-
35
- #ifndef GFX_H
36
- #define GFX_H
37
-
38
- #include "poppler-config.h"
39
- #include "poppler_private_export.h"
40
- #include "GfxState.h"
41
- #include "Object.h"
42
- #include "PopplerCache.h"
43
-
44
- #include <vector>
45
-
46
- class GooString;
47
- class PDFDoc;
48
- class XRef;
49
- class Array;
50
- class Stream;
51
- class Parser;
52
- class Dict;
53
- class Function;
54
- class OutputDev;
55
- class GfxFontDict;
56
- class GfxFont;
57
- class GfxPattern;
58
- class GfxTilingPattern;
59
- class GfxShadingPattern;
60
- class GfxShading;
61
- class GfxFunctionShading;
62
- class GfxAxialShading;
63
- class GfxRadialShading;
64
- class GfxGouraudTriangleShading;
65
- class GfxPatchMeshShading;
66
- struct GfxPatch;
67
- class GfxState;
68
- struct GfxColor;
69
- class GfxColorSpace;
70
- class Gfx;
71
- class PDFRectangle;
72
- class AnnotBorder;
73
- class AnnotColor;
74
- class Catalog;
75
- struct MarkedContentStack;
76
-
77
- //------------------------------------------------------------------------
78
-
79
- enum GfxClipType
80
- {
81
- clipNone,
82
- clipNormal,
83
- clipEO
84
- };
85
-
86
- enum TchkType
87
- {
88
- tchkBool, // boolean
89
- tchkInt, // integer
90
- tchkNum, // number (integer or real)
91
- tchkString, // string
92
- tchkName, // name
93
- tchkArray, // array
94
- tchkProps, // properties (dictionary or name)
95
- tchkSCN, // scn/SCN args (number of name)
96
- tchkNone // used to avoid empty initializer lists
97
- };
98
-
99
- #define maxArgs 33
100
-
101
- struct Operator
102
- {
103
- char name[4];
104
- int numArgs;
105
- TchkType tchk[maxArgs];
106
- void (Gfx::*func)(Object args[], int numArgs);
107
- };
108
-
109
- //------------------------------------------------------------------------
110
-
111
- class POPPLER_PRIVATE_EXPORT GfxResources
112
- {
113
- public:
114
- GfxResources(XRef *xref, Dict *resDict, GfxResources *nextA);
115
- ~GfxResources();
116
-
117
- GfxResources(const GfxResources &) = delete;
118
- GfxResources &operator=(const GfxResources &other) = delete;
119
-
120
- std::shared_ptr<GfxFont> lookupFont(const char *name);
121
- std::shared_ptr<const GfxFont> lookupFont(const char *name) const;
122
- Object lookupXObject(const char *name);
123
- Object lookupXObjectNF(const char *name);
124
- Object lookupMarkedContentNF(const char *name);
125
- Object lookupColorSpace(const char *name);
126
- GfxPattern *lookupPattern(const char *name, OutputDev *out, GfxState *state);
127
- GfxShading *lookupShading(const char *name, OutputDev *out, GfxState *state);
128
- Object lookupGState(const char *name);
129
- Object lookupGStateNF(const char *name);
130
-
131
- GfxResources *getNext() const { return next; }
132
-
133
- private:
134
- std::shared_ptr<GfxFont> doLookupFont(const char *name) const;
135
-
136
- GfxFontDict *fonts;
137
- Object xObjDict;
138
- Object colorSpaceDict;
139
- Object patternDict;
140
- Object shadingDict;
141
- Object gStateDict;
142
- PopplerCache<Ref, Object> gStateCache;
143
- XRef *xref;
144
- Object propertiesDict;
145
- GfxResources *next;
146
- };
147
-
148
- //------------------------------------------------------------------------
149
- // Gfx
150
- //------------------------------------------------------------------------
151
-
152
- class POPPLER_PRIVATE_EXPORT Gfx
153
- {
154
- public:
155
- // Constructor for regular output.
156
- Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict, double hDPI, double vDPI, const PDFRectangle *box, const PDFRectangle *cropBox, int rotate, bool (*abortCheckCbkA)(void *data) = nullptr, void *abortCheckCbkDataA = nullptr,
157
- XRef *xrefA = nullptr);
158
-
159
- // Constructor for a sub-page object.
160
- Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict, const PDFRectangle *box, const PDFRectangle *cropBox, bool (*abortCheckCbkA)(void *data) = nullptr, void *abortCheckCbkDataA = nullptr, Gfx *gfxA = nullptr);
161
- #ifdef USE_CMS
162
- void initDisplayProfile();
163
- #endif
164
- ~Gfx();
165
-
166
- Gfx(const Gfx &) = delete;
167
- Gfx &operator=(const Gfx &other) = delete;
168
-
169
- XRef *getXRef() { return xref; }
170
-
171
- // Interpret a stream or array of streams.
172
- void display(Object *obj, bool topLevel = true);
173
-
174
- // Display an annotation, given its appearance (a Form XObject),
175
- // border style, and bounding box (in default user space).
176
- void drawAnnot(Object *str, AnnotBorder *border, AnnotColor *aColor, double xMin, double yMin, double xMax, double yMax, int rotate);
177
-
178
- // Save graphics state.
179
- void saveState();
180
-
181
- // Push a new state guard
182
- void pushStateGuard();
183
-
184
- // Restore graphics state.
185
- void restoreState();
186
-
187
- // Pop to state guard and pop guard
188
- void popStateGuard();
189
-
190
- // Get the current graphics state object.
191
- GfxState *getState() { return state; }
192
-
193
- bool checkTransparencyGroup(Dict *resDict);
194
-
195
- void drawForm(Object *str, Dict *resDict, const double *matrix, const double *bbox, bool transpGroup = false, bool softMask = false, GfxColorSpace *blendingColorSpace = nullptr, bool isolated = false, bool knockout = false,
196
- bool alpha = false, Function *transferFunc = nullptr, GfxColor *backdropColor = nullptr);
197
-
198
- void pushResources(Dict *resDict);
199
- void popResources();
200
-
201
- private:
202
- PDFDoc *doc;
203
- XRef *xref; // the xref table for this PDF file
204
- Catalog *catalog; // the Catalog for this PDF file
205
- OutputDev *out; // output device
206
- bool subPage; // is this a sub-page object?
207
- const bool printCommands; // print the drawing commands (for debugging)
208
- const bool profileCommands; // profile the drawing commands (for debugging)
209
- bool commandAborted; // did the previous command abort the drawing?
210
- GfxResources *res; // resource stack
211
- int updateLevel;
212
-
213
- GfxState *state; // current graphics state
214
- int stackHeight; // the height of the current graphics stack
215
- std::vector<int> stateGuards; // a stack of state limits; to guard against unmatched pops
216
- bool fontChanged; // set if font or text matrix has changed
217
- GfxClipType clip; // do a clip?
218
- int ignoreUndef; // current BX/EX nesting level
219
- double baseMatrix[6]; // default matrix for most recent
220
- // page/form/pattern
221
- int displayDepth;
222
- bool ocState; // true if drawing is enabled, false if
223
- // disabled
224
-
225
- MarkedContentStack *mcStack; // current BMC/EMC stack
226
-
227
- Parser *parser; // parser for page content stream(s)
228
-
229
- std::set<int> formsDrawing; // the forms/patterns that are being drawn
230
- std::set<int> charProcDrawing; // the charProc that are being drawn
231
-
232
- bool // callback to check for an abort
233
- (*abortCheckCbk)(void *data);
234
- void *abortCheckCbkData;
235
-
236
- static const Operator opTab[]; // table of operators
237
-
238
- void go(bool topLevel);
239
- void execOp(Object *cmd, Object args[], int numArgs);
240
- const Operator *findOp(const char *name);
241
- bool checkArg(Object *arg, TchkType type);
242
- Goffset getPos();
243
-
244
- int bottomGuard();
245
-
246
- // graphics state operators
247
- void opSave(Object args[], int numArgs);
248
- void opRestore(Object args[], int numArgs);
249
- void opConcat(Object args[], int numArgs);
250
- void opSetDash(Object args[], int numArgs);
251
- void opSetFlat(Object args[], int numArgs);
252
- void opSetLineJoin(Object args[], int numArgs);
253
- void opSetLineCap(Object args[], int numArgs);
254
- void opSetMiterLimit(Object args[], int numArgs);
255
- void opSetLineWidth(Object args[], int numArgs);
256
- void opSetExtGState(Object args[], int numArgs);
257
- void doSoftMask(Object *str, bool alpha, GfxColorSpace *blendingColorSpace, bool isolated, bool knockout, Function *transferFunc, GfxColor *backdropColor);
258
- void opSetRenderingIntent(Object args[], int numArgs);
259
-
260
- // color operators
261
- void opSetFillGray(Object args[], int numArgs);
262
- void opSetStrokeGray(Object args[], int numArgs);
263
- void opSetFillCMYKColor(Object args[], int numArgs);
264
- void opSetStrokeCMYKColor(Object args[], int numArgs);
265
- void opSetFillRGBColor(Object args[], int numArgs);
266
- void opSetStrokeRGBColor(Object args[], int numArgs);
267
- void opSetFillColorSpace(Object args[], int numArgs);
268
- void opSetStrokeColorSpace(Object args[], int numArgs);
269
- void opSetFillColor(Object args[], int numArgs);
270
- void opSetStrokeColor(Object args[], int numArgs);
271
- void opSetFillColorN(Object args[], int numArgs);
272
- void opSetStrokeColorN(Object args[], int numArgs);
273
-
274
- // path segment operators
275
- void opMoveTo(Object args[], int numArgs);
276
- void opLineTo(Object args[], int numArgs);
277
- void opCurveTo(Object args[], int numArgs);
278
- void opCurveTo1(Object args[], int numArgs);
279
- void opCurveTo2(Object args[], int numArgs);
280
- void opRectangle(Object args[], int numArgs);
281
- void opClosePath(Object args[], int numArgs);
282
-
283
- // path painting operators
284
- void opEndPath(Object args[], int numArgs);
285
- void opStroke(Object args[], int numArgs);
286
- void opCloseStroke(Object args[], int numArgs);
287
- void opFill(Object args[], int numArgs);
288
- void opEOFill(Object args[], int numArgs);
289
- void opFillStroke(Object args[], int numArgs);
290
- void opCloseFillStroke(Object args[], int numArgs);
291
- void opEOFillStroke(Object args[], int numArgs);
292
- void opCloseEOFillStroke(Object args[], int numArgs);
293
- void doPatternFill(bool eoFill);
294
- void doPatternStroke();
295
- void doPatternText();
296
- void doPatternImageMask(Object *ref, Stream *str, int width, int height, bool invert, bool inlineImg);
297
- void doTilingPatternFill(GfxTilingPattern *tPat, bool stroke, bool eoFill, bool text);
298
- void doShadingPatternFill(GfxShadingPattern *sPat, bool stroke, bool eoFill, bool text);
299
- void opShFill(Object args[], int numArgs);
300
- void doFunctionShFill(GfxFunctionShading *shading);
301
- void doFunctionShFill1(GfxFunctionShading *shading, double x0, double y0, double x1, double y1, GfxColor *colors, int depth);
302
- void doAxialShFill(GfxAxialShading *shading);
303
- void doRadialShFill(GfxRadialShading *shading);
304
- void doGouraudTriangleShFill(GfxGouraudTriangleShading *shading);
305
- void gouraudFillTriangle(double x0, double y0, GfxColor *color0, double x1, double y1, GfxColor *color1, double x2, double y2, GfxColor *color2, int nComps, int depth, GfxState::ReusablePathIterator *path);
306
- void gouraudFillTriangle(double x0, double y0, double color0, double x1, double y1, double color1, double x2, double y2, double color2, double refineColorThreshold, int depth, GfxGouraudTriangleShading *shading,
307
- GfxState::ReusablePathIterator *path);
308
- void doPatchMeshShFill(GfxPatchMeshShading *shading);
309
- void fillPatch(const GfxPatch *patch, int colorComps, int patchColorComps, double refineColorThreshold, int depth, const GfxPatchMeshShading *shading);
310
- void doEndPath();
311
-
312
- // path clipping operators
313
- void opClip(Object args[], int numArgs);
314
- void opEOClip(Object args[], int numArgs);
315
-
316
- // text object operators
317
- void opBeginText(Object args[], int numArgs);
318
- void opEndText(Object args[], int numArgs);
319
-
320
- // text state operators
321
- void opSetCharSpacing(Object args[], int numArgs);
322
- void opSetFont(Object args[], int numArgs);
323
- void opSetTextLeading(Object args[], int numArgs);
324
- void opSetTextRender(Object args[], int numArgs);
325
- void opSetTextRise(Object args[], int numArgs);
326
- void opSetWordSpacing(Object args[], int numArgs);
327
- void opSetHorizScaling(Object args[], int numArgs);
328
-
329
- // text positioning operators
330
- void opTextMove(Object args[], int numArgs);
331
- void opTextMoveSet(Object args[], int numArgs);
332
- void opSetTextMatrix(Object args[], int numArgs);
333
- void opTextNextLine(Object args[], int numArgs);
334
-
335
- // text string operators
336
- void opShowText(Object args[], int numArgs);
337
- void opMoveShowText(Object args[], int numArgs);
338
- void opMoveSetShowText(Object args[], int numArgs);
339
- void opShowSpaceText(Object args[], int numArgs);
340
- void doShowText(const GooString *s);
341
- void doIncCharCount(const GooString *s);
342
-
343
- // XObject operators
344
- void opXObject(Object args[], int numArgs);
345
- void doImage(Object *ref, Stream *str, bool inlineImg);
346
- void doForm(Object *str);
347
-
348
- // in-line image operators
349
- void opBeginImage(Object args[], int numArgs);
350
- Stream *buildImageStream();
351
- void opImageData(Object args[], int numArgs);
352
- void opEndImage(Object args[], int numArgs);
353
-
354
- // type 3 font operators
355
- void opSetCharWidth(Object args[], int numArgs);
356
- void opSetCacheDevice(Object args[], int numArgs);
357
-
358
- // compatibility operators
359
- void opBeginIgnoreUndef(Object args[], int numArgs);
360
- void opEndIgnoreUndef(Object args[], int numArgs);
361
-
362
- // marked content operators
363
- void opBeginMarkedContent(Object args[], int numArgs);
364
- void opEndMarkedContent(Object args[], int numArgs);
365
- void opMarkPoint(Object args[], int numArgs);
366
- GfxState *saveStateStack();
367
- void restoreStateStack(GfxState *oldState);
368
- bool contentIsHidden();
369
- void pushMarkedContent();
370
- void popMarkedContent();
371
- };
372
-
373
- #endif