Spaces:
Running
Running
File size: 2,412 Bytes
a9694d2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
//========================================================================
//
// Hints.h
//
// This file is licensed under the GPLv2 or later
//
// Copyright 2010 Hib Eris <[email protected]>
// Copyright 2010, 2013, 2016, 2018 Albert Astals Cid <[email protected]>
// Copyright 2013 Adrian Johnson <[email protected]>
//
//========================================================================
#ifndef HINTS_H
#define HINTS_H
#include <cstring>
#include <vector>
#include "PDFDoc.h"
class Stream;
class BaseStream;
class Linearization;
class XRef;
//------------------------------------------------------------------------
// Hints
//------------------------------------------------------------------------
class Hints
{
public:
Hints(BaseStream *str, Linearization *linearization, XRef *xref, SecurityHandler *secHdlr);
~Hints();
Hints(const Hints &) = delete;
Hints &operator=(const Hints &) = delete;
bool isOk() const;
int getPageObjectNum(int page);
Goffset getPageOffset(int page);
std::vector<ByteRange> *getPageRanges(int page);
private:
void readTables(BaseStream *str, Linearization *linearization, XRef *xref, SecurityHandler *secHdlr);
bool readPageOffsetTable(Stream *str);
bool readSharedObjectsTable(Stream *str);
unsigned int hintsOffset;
unsigned int hintsLength;
unsigned int hintsOffset2;
unsigned int hintsLength2;
unsigned int mainXRefEntriesOffset;
int nPages;
int pageFirst;
int pageObjectFirst;
Goffset pageOffsetFirst;
unsigned int pageEndFirst;
unsigned int nObjectLeast;
unsigned int objectOffsetFirst;
unsigned int nBitsDiffObjects;
unsigned int pageLengthLeast;
unsigned int nBitsDiffPageLength;
unsigned int OffsetStreamLeast;
unsigned int nBitsOffsetStream;
unsigned int lengthStreamLeast;
unsigned int nBitsLengthStream;
unsigned int nBitsNumShared;
unsigned int nBitsShared;
unsigned int nBitsNumerator;
unsigned int denominator;
unsigned int *nObjects;
int *pageObjectNum;
unsigned int *xRefOffset;
unsigned int *pageLength;
Goffset *pageOffset;
unsigned int *numSharedObject;
unsigned int **sharedObjectId;
unsigned int *groupLength;
unsigned int *groupOffset;
unsigned int *groupHasSignature;
unsigned int *groupNumObjects;
unsigned int *groupXRefOffset;
bool ok;
};
#endif
|