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,90 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// GfxState.cc
|
|
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) 2009, 2011, 2018, 2019 Albert Astals Cid <aacid@kde.org>
|
|
17
|
-
// Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de>
|
|
18
|
-
//
|
|
19
|
-
// To see a description of the changes please see the Changelog file that
|
|
20
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
21
|
-
//
|
|
22
|
-
//========================================================================
|
|
23
|
-
|
|
24
|
-
#ifndef GFXSTATE_HELPERS_H
|
|
25
|
-
#define GFXSTATE_HELPERS_H
|
|
26
|
-
|
|
27
|
-
#include "GfxState.h"
|
|
28
|
-
|
|
29
|
-
static inline GfxColorComp clip01(GfxColorComp x)
|
|
30
|
-
{
|
|
31
|
-
return (x < 0) ? 0 : (x > gfxColorComp1) ? gfxColorComp1 : x;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static inline double clip01(double x)
|
|
35
|
-
{
|
|
36
|
-
return (x < 0) ? 0 : (x > 1) ? 1 : x;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static inline void cmykToRGBMatrixMultiplication(const double c, const double m, const double y, const double k, const double c1, const double m1, const double y1, const double k1, double &r, double &g, double &b)
|
|
40
|
-
{
|
|
41
|
-
double x;
|
|
42
|
-
// this is a matrix multiplication, unrolled for performance
|
|
43
|
-
// C M Y K
|
|
44
|
-
x = c1 * m1 * y1 * k1; // 0 0 0 0
|
|
45
|
-
r = g = b = x;
|
|
46
|
-
x = c1 * m1 * y1 * k; // 0 0 0 1
|
|
47
|
-
r += 0.1373 * x;
|
|
48
|
-
g += 0.1216 * x;
|
|
49
|
-
b += 0.1255 * x;
|
|
50
|
-
x = c1 * m1 * y * k1; // 0 0 1 0
|
|
51
|
-
r += x;
|
|
52
|
-
g += 0.9490 * x;
|
|
53
|
-
x = c1 * m1 * y * k; // 0 0 1 1
|
|
54
|
-
r += 0.1098 * x;
|
|
55
|
-
g += 0.1020 * x;
|
|
56
|
-
x = c1 * m * y1 * k1; // 0 1 0 0
|
|
57
|
-
r += 0.9255 * x;
|
|
58
|
-
b += 0.5490 * x;
|
|
59
|
-
x = c1 * m * y1 * k; // 0 1 0 1
|
|
60
|
-
r += 0.1412 * x;
|
|
61
|
-
x = c1 * m * y * k1; // 0 1 1 0
|
|
62
|
-
r += 0.9294 * x;
|
|
63
|
-
g += 0.1098 * x;
|
|
64
|
-
b += 0.1412 * x;
|
|
65
|
-
x = c1 * m * y * k; // 0 1 1 1
|
|
66
|
-
r += 0.1333 * x;
|
|
67
|
-
x = c * m1 * y1 * k1; // 1 0 0 0
|
|
68
|
-
g += 0.6784 * x;
|
|
69
|
-
b += 0.9373 * x;
|
|
70
|
-
x = c * m1 * y1 * k; // 1 0 0 1
|
|
71
|
-
g += 0.0588 * x;
|
|
72
|
-
b += 0.1412 * x;
|
|
73
|
-
x = c * m1 * y * k1; // 1 0 1 0
|
|
74
|
-
g += 0.6510 * x;
|
|
75
|
-
b += 0.3137 * x;
|
|
76
|
-
x = c * m1 * y * k; // 1 0 1 1
|
|
77
|
-
g += 0.0745 * x;
|
|
78
|
-
x = c * m * y1 * k1; // 1 1 0 0
|
|
79
|
-
r += 0.1804 * x;
|
|
80
|
-
g += 0.1922 * x;
|
|
81
|
-
b += 0.5725 * x;
|
|
82
|
-
x = c * m * y1 * k; // 1 1 0 1
|
|
83
|
-
b += 0.0078 * x;
|
|
84
|
-
x = c * m * y * k1; // 1 1 1 0
|
|
85
|
-
r += 0.2118 * x;
|
|
86
|
-
g += 0.2119 * x;
|
|
87
|
-
b += 0.2235 * x;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
#endif
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// GlobalParams.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) 2005, 2007-2010, 2012, 2015, 2017-2022 Albert Astals Cid <aacid@kde.org>
|
|
17
|
-
// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
|
|
18
|
-
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
|
|
19
|
-
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
|
|
20
|
-
// Copyright (C) 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
|
|
21
|
-
// Copyright (C) 2009 Jonathan Kew <jonathan_kew@sil.org>
|
|
22
|
-
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
|
|
23
|
-
// Copyright (C) 2009, 2011, 2012, 2014, 2015 William Bader <williambader@hotmail.com>
|
|
24
|
-
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
|
|
25
|
-
// Copyright (C) 2011 Pino Toscano <pino@kde.org>
|
|
26
|
-
// Copyright (C) 2012, 2017 Adrian Johnson <ajohnson@redneon.com>
|
|
27
|
-
// Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
|
|
28
|
-
// Copyright (C) 2013 Jason Crain <jason@aquaticape.us>
|
|
29
|
-
// Copyright (C) 2018, 2020 Adam Reichold <adam.reichold@t-online.de>
|
|
30
|
-
// Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de>
|
|
31
|
-
//
|
|
32
|
-
// To see a description of the changes please see the Changelog file that
|
|
33
|
-
// came with your tarball or type make ChangeLog if you are building from git
|
|
34
|
-
//
|
|
35
|
-
//========================================================================
|
|
36
|
-
|
|
37
|
-
#ifndef GLOBALPARAMS_H
|
|
38
|
-
#define GLOBALPARAMS_H
|
|
39
|
-
|
|
40
|
-
#include <cassert>
|
|
41
|
-
#include "poppler-config.h"
|
|
42
|
-
#include "poppler_private_export.h"
|
|
43
|
-
#include <cstdio>
|
|
44
|
-
#include "CharTypes.h"
|
|
45
|
-
#include "UnicodeMap.h"
|
|
46
|
-
#include "Error.h"
|
|
47
|
-
#include <unordered_map>
|
|
48
|
-
#include <string>
|
|
49
|
-
#include <memory>
|
|
50
|
-
#include <mutex>
|
|
51
|
-
#include <vector>
|
|
52
|
-
|
|
53
|
-
class GooString;
|
|
54
|
-
class NameToCharCode;
|
|
55
|
-
class CharCodeToUnicode;
|
|
56
|
-
class CharCodeToUnicodeCache;
|
|
57
|
-
class UnicodeMapCache;
|
|
58
|
-
class CMap;
|
|
59
|
-
class CMapCache;
|
|
60
|
-
class GlobalParams;
|
|
61
|
-
class GfxFont;
|
|
62
|
-
class Stream;
|
|
63
|
-
class SysFontList;
|
|
64
|
-
|
|
65
|
-
//------------------------------------------------------------------------
|
|
66
|
-
|
|
67
|
-
// The global parameters object.
|
|
68
|
-
#ifdef _COMPILING_POPPLER
|
|
69
|
-
// cmake's WINDOWS_EXPORT_ALL_SYMBOLS doesn't extend to data unfortunately
|
|
70
|
-
// so we must to this by hand
|
|
71
|
-
extern __declspec(dllexport) std::unique_ptr<GlobalParams> globalParams;
|
|
72
|
-
#else
|
|
73
|
-
extern __declspec(dllimport) std::unique_ptr<GlobalParams> globalParams;
|
|
74
|
-
#endif
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
//------------------------------------------------------------------------
|
|
78
|
-
|
|
79
|
-
enum SysFontType
|
|
80
|
-
{
|
|
81
|
-
sysFontPFA,
|
|
82
|
-
sysFontPFB,
|
|
83
|
-
sysFontTTF,
|
|
84
|
-
sysFontTTC
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
//------------------------------------------------------------------------
|
|
88
|
-
|
|
89
|
-
class POPPLER_PRIVATE_EXPORT GlobalParams
|
|
90
|
-
{
|
|
91
|
-
public:
|
|
92
|
-
// Initialize the global parameters
|
|
93
|
-
explicit GlobalParams(const char *customPopplerDataDir = nullptr);
|
|
94
|
-
|
|
95
|
-
~GlobalParams();
|
|
96
|
-
|
|
97
|
-
GlobalParams(const GlobalParams &) = delete;
|
|
98
|
-
GlobalParams &operator=(const GlobalParams &) = delete;
|
|
99
|
-
|
|
100
|
-
void setupBaseFonts(const char *dir);
|
|
101
|
-
|
|
102
|
-
//----- accessors
|
|
103
|
-
|
|
104
|
-
CharCode getMacRomanCharCode(const char *charName);
|
|
105
|
-
|
|
106
|
-
// Return Unicode values for character names. Used for general text
|
|
107
|
-
// extraction.
|
|
108
|
-
Unicode mapNameToUnicodeText(const char *charName);
|
|
109
|
-
|
|
110
|
-
// Return Unicode values for character names. Used for glyph
|
|
111
|
-
// lookups or text extraction with ZapfDingbats fonts.
|
|
112
|
-
Unicode mapNameToUnicodeAll(const char *charName);
|
|
113
|
-
|
|
114
|
-
UnicodeMap *getResidentUnicodeMap(const std::string &encodingName);
|
|
115
|
-
FILE *getUnicodeMapFile(const std::string &encodingName);
|
|
116
|
-
FILE *findCMapFile(const GooString *collection, const GooString *cMapName);
|
|
117
|
-
FILE *findToUnicodeFile(const GooString *name);
|
|
118
|
-
GooString *findFontFile(const std::string &fontName);
|
|
119
|
-
GooString *findBase14FontFile(const GooString *base14Name, const GfxFont *font);
|
|
120
|
-
GooString *findSystemFontFile(const GfxFont *font, SysFontType *type, int *fontNum, GooString *substituteFontName = nullptr, const GooString *base14Name = nullptr);
|
|
121
|
-
std::string getTextEncodingName() const;
|
|
122
|
-
bool getPrintCommands();
|
|
123
|
-
bool getProfileCommands();
|
|
124
|
-
bool getErrQuiet();
|
|
125
|
-
|
|
126
|
-
CharCodeToUnicode *getCIDToUnicode(const GooString *collection);
|
|
127
|
-
const UnicodeMap *getUnicodeMap(const std::string &encodingName);
|
|
128
|
-
std::shared_ptr<CMap> getCMap(const GooString *collection, const GooString *cMapName);
|
|
129
|
-
const UnicodeMap *getTextEncoding();
|
|
130
|
-
|
|
131
|
-
const UnicodeMap *getUtf8Map();
|
|
132
|
-
|
|
133
|
-
std::vector<std::string> getEncodingNames();
|
|
134
|
-
|
|
135
|
-
//----- functions to set parameters
|
|
136
|
-
void addFontFile(const GooString *fontName, const GooString *path);
|
|
137
|
-
void setTextEncoding(const char *encodingName);
|
|
138
|
-
void setPrintCommands(bool printCommandsA);
|
|
139
|
-
void setProfileCommands(bool profileCommandsA);
|
|
140
|
-
void setErrQuiet(bool errQuietA);
|
|
141
|
-
|
|
142
|
-
static bool parseYesNo2(const char *token, bool *flag);
|
|
143
|
-
|
|
144
|
-
private:
|
|
145
|
-
void parseNameToUnicode(const GooString *name);
|
|
146
|
-
|
|
147
|
-
void scanEncodingDirs();
|
|
148
|
-
void addCIDToUnicode(const GooString *collection, const GooString *fileName);
|
|
149
|
-
void addUnicodeMap(const GooString *encodingName, const GooString *fileName);
|
|
150
|
-
void addCMapDir(const GooString *collection, const GooString *dir);
|
|
151
|
-
|
|
152
|
-
//----- static tables
|
|
153
|
-
|
|
154
|
-
NameToCharCode * // mapping from char name to
|
|
155
|
-
macRomanReverseMap; // MacRomanEncoding index
|
|
156
|
-
|
|
157
|
-
//----- user-modifiable settings
|
|
158
|
-
|
|
159
|
-
NameToCharCode * // mapping from char name to Unicode for ZapfDingbats
|
|
160
|
-
nameToUnicodeZapfDingbats;
|
|
161
|
-
NameToCharCode * // mapping from char name to Unicode for text
|
|
162
|
-
nameToUnicodeText; // extraction
|
|
163
|
-
// files for mappings from char collections
|
|
164
|
-
// to Unicode, indexed by collection name
|
|
165
|
-
std::unordered_map<std::string, std::string> cidToUnicodes;
|
|
166
|
-
// mappings from Unicode to char codes,
|
|
167
|
-
// indexed by encoding name
|
|
168
|
-
std::unordered_map<std::string, UnicodeMap> residentUnicodeMaps;
|
|
169
|
-
// files for mappings from Unicode to char
|
|
170
|
-
// codes, indexed by encoding name
|
|
171
|
-
std::unordered_map<std::string, std::string> unicodeMaps;
|
|
172
|
-
// list of CMap dirs, indexed by collection
|
|
173
|
-
std::unordered_multimap<std::string, std::string> cMapDirs;
|
|
174
|
-
std::vector<GooString *> toUnicodeDirs; // list of ToUnicode CMap dirs
|
|
175
|
-
bool baseFontsInitialized;
|
|
176
|
-
#ifdef _WIN32
|
|
177
|
-
// windows font substitutes (for CID fonts)
|
|
178
|
-
std::unordered_map<std::string, std::string> substFiles;
|
|
179
|
-
#endif
|
|
180
|
-
// font files: font name mapped to path
|
|
181
|
-
std::unordered_map<std::string, std::string> fontFiles;
|
|
182
|
-
SysFontList *sysFonts; // system fonts
|
|
183
|
-
GooString *textEncoding; // encoding (unicodeMap) to use for text
|
|
184
|
-
// output
|
|
185
|
-
bool printCommands; // print the drawing commands
|
|
186
|
-
bool profileCommands; // profile the drawing commands
|
|
187
|
-
bool errQuiet; // suppress error messages?
|
|
188
|
-
|
|
189
|
-
CharCodeToUnicodeCache *cidToUnicodeCache;
|
|
190
|
-
CharCodeToUnicodeCache *unicodeToUnicodeCache;
|
|
191
|
-
UnicodeMapCache *unicodeMapCache;
|
|
192
|
-
CMapCache *cMapCache;
|
|
193
|
-
|
|
194
|
-
const UnicodeMap *utf8Map;
|
|
195
|
-
|
|
196
|
-
mutable std::recursive_mutex mutex;
|
|
197
|
-
mutable std::recursive_mutex unicodeMapCacheMutex;
|
|
198
|
-
mutable std::recursive_mutex cMapCacheMutex;
|
|
199
|
-
|
|
200
|
-
const char *popplerDataDir;
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
class POPPLER_PRIVATE_EXPORT GlobalParamsIniter
|
|
204
|
-
{
|
|
205
|
-
public:
|
|
206
|
-
explicit GlobalParamsIniter(ErrorCallback errorCallback);
|
|
207
|
-
~GlobalParamsIniter();
|
|
208
|
-
|
|
209
|
-
GlobalParamsIniter(const GlobalParamsIniter &) = delete;
|
|
210
|
-
GlobalParamsIniter &operator=(const GlobalParamsIniter &) = delete;
|
|
211
|
-
|
|
212
|
-
static bool setCustomDataDir(const std::string &dir);
|
|
213
|
-
|
|
214
|
-
private:
|
|
215
|
-
static std::mutex mutex;
|
|
216
|
-
static int count;
|
|
217
|
-
|
|
218
|
-
static std::string customDataDir;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
#endif
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// Hints.h
|
|
4
|
-
//
|
|
5
|
-
// This file is licensed under the GPLv2 or later
|
|
6
|
-
//
|
|
7
|
-
// Copyright 2010 Hib Eris <hib@hiberis.nl>
|
|
8
|
-
// Copyright 2010, 2013, 2016, 2018 Albert Astals Cid <aacid@kde.org>
|
|
9
|
-
// Copyright 2013 Adrian Johnson <ajohnson@redneon.com>
|
|
10
|
-
//
|
|
11
|
-
//========================================================================
|
|
12
|
-
|
|
13
|
-
#ifndef HINTS_H
|
|
14
|
-
#define HINTS_H
|
|
15
|
-
|
|
16
|
-
#include <cstring>
|
|
17
|
-
#include <vector>
|
|
18
|
-
#include "PDFDoc.h"
|
|
19
|
-
|
|
20
|
-
class Stream;
|
|
21
|
-
class BaseStream;
|
|
22
|
-
class Linearization;
|
|
23
|
-
class XRef;
|
|
24
|
-
|
|
25
|
-
//------------------------------------------------------------------------
|
|
26
|
-
// Hints
|
|
27
|
-
//------------------------------------------------------------------------
|
|
28
|
-
|
|
29
|
-
class Hints
|
|
30
|
-
{
|
|
31
|
-
public:
|
|
32
|
-
Hints(BaseStream *str, Linearization *linearization, XRef *xref, SecurityHandler *secHdlr);
|
|
33
|
-
~Hints();
|
|
34
|
-
|
|
35
|
-
Hints(const Hints &) = delete;
|
|
36
|
-
Hints &operator=(const Hints &) = delete;
|
|
37
|
-
|
|
38
|
-
bool isOk() const;
|
|
39
|
-
|
|
40
|
-
int getPageObjectNum(int page);
|
|
41
|
-
Goffset getPageOffset(int page);
|
|
42
|
-
std::vector<ByteRange> *getPageRanges(int page);
|
|
43
|
-
|
|
44
|
-
private:
|
|
45
|
-
void readTables(BaseStream *str, Linearization *linearization, XRef *xref, SecurityHandler *secHdlr);
|
|
46
|
-
bool readPageOffsetTable(Stream *str);
|
|
47
|
-
bool readSharedObjectsTable(Stream *str);
|
|
48
|
-
|
|
49
|
-
unsigned int hintsOffset;
|
|
50
|
-
unsigned int hintsLength;
|
|
51
|
-
unsigned int hintsOffset2;
|
|
52
|
-
unsigned int hintsLength2;
|
|
53
|
-
unsigned int mainXRefEntriesOffset;
|
|
54
|
-
|
|
55
|
-
int nPages;
|
|
56
|
-
int pageFirst;
|
|
57
|
-
int pageObjectFirst;
|
|
58
|
-
Goffset pageOffsetFirst;
|
|
59
|
-
unsigned int pageEndFirst;
|
|
60
|
-
|
|
61
|
-
unsigned int nObjectLeast;
|
|
62
|
-
unsigned int objectOffsetFirst;
|
|
63
|
-
unsigned int nBitsDiffObjects;
|
|
64
|
-
unsigned int pageLengthLeast;
|
|
65
|
-
unsigned int nBitsDiffPageLength;
|
|
66
|
-
unsigned int OffsetStreamLeast;
|
|
67
|
-
unsigned int nBitsOffsetStream;
|
|
68
|
-
unsigned int lengthStreamLeast;
|
|
69
|
-
unsigned int nBitsLengthStream;
|
|
70
|
-
unsigned int nBitsNumShared;
|
|
71
|
-
unsigned int nBitsShared;
|
|
72
|
-
unsigned int nBitsNumerator;
|
|
73
|
-
unsigned int denominator;
|
|
74
|
-
|
|
75
|
-
unsigned int *nObjects;
|
|
76
|
-
int *pageObjectNum;
|
|
77
|
-
unsigned int *xRefOffset;
|
|
78
|
-
unsigned int *pageLength;
|
|
79
|
-
Goffset *pageOffset;
|
|
80
|
-
unsigned int *numSharedObject;
|
|
81
|
-
unsigned int **sharedObjectId;
|
|
82
|
-
|
|
83
|
-
unsigned int *groupLength;
|
|
84
|
-
unsigned int *groupOffset;
|
|
85
|
-
unsigned int *groupHasSignature;
|
|
86
|
-
unsigned int *groupNumObjects;
|
|
87
|
-
unsigned int *groupXRefOffset;
|
|
88
|
-
bool ok;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
#endif
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// JArithmeticDecoder.h
|
|
4
|
-
//
|
|
5
|
-
// Arithmetic decoder used by the JBIG2 and JPEG2000 decoders.
|
|
6
|
-
//
|
|
7
|
-
// Copyright 2002-2004 Glyph & Cog, LLC
|
|
8
|
-
//
|
|
9
|
-
//========================================================================
|
|
10
|
-
|
|
11
|
-
//========================================================================
|
|
12
|
-
//
|
|
13
|
-
// Modified under the Poppler project - http://poppler.freedesktop.org
|
|
14
|
-
//
|
|
15
|
-
// All changes made under the Poppler project to this file are licensed
|
|
16
|
-
// under GPL version 2 or later
|
|
17
|
-
//
|
|
18
|
-
// Copyright (C) 2018, 2021 Albert Astals Cid <aacid@kde.org>
|
|
19
|
-
// Copyright (C) 2019 Volker Krause <vkrause@kde.org>
|
|
20
|
-
// Copyright (C) 2020 Even Rouault <even.rouault@spatialys.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 JARITHMETICDECODER_H
|
|
28
|
-
#define JARITHMETICDECODER_H
|
|
29
|
-
|
|
30
|
-
class Stream;
|
|
31
|
-
|
|
32
|
-
//------------------------------------------------------------------------
|
|
33
|
-
// JArithmeticDecoderStats
|
|
34
|
-
//------------------------------------------------------------------------
|
|
35
|
-
|
|
36
|
-
class JArithmeticDecoderStats
|
|
37
|
-
{
|
|
38
|
-
public:
|
|
39
|
-
explicit JArithmeticDecoderStats(int contextSizeA);
|
|
40
|
-
~JArithmeticDecoderStats();
|
|
41
|
-
JArithmeticDecoderStats(const JArithmeticDecoderStats &) = delete;
|
|
42
|
-
JArithmeticDecoderStats &operator=(const JArithmeticDecoderStats &) = delete;
|
|
43
|
-
JArithmeticDecoderStats *copy();
|
|
44
|
-
void reset();
|
|
45
|
-
int getContextSize() { return contextSize; }
|
|
46
|
-
void copyFrom(JArithmeticDecoderStats *stats);
|
|
47
|
-
void setEntry(unsigned int cx, int i, int mps);
|
|
48
|
-
bool isValid() const { return cxTab != nullptr; }
|
|
49
|
-
|
|
50
|
-
private:
|
|
51
|
-
unsigned char *cxTab; // cxTab[cx] = (i[cx] << 1) + mps[cx]
|
|
52
|
-
int contextSize;
|
|
53
|
-
|
|
54
|
-
friend class JArithmeticDecoder;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
//------------------------------------------------------------------------
|
|
58
|
-
// JArithmeticDecoder
|
|
59
|
-
//------------------------------------------------------------------------
|
|
60
|
-
|
|
61
|
-
class JArithmeticDecoder
|
|
62
|
-
{
|
|
63
|
-
public:
|
|
64
|
-
JArithmeticDecoder();
|
|
65
|
-
~JArithmeticDecoder();
|
|
66
|
-
JArithmeticDecoder(const JArithmeticDecoder &) = delete;
|
|
67
|
-
JArithmeticDecoder &operator=(const JArithmeticDecoder &) = delete;
|
|
68
|
-
|
|
69
|
-
void setStream(Stream *strA)
|
|
70
|
-
{
|
|
71
|
-
str = strA;
|
|
72
|
-
dataLen = 0;
|
|
73
|
-
limitStream = false;
|
|
74
|
-
}
|
|
75
|
-
void setStream(Stream *strA, int dataLenA)
|
|
76
|
-
{
|
|
77
|
-
str = strA;
|
|
78
|
-
dataLen = dataLenA;
|
|
79
|
-
limitStream = true;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Start decoding on a new stream. This fills the byte buffers and
|
|
83
|
-
// runs INITDEC.
|
|
84
|
-
void start();
|
|
85
|
-
|
|
86
|
-
// Restart decoding on an interrupted stream. This refills the
|
|
87
|
-
// buffers if needed, but does not run INITDEC. (This is used in
|
|
88
|
-
// JPEG 2000 streams when codeblock data is split across multiple
|
|
89
|
-
// packets/layers.)
|
|
90
|
-
void restart(int dataLenA);
|
|
91
|
-
|
|
92
|
-
// Read any leftover data in the stream.
|
|
93
|
-
void cleanup();
|
|
94
|
-
|
|
95
|
-
// Decode one bit.
|
|
96
|
-
int decodeBit(unsigned int context, JArithmeticDecoderStats *stats);
|
|
97
|
-
|
|
98
|
-
// Decode eight bits.
|
|
99
|
-
int decodeByte(unsigned int context, JArithmeticDecoderStats *stats);
|
|
100
|
-
|
|
101
|
-
// Returns false for OOB, otherwise sets *<x> and returns true.
|
|
102
|
-
bool decodeInt(int *x, JArithmeticDecoderStats *stats);
|
|
103
|
-
|
|
104
|
-
unsigned int decodeIAID(unsigned int codeLen, JArithmeticDecoderStats *stats);
|
|
105
|
-
|
|
106
|
-
void resetByteCounter() { nBytesRead = 0; }
|
|
107
|
-
unsigned int getByteCounter() { return nBytesRead; }
|
|
108
|
-
|
|
109
|
-
private:
|
|
110
|
-
unsigned int readByte();
|
|
111
|
-
int decodeIntBit(JArithmeticDecoderStats *stats);
|
|
112
|
-
void byteIn();
|
|
113
|
-
|
|
114
|
-
static const unsigned int qeTab[47];
|
|
115
|
-
static const int nmpsTab[47];
|
|
116
|
-
static const int nlpsTab[47];
|
|
117
|
-
static const int switchTab[47];
|
|
118
|
-
|
|
119
|
-
unsigned int buf0, buf1;
|
|
120
|
-
unsigned int c, a;
|
|
121
|
-
int ct;
|
|
122
|
-
|
|
123
|
-
unsigned int prev; // for the integer decoder
|
|
124
|
-
|
|
125
|
-
Stream *str;
|
|
126
|
-
unsigned int nBytesRead;
|
|
127
|
-
int dataLen;
|
|
128
|
-
bool limitStream;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
#endif
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
//========================================================================
|
|
2
|
-
//
|
|
3
|
-
// JBIG2Stream.h
|
|
4
|
-
//
|
|
5
|
-
// Copyright 2002-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 David Benjamin <davidben@mit.edu>
|
|
17
|
-
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
|
|
18
|
-
// Copyright (C) 2015 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
|
19
|
-
// Copyright (C) 2019-2021 Oliver Sander <oliver.sander@tu-dresden.de>
|
|
20
|
-
// Copyright (C) 2019 Volker Krause <vkrause@kde.org>
|
|
21
|
-
// Copyright (C) 2019, 2021 Albert Astals Cid <aacid@kde.org>
|
|
22
|
-
// Copyright (C) 2019, 2020 Even Rouault <even.rouault@spatialys.com>
|
|
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 JBIG2STREAM_H
|
|
30
|
-
#define JBIG2STREAM_H
|
|
31
|
-
|
|
32
|
-
#include "Object.h"
|
|
33
|
-
#include "Stream.h"
|
|
34
|
-
|
|
35
|
-
class JBIG2Segment;
|
|
36
|
-
class JBIG2Bitmap;
|
|
37
|
-
class JArithmeticDecoder;
|
|
38
|
-
class JArithmeticDecoderStats;
|
|
39
|
-
class JBIG2HuffmanDecoder;
|
|
40
|
-
struct JBIG2HuffmanTable;
|
|
41
|
-
class JBIG2MMRDecoder;
|
|
42
|
-
|
|
43
|
-
//------------------------------------------------------------------------
|
|
44
|
-
|
|
45
|
-
class JBIG2Stream : public FilterStream
|
|
46
|
-
{
|
|
47
|
-
public:
|
|
48
|
-
JBIG2Stream(Stream *strA, Object &&globalsStreamA, Object *globalsStreamRefA);
|
|
49
|
-
~JBIG2Stream() override;
|
|
50
|
-
StreamKind getKind() const override { return strJBIG2; }
|
|
51
|
-
void reset() override;
|
|
52
|
-
void close() override;
|
|
53
|
-
Goffset getPos() override;
|
|
54
|
-
int getChar() override;
|
|
55
|
-
int lookChar() override;
|
|
56
|
-
GooString *getPSFilter(int psLevel, const char *indent) override;
|
|
57
|
-
bool isBinary(bool last = true) const override;
|
|
58
|
-
virtual Object *getGlobalsStream() { return &globalsStream; }
|
|
59
|
-
virtual Ref getGlobalsStreamRef() { return globalsStreamRef; }
|
|
60
|
-
|
|
61
|
-
private:
|
|
62
|
-
bool hasGetChars() override { return true; }
|
|
63
|
-
int getChars(int nChars, unsigned char *buffer) override;
|
|
64
|
-
|
|
65
|
-
void readSegments();
|
|
66
|
-
bool readSymbolDictSeg(unsigned int segNum, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs);
|
|
67
|
-
void readTextRegionSeg(unsigned int segNum, bool imm, bool lossless, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs);
|
|
68
|
-
std::unique_ptr<JBIG2Bitmap> readTextRegion(bool huff, bool refine, int w, int h, unsigned int numInstances, unsigned int logStrips, int numSyms, const JBIG2HuffmanTable *symCodeTab, unsigned int symCodeLen, JBIG2Bitmap **syms,
|
|
69
|
-
unsigned int defPixel, unsigned int combOp, unsigned int transposed, unsigned int refCorner, int sOffset, const JBIG2HuffmanTable *huffFSTable, const JBIG2HuffmanTable *huffDSTable,
|
|
70
|
-
const JBIG2HuffmanTable *huffDTTable, const JBIG2HuffmanTable *huffRDWTable, const JBIG2HuffmanTable *huffRDHTable, const JBIG2HuffmanTable *huffRDXTable,
|
|
71
|
-
const JBIG2HuffmanTable *huffRDYTable, const JBIG2HuffmanTable *huffRSizeTable, unsigned int templ, int *atx, int *aty);
|
|
72
|
-
void readPatternDictSeg(unsigned int segNum, unsigned int length);
|
|
73
|
-
void readHalftoneRegionSeg(unsigned int segNum, bool imm, bool lossless, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs);
|
|
74
|
-
void readGenericRegionSeg(unsigned int segNum, bool imm, bool lossless, unsigned int length);
|
|
75
|
-
void mmrAddPixels(int a1, int blackPixels, int *codingLine, int *a0i, int w);
|
|
76
|
-
void mmrAddPixelsNeg(int a1, int blackPixels, int *codingLine, int *a0i, int w);
|
|
77
|
-
std::unique_ptr<JBIG2Bitmap> readGenericBitmap(bool mmr, int w, int h, int templ, bool tpgdOn, bool useSkip, JBIG2Bitmap *skip, int *atx, int *aty, int mmrDataLength);
|
|
78
|
-
void readGenericRefinementRegionSeg(unsigned int segNum, bool imm, bool lossless, unsigned int length, unsigned int *refSegs, unsigned int nRefSegs);
|
|
79
|
-
std::unique_ptr<JBIG2Bitmap> readGenericRefinementRegion(int w, int h, int templ, bool tpgrOn, JBIG2Bitmap *refBitmap, int refDX, int refDY, int *atx, int *aty);
|
|
80
|
-
void readPageInfoSeg(unsigned int length);
|
|
81
|
-
void readEndOfStripeSeg(unsigned int length);
|
|
82
|
-
void readProfilesSeg(unsigned int length);
|
|
83
|
-
void readCodeTableSeg(unsigned int segNum, unsigned int length);
|
|
84
|
-
void readExtensionSeg(unsigned int length);
|
|
85
|
-
JBIG2Segment *findSegment(unsigned int segNum);
|
|
86
|
-
void discardSegment(unsigned int segNum);
|
|
87
|
-
void resetGenericStats(unsigned int templ, JArithmeticDecoderStats *prevStats);
|
|
88
|
-
void resetRefinementStats(unsigned int templ, JArithmeticDecoderStats *prevStats);
|
|
89
|
-
bool resetIntStats(int symCodeLen);
|
|
90
|
-
bool readUByte(unsigned int *x);
|
|
91
|
-
bool readByte(int *x);
|
|
92
|
-
bool readUWord(unsigned int *x);
|
|
93
|
-
bool readULong(unsigned int *x);
|
|
94
|
-
bool readLong(int *x);
|
|
95
|
-
|
|
96
|
-
Object globalsStream;
|
|
97
|
-
Ref globalsStreamRef;
|
|
98
|
-
unsigned int pageW, pageH, curPageH;
|
|
99
|
-
unsigned int pageDefPixel;
|
|
100
|
-
JBIG2Bitmap *pageBitmap;
|
|
101
|
-
unsigned int defCombOp;
|
|
102
|
-
std::vector<std::unique_ptr<JBIG2Segment>> segments;
|
|
103
|
-
std::vector<std::unique_ptr<JBIG2Segment>> globalSegments;
|
|
104
|
-
Stream *curStr;
|
|
105
|
-
unsigned char *dataPtr;
|
|
106
|
-
unsigned char *dataEnd;
|
|
107
|
-
unsigned int byteCounter;
|
|
108
|
-
|
|
109
|
-
JArithmeticDecoder *arithDecoder;
|
|
110
|
-
JArithmeticDecoderStats *genericRegionStats;
|
|
111
|
-
JArithmeticDecoderStats *refinementRegionStats;
|
|
112
|
-
JArithmeticDecoderStats *iadhStats;
|
|
113
|
-
JArithmeticDecoderStats *iadwStats;
|
|
114
|
-
JArithmeticDecoderStats *iaexStats;
|
|
115
|
-
JArithmeticDecoderStats *iaaiStats;
|
|
116
|
-
JArithmeticDecoderStats *iadtStats;
|
|
117
|
-
JArithmeticDecoderStats *iaitStats;
|
|
118
|
-
JArithmeticDecoderStats *iafsStats;
|
|
119
|
-
JArithmeticDecoderStats *iadsStats;
|
|
120
|
-
JArithmeticDecoderStats *iardxStats;
|
|
121
|
-
JArithmeticDecoderStats *iardyStats;
|
|
122
|
-
JArithmeticDecoderStats *iardwStats;
|
|
123
|
-
JArithmeticDecoderStats *iardhStats;
|
|
124
|
-
JArithmeticDecoderStats *iariStats;
|
|
125
|
-
JArithmeticDecoderStats *iaidStats;
|
|
126
|
-
JBIG2HuffmanDecoder *huffDecoder;
|
|
127
|
-
JBIG2MMRDecoder *mmrDecoder;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
#endif
|