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,155 +0,0 @@
1
- //================================================= -*- mode: c++ -*- ====
2
- //
3
- // poppler-config.h
4
- //
5
- // Copyright 1996-2011, 2022 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) 2014 Bogdan Cristea <cristeab@gmail.com>
17
- // Copyright (C) 2014 Hib Eris <hib@hiberis.nl>
18
- // Copyright (C) 2016 Tor Lillqvist <tml@collabora.com>
19
- // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
20
- // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
21
- // Copyright (C) 2018 Stefan Brüns <stefan.bruens@rwth-aachen.de>
22
- // Copyright (C) 2020 Albert Astals Cid <aacid@kde.org>
23
- //
24
- // To see a description of the changes please see the Changelog file that
25
- // came with your tarball or type make ChangeLog if you are building from git
26
- //
27
- //========================================================================
28
-
29
- #ifndef POPPLER_CONFIG_H
30
- #define POPPLER_CONFIG_H
31
-
32
- // We duplicate some of the config.h #define's here since they are
33
- // used in some of the header files we install. The #ifndef/#endif
34
- // around #undef look odd, but it's to silence warnings about
35
- // redefining those symbols.
36
-
37
- /* Defines the poppler version. */
38
- #ifndef POPPLER_VERSION
39
- #define POPPLER_VERSION "22.04.0"
40
- #endif
41
-
42
- /* Use single precision arithmetic in the Splash backend */
43
- #ifndef USE_FLOAT
44
- /* #undef USE_FLOAT */
45
- #endif
46
-
47
- /* Include support for OPI comments. */
48
- #ifndef OPI_SUPPORT
49
- #define OPI_SUPPORT 1
50
- #endif
51
-
52
- /* Enable word list support. */
53
- #ifndef TEXTOUT_WORD_LIST
54
- #define TEXTOUT_WORD_LIST 1
55
- #endif
56
-
57
- /* Support for curl is compiled in. */
58
- #ifndef POPPLER_HAS_CURL_SUPPORT
59
- #define POPPLER_HAS_CURL_SUPPORT 1
60
- #endif
61
-
62
- /* Use libjpeg instead of builtin jpeg decoder. */
63
- #ifndef ENABLE_LIBJPEG
64
- #define ENABLE_LIBJPEG 1
65
- #endif
66
-
67
- /* Build against libtiff. */
68
- #ifndef ENABLE_LIBTIFF
69
- #define ENABLE_LIBTIFF 1
70
- #endif
71
-
72
- /* Build against libpng. */
73
- #ifndef ENABLE_LIBPNG
74
- #define ENABLE_LIBPNG 1
75
- #endif
76
-
77
- /* Use zlib instead of builtin zlib decoder. */
78
- #ifndef ENABLE_ZLIB
79
- #define ENABLE_ZLIB 1
80
- #endif
81
-
82
- /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
83
- */
84
- #ifndef HAVE_DIRENT_H
85
- /* #undef HAVE_DIRENT_H */
86
- #endif
87
-
88
- /* Defines if gettimeofday is available on your system */
89
- #ifndef HAVE_GETTIMEOFDAY
90
- /* #undef HAVE_GETTIMEOFDAY */
91
- #endif
92
-
93
- /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
94
- #ifndef HAVE_NDIR_H
95
- /* #undef HAVE_NDIR_H */
96
- #endif
97
-
98
- /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
99
- */
100
- #ifndef HAVE_SYS_DIR_H
101
- /* #undef HAVE_SYS_DIR_H */
102
- #endif
103
-
104
- /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
105
- */
106
- #ifndef HAVE_SYS_NDIR_H
107
- /* #undef HAVE_SYS_NDIR_H */
108
- #endif
109
-
110
- /* Defines if use cms */
111
- #ifndef USE_CMS
112
- #define USE_CMS 1
113
- #endif
114
-
115
- /* Use header-only classes from Boost in the Splash backend */
116
- #ifndef USE_BOOST_HEADERS
117
- #define USE_BOOST_HEADERS 1
118
- #endif
119
-
120
- //------------------------------------------------------------------------
121
- // version
122
- //------------------------------------------------------------------------
123
-
124
- // copyright notice
125
- #define popplerCopyright "Copyright 2005-2022 The Poppler Developers - http://poppler.freedesktop.org"
126
- #define xpdfCopyright "Copyright 1996-2011, 2022 Glyph & Cog, LLC"
127
-
128
- //------------------------------------------------------------------------
129
- // Win32 stuff
130
- //------------------------------------------------------------------------
131
-
132
- #if defined(_WIN32) && !defined(_MSC_VER)
133
- #include <windef.h>
134
- #else
135
- #define CDECL
136
- #endif
137
-
138
- //------------------------------------------------------------------------
139
- // Compiler
140
- //------------------------------------------------------------------------
141
-
142
- #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
143
- #include <cstdio> // __MINGW_PRINTF_FORMAT is defined in the mingw stdio.h
144
- #ifdef __MINGW_PRINTF_FORMAT
145
- #define GCC_PRINTF_FORMAT(fmt_index, va_index) \
146
- __attribute__((__format__(__MINGW_PRINTF_FORMAT, fmt_index, va_index)))
147
- #else
148
- #define GCC_PRINTF_FORMAT(fmt_index, va_index) \
149
- __attribute__((__format__(__printf__, fmt_index, va_index)))
150
- #endif
151
- #else
152
- #define GCC_PRINTF_FORMAT(fmt_index, va_index)
153
- #endif
154
-
155
- #endif /* POPPLER_CONFIG_H */
@@ -1,42 +0,0 @@
1
-
2
- #ifndef POPPLER_PRIVATE_EXPORT_H
3
- #define POPPLER_PRIVATE_EXPORT_H
4
-
5
- #ifdef POPPLER_PRIVATE_STATIC_DEFINE
6
- # define POPPLER_PRIVATE_EXPORT
7
- # define POPPLER_PRIVATE_NO_EXPORT
8
- #else
9
- # ifndef POPPLER_PRIVATE_EXPORT
10
- # ifdef poppler_EXPORTS
11
- /* We are building this library */
12
- # define POPPLER_PRIVATE_EXPORT __declspec(dllexport)
13
- # else
14
- /* We are using this library */
15
- # define POPPLER_PRIVATE_EXPORT __declspec(dllimport)
16
- # endif
17
- # endif
18
-
19
- # ifndef POPPLER_PRIVATE_NO_EXPORT
20
- # define POPPLER_PRIVATE_NO_EXPORT
21
- # endif
22
- #endif
23
-
24
- #ifndef POPPLER_PRIVATE_DEPRECATED
25
- # define POPPLER_PRIVATE_DEPRECATED __declspec(deprecated)
26
- #endif
27
-
28
- #ifndef POPPLER_PRIVATE_DEPRECATED_EXPORT
29
- # define POPPLER_PRIVATE_DEPRECATED_EXPORT POPPLER_PRIVATE_EXPORT POPPLER_PRIVATE_DEPRECATED
30
- #endif
31
-
32
- #ifndef POPPLER_PRIVATE_DEPRECATED_NO_EXPORT
33
- # define POPPLER_PRIVATE_DEPRECATED_NO_EXPORT POPPLER_PRIVATE_NO_EXPORT POPPLER_PRIVATE_DEPRECATED
34
- #endif
35
-
36
- #if 0 /* DEFINE_NO_DEPRECATED */
37
- # ifndef POPPLER_PRIVATE_NO_DEPRECATED
38
- # define POPPLER_PRIVATE_NO_DEPRECATED
39
- # endif
40
- #endif
41
-
42
- #endif /* POPPLER_PRIVATE_EXPORT_H */
@@ -1,336 +0,0 @@
1
- //========================================================================
2
- //
3
- // Splash.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) 2005 Marco Pesenti Gritti <mpg@redhat.com>
15
- // Copyright (C) 2007, 2011, 2018, 2019, 2021 Albert Astals Cid <aacid@kde.org>
16
- // Copyright (C) 2010-2013, 2015 Thomas Freitag <Thomas.Freitag@alfa.de>
17
- // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com>
18
- // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson@redneon.com>
19
- // Copyright (C) 2020 Oliver Sander <oliver.sander@tu-dresden.de>
20
- // Copyright (C) 2020 Tobias Deiminger <haxtibal@posteo.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 SPLASH_H
28
- #define SPLASH_H
29
-
30
- #include <cstddef>
31
- #include "SplashTypes.h"
32
- #include "SplashClip.h"
33
- #include "SplashPattern.h"
34
- #include "poppler_private_export.h"
35
-
36
- class SplashBitmap;
37
- struct SplashGlyphBitmap;
38
- class SplashState;
39
- class SplashScreen;
40
- class SplashPath;
41
- class SplashXPath;
42
- class SplashFont;
43
- struct SplashPipe;
44
-
45
- //------------------------------------------------------------------------
46
-
47
- // Retrieves the next line of pixels in an image mask. Normally,
48
- // fills in *<line> and returns true. If the image stream is
49
- // exhausted, returns false.
50
- typedef bool (*SplashImageMaskSource)(void *data, SplashColorPtr pixel);
51
-
52
- // Retrieves the next line of pixels in an image. Normally, fills in
53
- // *<line> and returns true. If the image stream is exhausted,
54
- // returns false.
55
- typedef bool (*SplashImageSource)(void *data, SplashColorPtr colorLine, unsigned char *alphaLine);
56
-
57
- // Use ICCColorSpace to transform a bitmap
58
- typedef void (*SplashICCTransform)(void *data, SplashBitmap *bitmap);
59
-
60
- //------------------------------------------------------------------------
61
-
62
- enum SplashPipeResultColorCtrl
63
- {
64
- splashPipeResultColorNoAlphaBlendCMYK,
65
- splashPipeResultColorNoAlphaBlendDeviceN,
66
- splashPipeResultColorNoAlphaBlendRGB,
67
- splashPipeResultColorNoAlphaBlendMono,
68
- splashPipeResultColorAlphaNoBlendMono,
69
- splashPipeResultColorAlphaNoBlendRGB,
70
- splashPipeResultColorAlphaNoBlendCMYK,
71
- splashPipeResultColorAlphaNoBlendDeviceN,
72
- splashPipeResultColorAlphaBlendMono,
73
- splashPipeResultColorAlphaBlendRGB,
74
- splashPipeResultColorAlphaBlendCMYK,
75
- splashPipeResultColorAlphaBlendDeviceN
76
- };
77
-
78
- //------------------------------------------------------------------------
79
- // Splash
80
- //------------------------------------------------------------------------
81
-
82
- class POPPLER_PRIVATE_EXPORT Splash
83
- {
84
- public:
85
- // Create a new rasterizer object.
86
- Splash(SplashBitmap *bitmapA, bool vectorAntialiasA, SplashScreenParams *screenParams = nullptr);
87
- Splash(SplashBitmap *bitmapA, bool vectorAntialiasA, SplashScreen *screenA);
88
-
89
- ~Splash();
90
-
91
- Splash(const Splash &) = delete;
92
- Splash &operator=(const Splash &) = delete;
93
-
94
- //----- state read
95
-
96
- SplashCoord *getMatrix();
97
- SplashPattern *getStrokePattern();
98
- SplashPattern *getFillPattern();
99
- SplashScreen *getScreen();
100
- SplashBlendFunc getBlendFunc();
101
- SplashCoord getStrokeAlpha();
102
- SplashCoord getFillAlpha();
103
- SplashCoord getLineWidth();
104
- int getLineCap();
105
- int getLineJoin();
106
- SplashCoord getMiterLimit();
107
- SplashCoord getFlatness();
108
- SplashCoord *getLineDash();
109
- int getLineDashLength();
110
- SplashCoord getLineDashPhase();
111
- bool getStrokeAdjust();
112
- SplashClip *getClip();
113
- SplashBitmap *getSoftMask();
114
- bool getInNonIsolatedGroup();
115
-
116
- //----- state write
117
-
118
- void setMatrix(SplashCoord *matrix);
119
- void setStrokePattern(SplashPattern *strokePattern);
120
- void setFillPattern(SplashPattern *fillPattern);
121
- void setScreen(SplashScreen *screen);
122
- void setBlendFunc(SplashBlendFunc func);
123
- void setStrokeAlpha(SplashCoord alpha);
124
- void setFillAlpha(SplashCoord alpha);
125
- void setPatternAlpha(SplashCoord strokeAlpha, SplashCoord fillAlpha);
126
- void clearPatternAlpha();
127
- void setFillOverprint(bool fop);
128
- void setStrokeOverprint(bool sop);
129
- void setOverprintMode(int opm);
130
- void setLineWidth(SplashCoord lineWidth);
131
- void setLineCap(int lineCap);
132
- void setLineJoin(int lineJoin);
133
- void setMiterLimit(SplashCoord miterLimit);
134
- void setFlatness(SplashCoord flatness);
135
- // the <lineDash> array will be copied
136
- void setLineDash(SplashCoord *lineDash, int lineDashLength, SplashCoord lineDashPhase);
137
- void setStrokeAdjust(bool strokeAdjust);
138
- // NB: uses transformed coordinates.
139
- void clipResetToRect(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1);
140
- // NB: uses transformed coordinates.
141
- SplashError clipToRect(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1);
142
- // NB: uses untransformed coordinates.
143
- SplashError clipToPath(SplashPath *path, bool eo);
144
- void setSoftMask(SplashBitmap *softMask);
145
- void setInNonIsolatedGroup(SplashBitmap *alpha0BitmapA, int alpha0XA, int alpha0YA);
146
- void setTransfer(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *gray);
147
- void setOverprintMask(unsigned int overprintMask, bool additive);
148
-
149
- //----- state save/restore
150
-
151
- void saveState();
152
- SplashError restoreState();
153
-
154
- //----- drawing operations
155
-
156
- // Fill the bitmap with <color>. This is not subject to clipping.
157
- void clear(SplashColorPtr color, unsigned char alpha = 0x00);
158
-
159
- // Stroke a path using the current stroke pattern.
160
- SplashError stroke(SplashPath *path);
161
-
162
- // Fill a path using the current fill pattern.
163
- SplashError fill(SplashPath *path, bool eo);
164
-
165
- // Fill a path, XORing with the current fill pattern.
166
- SplashError xorFill(SplashPath *path, bool eo);
167
-
168
- // Draw a character, using the current fill pattern.
169
- SplashError fillChar(SplashCoord x, SplashCoord y, int c, SplashFont *font);
170
-
171
- // Draw a glyph, using the current fill pattern. This function does
172
- // not free any data, i.e., it ignores glyph->freeData.
173
- void fillGlyph(SplashCoord x, SplashCoord y, SplashGlyphBitmap *glyph);
174
-
175
- // Draws an image mask using the fill color. This will read <h>
176
- // lines of <w> pixels from <src>, starting with the top line. "1"
177
- // pixels will be drawn with the current fill color; "0" pixels are
178
- // transparent. The matrix:
179
- // [ mat[0] mat[1] 0 ]
180
- // [ mat[2] mat[3] 0 ]
181
- // [ mat[4] mat[5] 1 ]
182
- // maps a unit square to the desired destination for the image, in
183
- // PostScript style:
184
- // [x' y' 1] = [x y 1] * mat
185
- // Note that the Splash y axis points downward, and the image source
186
- // is assumed to produce pixels in raster order, starting from the
187
- // top line.
188
- SplashError fillImageMask(SplashImageMaskSource src, void *srcData, int w, int h, SplashCoord *mat, bool glyphMode);
189
-
190
- // Draw an image. This will read <h> lines of <w> pixels from
191
- // <src>, starting with the top line. These pixels are assumed to
192
- // be in the source mode, <srcMode>. If <srcAlpha> is true, the
193
- // alpha values returned by <src> are used; otherwise they are
194
- // ignored. The following combinations of source and target modes
195
- // are supported:
196
- // source target
197
- // ------ ------
198
- // Mono1 Mono1
199
- // Mono8 Mono1 -- with dithering
200
- // Mono8 Mono8
201
- // RGB8 RGB8
202
- // BGR8 BGR8
203
- // CMYK8 CMYK8
204
- // The matrix behaves as for fillImageMask.
205
- SplashError drawImage(SplashImageSource src, SplashICCTransform tf, void *srcData, SplashColorMode srcMode, bool srcAlpha, int w, int h, SplashCoord *mat, bool interpolate, bool tilingPattern = false);
206
-
207
- // Composite a rectangular region from <src> onto this Splash
208
- // object.
209
- SplashError composite(SplashBitmap *src, int xSrc, int ySrc, int xDest, int yDest, int w, int h, bool noClip, bool nonIsolated, bool knockout = false, SplashCoord knockoutOpacity = 1.0);
210
-
211
- // Composite this Splash object onto a background color. The
212
- // background alpha is assumed to be 1.
213
- void compositeBackground(SplashColorConstPtr color);
214
-
215
- // Copy a rectangular region from <src> onto the bitmap belonging to
216
- // this Splash object. The destination alpha values are all set to
217
- // zero.
218
- SplashError blitTransparent(SplashBitmap *src, int xSrc, int ySrc, int xDest, int yDest, int w, int h);
219
- void blitImage(SplashBitmap *src, bool srcAlpha, int xDest, int yDest);
220
-
221
- //----- misc
222
-
223
- // Construct a path for a stroke, given the path to be stroked and
224
- // the line width <w>. All other stroke parameters are taken from
225
- // the current state. If <flatten> is true, this function will
226
- // first flatten the path and handle the linedash.
227
- SplashPath *makeStrokePath(SplashPath *path, SplashCoord w, bool flatten = true);
228
-
229
- // Return the associated bitmap.
230
- SplashBitmap *getBitmap() { return bitmap; }
231
-
232
- // Set the minimum line width.
233
- void setMinLineWidth(SplashCoord w) { minLineWidth = w; }
234
-
235
- // Setter/Getter for thin line mode
236
- void setThinLineMode(SplashThinLineMode thinLineModeA) { thinLineMode = thinLineModeA; }
237
- SplashThinLineMode getThinLineMode() { return thinLineMode; }
238
-
239
- // Get clipping status for the last drawing operation subject to
240
- // clipping.
241
- SplashClipResult getClipRes() { return opClipRes; }
242
-
243
- // Toggle debug mode on or off.
244
- void setDebugMode(bool debugModeA) { debugMode = debugModeA; }
245
-
246
- #if 1 //~tmp: turn off anti-aliasing temporarily
247
- void setInShading(bool sh) { inShading = sh; }
248
- bool getVectorAntialias() { return vectorAntialias; }
249
- void setVectorAntialias(bool vaa) { vectorAntialias = vaa; }
250
- #endif
251
-
252
- // Do shaded fills with dynamic patterns
253
- //
254
- // clipToStrokePath: Whether the current clip region is a stroke path.
255
- // In that case, strokeAlpha is used rather than fillAlpha.
256
- SplashError shadedFill(SplashPath *path, bool hasBBox, SplashPattern *pattern, bool clipToStrokePath);
257
- // Draw a gouraud triangle shading.
258
- bool gouraudTriangleShadedFill(SplashGouraudColor *shading);
259
-
260
- private:
261
- void pipeInit(SplashPipe *pipe, int x, int y, SplashPattern *pattern, SplashColorPtr cSrc, unsigned char aInput, bool usesShape, bool nonIsolatedGroup, bool knockout = false, unsigned char knockoutOpacity = 255);
262
- void pipeRun(SplashPipe *pipe);
263
- void pipeRunSimpleMono1(SplashPipe *pipe);
264
- void pipeRunSimpleMono8(SplashPipe *pipe);
265
- void pipeRunSimpleRGB8(SplashPipe *pipe);
266
- void pipeRunSimpleXBGR8(SplashPipe *pipe);
267
- void pipeRunSimpleBGR8(SplashPipe *pipe);
268
- void pipeRunSimpleCMYK8(SplashPipe *pipe);
269
- void pipeRunSimpleDeviceN8(SplashPipe *pipe);
270
- void pipeRunAAMono1(SplashPipe *pipe);
271
- void pipeRunAAMono8(SplashPipe *pipe);
272
- void pipeRunAARGB8(SplashPipe *pipe);
273
- void pipeRunAAXBGR8(SplashPipe *pipe);
274
- void pipeRunAABGR8(SplashPipe *pipe);
275
- void pipeRunAACMYK8(SplashPipe *pipe);
276
- void pipeRunAADeviceN8(SplashPipe *pipe);
277
- void pipeSetXY(SplashPipe *pipe, int x, int y);
278
- void pipeIncX(SplashPipe *pipe);
279
- void drawPixel(SplashPipe *pipe, int x, int y, bool noClip);
280
- void drawAAPixelInit();
281
- void drawAAPixel(SplashPipe *pipe, int x, int y);
282
- void drawSpan(SplashPipe *pipe, int x0, int x1, int y, bool noClip);
283
- void drawAALine(SplashPipe *pipe, int x0, int x1, int y, bool adjustLine = false, unsigned char lineOpacity = 0);
284
- void transform(const SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo);
285
- void strokeNarrow(SplashPath *path);
286
- void strokeWide(SplashPath *path, SplashCoord w);
287
- SplashPath *flattenPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness);
288
- void flattenCurve(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1, SplashCoord x2, SplashCoord y2, SplashCoord x3, SplashCoord y3, SplashCoord *matrix, SplashCoord flatness2, SplashPath *fPath);
289
- SplashPath *makeDashedPath(SplashPath *xPath);
290
- void getBBoxFP(SplashPath *path, SplashCoord *xMinA, SplashCoord *yMinA, SplashCoord *xMaxA, SplashCoord *yMaxA);
291
- SplashError fillWithPattern(SplashPath *path, bool eo, SplashPattern *pattern, SplashCoord alpha);
292
- bool pathAllOutside(SplashPath *path);
293
- void fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph, bool noclip);
294
- void arbitraryTransformMask(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, SplashCoord *mat, bool glyphMode);
295
- SplashBitmap *scaleMask(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight);
296
- void scaleMaskYdownXdown(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
297
- void scaleMaskYdownXup(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
298
- void scaleMaskYupXdown(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
299
- void scaleMaskYupXup(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
300
- void blitMask(SplashBitmap *src, int xDest, int yDest, SplashClipResult clipRes);
301
- SplashError arbitraryTransformImage(SplashImageSource src, SplashICCTransform tf, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, SplashCoord *mat, bool interpolate,
302
- bool tilingPattern = false);
303
- SplashBitmap *scaleImage(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, bool interpolate, bool tilingPattern = false);
304
- bool scaleImageYdownXdown(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
305
- bool scaleImageYdownXup(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
306
- bool scaleImageYupXdown(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
307
- bool scaleImageYupXup(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
308
- bool scaleImageYupXupBilinear(SplashImageSource src, void *srcData, SplashColorMode srcMode, int nComps, bool srcAlpha, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest);
309
- void vertFlipImage(SplashBitmap *img, int width, int height, int nComps);
310
- void blitImage(SplashBitmap *src, bool srcAlpha, int xDest, int yDest, SplashClipResult clipRes);
311
- void blitImageClipped(SplashBitmap *src, bool srcAlpha, int xSrc, int ySrc, int xDest, int yDest, int w, int h);
312
- void dumpPath(SplashPath *path);
313
- void dumpXPath(SplashXPath *path);
314
-
315
- static SplashPipeResultColorCtrl pipeResultColorNoAlphaBlend[];
316
- static SplashPipeResultColorCtrl pipeResultColorAlphaNoBlend[];
317
- static SplashPipeResultColorCtrl pipeResultColorAlphaBlend[];
318
- static int pipeNonIsoGroupCorrection[];
319
-
320
- SplashBitmap *bitmap;
321
- SplashState *state;
322
- SplashBitmap *aaBuf;
323
- int aaBufY;
324
- SplashBitmap *alpha0Bitmap; // for non-isolated groups, this is the
325
- // bitmap containing the alpha0 values
326
- int alpha0X, alpha0Y; // offset within alpha0Bitmap
327
- SplashCoord aaGamma[splashAASize * splashAASize + 1];
328
- SplashCoord minLineWidth;
329
- SplashThinLineMode thinLineMode;
330
- SplashClipResult opClipRes;
331
- bool vectorAntialias;
332
- bool inShading;
333
- bool debugMode;
334
- };
335
-
336
- #endif
@@ -1,127 +0,0 @@
1
- //========================================================================
2
- //
3
- // SplashBitmap.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) 2007 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
15
- // Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
16
- // Copyright (C) 2009, 2012, 2018, 2021 Albert Astals Cid <aacid@kde.org>
17
- // Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
18
- // Copyright (C) 2010, 2017 Adrian Johnson <ajohnson@redneon.com>
19
- // Copyright (C) 2010 Harry Roberts <harry.roberts@midnight-labs.org>
20
- // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com>
21
- // Copyright (C) 2010 William Bader <williambader@hotmail.com>
22
- // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
23
- // Copyright (C) 2015 Adam Reichold <adamreichold@myopera.com>
24
- // Copyright (C) 2016 Kenji Uno <ku@digitaldolphins.jp>
25
- // Copyright (C) 2018 Martin Packman <gzlist@googlemail.com>
26
- // Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de>
27
- //
28
- // To see a description of the changes please see the Changelog file that
29
- // came with your tarball or type make ChangeLog if you are building from git
30
- //
31
- //========================================================================
32
-
33
- #ifndef SPLASHBITMAP_H
34
- #define SPLASHBITMAP_H
35
-
36
- #include "SplashTypes.h"
37
- #include "poppler/GfxState.h"
38
- #include "poppler_private_export.h"
39
- #include <cstdio>
40
-
41
- class ImgWriter;
42
-
43
- //------------------------------------------------------------------------
44
- // SplashBitmap
45
- //------------------------------------------------------------------------
46
-
47
- class POPPLER_PRIVATE_EXPORT SplashBitmap
48
- {
49
- public:
50
- // Create a new bitmap. It will have <widthA> x <heightA> pixels in
51
- // color mode <modeA>. Rows will be padded out to a multiple of
52
- // <rowPad> bytes. If <topDown> is false, the bitmap will be stored
53
- // upside-down, i.e., with the last row first in memory.
54
- SplashBitmap(int widthA, int heightA, int rowPad, SplashColorMode modeA, bool alphaA, bool topDown = true, const std::vector<GfxSeparationColorSpace *> *separationList = nullptr);
55
- static SplashBitmap *copy(const SplashBitmap *src);
56
-
57
- ~SplashBitmap();
58
-
59
- SplashBitmap(const SplashBitmap &) = delete;
60
- SplashBitmap &operator=(const SplashBitmap &) = delete;
61
-
62
- int getWidth() const { return width; }
63
- int getHeight() const { return height; }
64
- int getRowSize() const { return rowSize; }
65
- int getAlphaRowSize() const { return width; }
66
- int getRowPad() const { return rowPad; }
67
- SplashColorMode getMode() const { return mode; }
68
- SplashColorPtr getDataPtr() { return data; }
69
- unsigned char *getAlphaPtr() { return alpha; }
70
- std::vector<GfxSeparationColorSpace *> *getSeparationList() { return separationList; }
71
- SplashColorConstPtr getDataPtr() const { return data; }
72
- const unsigned char *getAlphaPtr() const { return alpha; }
73
- const std::vector<GfxSeparationColorSpace *> *getSeparationList() const { return separationList; }
74
-
75
- SplashError writePNMFile(char *fileName);
76
- SplashError writePNMFile(FILE *f);
77
- SplashError writeAlphaPGMFile(char *fileName);
78
-
79
- struct WriteImgParams
80
- {
81
- int jpegQuality = -1;
82
- bool jpegProgressive = false;
83
- GooString tiffCompression;
84
- bool jpegOptimize = false;
85
- };
86
-
87
- SplashError writeImgFile(SplashImageFileFormat format, const char *fileName, int hDPI, int vDPI, WriteImgParams *params = nullptr);
88
- SplashError writeImgFile(SplashImageFileFormat format, FILE *f, int hDPI, int vDPI, WriteImgParams *params = nullptr);
89
- SplashError writeImgFile(ImgWriter *writer, FILE *f, int hDPI, int vDPI, SplashColorMode imageWriterFormat);
90
-
91
- enum ConversionMode
92
- {
93
- conversionOpaque,
94
- conversionAlpha,
95
- conversionAlphaPremultiplied
96
- };
97
-
98
- bool convertToXBGR(ConversionMode conversionMode = conversionOpaque);
99
-
100
- void getPixel(int x, int y, SplashColorPtr pixel);
101
- void getRGBLine(int y, SplashColorPtr line);
102
- void getXBGRLine(int y, SplashColorPtr line, ConversionMode conversionMode = conversionOpaque);
103
- void getCMYKLine(int y, SplashColorPtr line);
104
- unsigned char getAlpha(int x, int y);
105
-
106
- // Caller takes ownership of the bitmap data. The SplashBitmap
107
- // object is no longer valid -- the next call should be to the
108
- // destructor.
109
- SplashColorPtr takeData();
110
-
111
- private:
112
- int width, height; // size of bitmap
113
- int rowPad;
114
- int rowSize; // size of one row of data, in bytes
115
- // - negative for bottom-up bitmaps
116
- SplashColorMode mode; // color mode
117
- SplashColorPtr data; // pointer to row zero of the color data
118
- unsigned char *alpha; // pointer to row zero of the alpha data
119
- // (always top-down)
120
- std::vector<GfxSeparationColorSpace *> *separationList; // list of spot colorants and their mapping functions
121
-
122
- friend class Splash;
123
-
124
- void setJpegParams(ImgWriter *writer, WriteImgParams *params);
125
- };
126
-
127
- #endif