Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
JBig2_TrdProc.h
Go to the documentation of this file.
1// Copyright 2015 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCODEC_JBIG2_JBIG2_TRDPROC_H_
8#define CORE_FXCODEC_JBIG2_JBIG2_TRDPROC_H_
9
10#include <stdint.h>
11
12#include <memory>
13#include <vector>
14
15#include "core/fxcodec/jbig2/JBig2_Image.h"
16#include "core/fxcrt/unowned_ptr.h"
17#include "core/fxcrt/unowned_ptr_exclusion.h"
18
24class JBig2ArithCtx;
25struct JBig2HuffmanCode;
26
42
49
51 public:
54
56 JBig2ArithCtx* grContext);
57
59 JBig2ArithCtx* grContext,
61
62 bool SBHUFF;
67 int8_t SBDSOFFSET;
68 uint8_t SBSYMCODELEN;
69 uint32_t SBW;
70 uint32_t SBH;
72 uint32_t SBSTRIPS;
73 uint32_t SBNUMSYMS;
86 int8_t SBRAT[4];
87
88 private:
89 struct ComposeData {
90 int32_t x;
91 int32_t y;
92 uint32_t increment = 0;
93 };
94 ComposeData GetComposeData(int32_t SI,
95 int32_t TI,
96 uint32_t WI,
97 uint32_t HI) const;
98};
99
100#endif // CORE_FXCODEC_JBIG2_JBIG2_TRDPROC_H_
static const size_t kSymbolDictCacheMaxSize
JBig2_Result
#define JBIG2_MIN_SEGMENT_SIZE
constexpr uint32_t kJBig2MaxNewSymbols
constexpr int32_t kJBig2MaxReferredSegmentCount
constexpr uint32_t kJBig2MaxExportSymbols
constexpr int32_t kJBig2OOB
constexpr int32_t kJBig2MaxImageSize
constexpr uint32_t kJBig2MaxPatternIndex
JBig2ComposeOp
Definition JBig2_Image.h:19
@ JBIG2_COMPOSE_REPLACE
Definition JBig2_Image.h:24
@ JBIG2_COMPOSE_AND
Definition JBig2_Image.h:21
@ JBIG2_COMPOSE_XOR
Definition JBig2_Image.h:22
@ JBIG2_COMPOSE_OR
Definition JBig2_Image.h:20
@ JBIG2_COMPOSE_XNOR
Definition JBig2_Image.h:23
JBig2_ResultType
@ JBIG2_IMAGE_POINTER
@ JBIG2_VOID_POINTER
@ JBIG2_HUFFMAN_TABLE_POINTER
@ JBIG2_SYMBOL_DICT_POINTER
@ JBIG2_PATTERN_DICT_POINTER
JBig2_SegmentState
@ JBIG2_SEGMENT_DATA_UNPARSED
@ JBIG2_SEGMENT_PARSE_COMPLETE
@ JBIG2_SEGMENT_ERROR
@ JBIG2_SEGMENT_HEADER_UNPARSED
@ JBIG2_SEGMENT_PAUSED
JBig2Corner
@ JBIG2_CORNER_TOPRIGHT
@ JBIG2_CORNER_BOTTOMLEFT
@ JBIG2_CORNER_BOTTOMRIGHT
@ JBIG2_CORNER_TOPLEFT
static std::unique_ptr< CJBig2_Context > Create(pdfium::span< const uint8_t > pGlobalSpan, uint64_t global_key, pdfium::span< const uint8_t > pSrcSpan, uint64_t src_key, std::list< CJBig2_CachePair > *pSymbolDictCache)
static bool HuffmanAssignCode(JBig2HuffmanCode *SBSYMCODES, uint32_t NTEMP)
bool GetFirstPage(pdfium::span< uint8_t > pBuf, int32_t width, int32_t height, int32_t stride, PauseIndicatorIface *pPause)
bool Continue(PauseIndicatorIface *pPause)
FXCODEC_STATUS GetProcessingStatus() const
UnownedPtr< PauseIndicatorIface > pPause
UnownedPtr< CJBig2_ArithDecoder > pArithDecoder
UnownedPtr< std::unique_ptr< CJBig2_Image > > pImage
UnownedPtr< JBig2ArithCtx > gbContext
FXCODEC_STATUS StartDecodeMMR(std::unique_ptr< CJBig2_Image > *pImage, CJBig2_BitStream *pStream)
UnownedPtr< CJBig2_Image > SKIP
const FX_RECT & GetReplaceRect() const
FXCODEC_STATUS ContinueDecode(ProgressiveArithDecodeState *pState)
std::unique_ptr< CJBig2_Image > DecodeArith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
FXCODEC_STATUS StartDecodeArith(ProgressiveArithDecodeState *pState)
UnownedPtr< CJBig2_Image > GRREFERENCE
std::unique_ptr< CJBig2_Image > Decode(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
JBig2ComposeOp HCOMBOP
std::unique_ptr< CJBig2_Image > DecodeMMR(CJBig2_BitStream *pStream)
UnownedPtr< const std::vector< std::unique_ptr< CJBig2_Image > > > HPATS
std::unique_ptr< CJBig2_Image > DecodeArith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, PauseIndicatorIface *pPause)
static constexpr size_t kNumHuffmanTables
const std::vector< int > & GetRANGELEN() const
const std::vector< JBig2HuffmanCode > & GetCODES() const
CJBig2_HuffmanTable(CJBig2_BitStream *pStream)
uint32_t Size() const
const std::vector< int > & GetRANGELOW() const
CJBig2_Image(int32_t w, int32_t h, int32_t stride, pdfium::span< uint8_t > pBuf)
bool ComposeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op)
void SetPixel(int32_t x, int32_t y, int v)
std::unique_ptr< CJBig2_Image > SubImage(int32_t x, int32_t y, int32_t w, int32_t h)
int32_t height() const
Definition JBig2_Image.h:40
CJBig2_Image(int32_t w, int32_t h)
uint8_t * GetLine(int32_t y) const
Definition JBig2_Image.h:49
void CopyLine(int32_t hTo, int32_t hFrom)
CJBig2_Image(const CJBig2_Image &other)
bool ComposeToWithRect(CJBig2_Image *pDst, int32_t x, int32_t y, const FX_RECT &rtSrc, JBig2ComposeOp op)
uint8_t * data() const
Definition JBig2_Image.h:43
static bool IsValidImageSize(int32_t w, int32_t h)
int GetPixel(int32_t x, int32_t y) const
int32_t stride() const
Definition JBig2_Image.h:41
bool ComposeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
uint8_t * GetLineUnsafe(int32_t y) const
Definition JBig2_Image.h:48
int32_t width() const
Definition JBig2_Image.h:39
void Fill(bool v)
void Expand(int32_t h, bool v)
bool ComposeFromWithRect(int32_t x, int32_t y, CJBig2_Image *pSrc, const FX_RECT &rtSrc, JBig2ComposeOp op)
std::unique_ptr< CJBig2_PatternDict > DecodeMMR(CJBig2_BitStream *pStream)
std::unique_ptr< CJBig2_PatternDict > DecodeArith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, PauseIndicatorIface *pPause)
CJBig2_PatternDict(uint32_t dict_size)
std::vector< std::unique_ptr< CJBig2_Image > > HDPATS
UnownedPtr< const CJBig2_HuffmanTable > SDHUFFDW
std::unique_ptr< CJBig2_SymbolDict > DecodeArith(CJBig2_ArithDecoder *pArithDecoder, std::vector< JBig2ArithCtx > *gbContext, std::vector< JBig2ArithCtx > *grContext)
UNOWNED_PTR_EXCLUSION CJBig2_Image ** SDINSYMS
UnownedPtr< const CJBig2_HuffmanTable > SDHUFFDH
std::unique_ptr< CJBig2_SymbolDict > DecodeHuffman(CJBig2_BitStream *pStream, std::vector< JBig2ArithCtx > *gbContext, std::vector< JBig2ArithCtx > *grContext)
uint32_t SDNUMINSYMS
UnownedPtr< const CJBig2_HuffmanTable > SDHUFFBMSIZE
uint32_t SDNUMEXSYMS
uint32_t SDNUMNEWSYMS
int8_t SDRAT[4]
UnownedPtr< const CJBig2_HuffmanTable > SDHUFFAGGINST
std::vector< uint32_t > m_Referred_to_segment_numbers
std::unique_ptr< CJBig2_SymbolDict > m_SymbolDict
std::unique_ptr< CJBig2_HuffmanTable > m_HuffmanTable
JBig2_SegmentState m_State
std::unique_ptr< CJBig2_PatternDict > m_PatternDict
JBig2_ResultType m_nResultType
uint8_t deferred_non_retain
uint8_t page_association_size
uint32_t m_dwData_length
uint32_t m_dwHeader_Length
uint32_t m_dwDataOffset
int32_t m_nReferred_to_segment_count
uint32_t m_dwPage_association
std::unique_ptr< CJBig2_Image > m_Image
uint32_t m_dwNumber
const std::vector< JBig2ArithCtx > & GrContext() const
void SetGbContext(std::vector< JBig2ArithCtx > gbContext)
std::unique_ptr< CJBig2_SymbolDict > DeepCopy() const
size_t NumImages() const
const std::vector< JBig2ArithCtx > & GbContext() const
void AddImage(std::unique_ptr< CJBig2_Image > image)
void SetGrContext(std::vector< JBig2ArithCtx > grContext)
CJBig2_Image * GetImage(size_t index) const
uint32_t SBNUMINSTANCES
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFRDX
std::unique_ptr< CJBig2_Image > DecodeHuffman(CJBig2_BitStream *pStream, JBig2ArithCtx *grContext)
std::vector< JBig2HuffmanCode > SBSYMCODES
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFDS
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFRDH
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFRSIZE
JBig2Corner REFCORNER
int8_t SBRAT[4]
uint8_t SBSYMCODELEN
JBig2ComposeOp SBCOMBOP
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFDT
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFRDY
uint32_t SBSTRIPS
std::unique_ptr< CJBig2_Image > DecodeArith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext, JBig2IntDecoderState *pIDS)
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFFS
UnownedPtr< const CJBig2_HuffmanTable > SBHUFFRDW
uint32_t SBNUMSYMS
UNOWNED_PTR_EXCLUSION CJBig2_Image ** SBSYMS
virtual bool NeedToPauseNow()=0
FXCODEC_STATUS
UnownedPtr< CJBig2_ArithIntDecoder > IARDH
UnownedPtr< CJBig2_ArithIntDecoder > IARDY
UnownedPtr< CJBig2_ArithIntDecoder > IARDW
UnownedPtr< CJBig2_ArithIntDecoder > IAIT
UnownedPtr< CJBig2_ArithIntDecoder > IARDX
UnownedPtr< CJBig2_ArithIaidDecoder > IAID
UnownedPtr< CJBig2_ArithIntDecoder > IADS
UnownedPtr< CJBig2_ArithIntDecoder > IARI
UnownedPtr< CJBig2_ArithIntDecoder > IADT
UnownedPtr< CJBig2_ArithIntDecoder > IAFS
bool m_bIsStriped
Definition JBig2_Page.h:19
uint16_t m_wMaxStripeSize
Definition JBig2_Page.h:20
uint32_t m_dwHeight
Definition JBig2_Page.h:14
bool m_bDefaultPixelValue
Definition JBig2_Page.h:18
uint32_t m_dwResolutionY
Definition JBig2_Page.h:16
uint32_t m_dwWidth
Definition JBig2_Page.h:13
uint32_t m_dwResolutionX
Definition JBig2_Page.h:15
#define UNOWNED_PTR_EXCLUSION