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
scanlinedecoder.h
Go to the documentation of this file.
1// Copyright 2016 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_SCANLINEDECODER_H_
8#define CORE_FXCODEC_SCANLINEDECODER_H_
9
10#include <stdint.h>
11
12#include "third_party/base/containers/span.h"
13
15
16namespace fxcodec {
17
19 public:
21 ScanlineDecoder(int nOrigWidth,
22 int nOrigHeight,
23 int nOutputWidth,
24 int nOutputHeight,
25 int nComps,
26 int nBpc,
27 uint32_t nPitch);
28 virtual ~ScanlineDecoder();
29
30 pdfium::span<const uint8_t> GetScanline(int line);
31 bool SkipToScanline(int line, PauseIndicatorIface* pPause);
32
33 int GetWidth() const { return m_OutputWidth; }
34 int GetHeight() const { return m_OutputHeight; }
35 int CountComps() const { return m_nComps; }
36 int GetBPC() const { return m_bpc; }
37
38 virtual uint32_t GetSrcOffset() = 0;
39
40 protected:
41 virtual bool Rewind() = 0;
42 virtual pdfium::span<uint8_t> GetNextLine() = 0;
43
49 int m_bpc;
50 uint32_t m_Pitch;
51 int m_NextLine = -1;
52 pdfium::span<uint8_t> m_pLastScanline;
53};
54
55} // namespace fxcodec
56
57using ScanlineDecoder = fxcodec::ScanlineDecoder;
58
59#endif // CORE_FXCODEC_SCANLINEDECODER_H_
bool HasPalette() const
Definition cfx_dibbase.h:62
FXDIB_Format m_Format
void SetPaletteArgb(int index, uint32_t color)
Family GetFamily() const
static uint32_t ComponentsForFamily(Family family)
static RetainPtr< CPDF_ColorSpace > GetStockCS(Family family)
~CPDF_DIB() override
RetainPtr< CPDF_DIB > DetachMask()
Definition cpdf_dib.cpp:881
size_t GetEstimatedImageMemoryBurden() const override
uint32_t GetMatteColor() const
Definition cpdf_dib.h:53
bool SkipToScanline(int line, PauseIndicatorIface *pPause) const override
bool IsJBigImage() const
Definition cpdf_dib.cpp:885
RetainPtr< CPDF_ColorSpace > GetColorSpace() const
Definition cpdf_dib.h:52
LoadState ContinueLoadDIBBase(PauseIndicatorIface *pPause)
Definition cpdf_dib.cpp:315
bool Load()
Definition cpdf_dib.cpp:224
pdfium::span< const uint8_t > GetScanline(int line) const override
LoadState StartLoadDIBBase(bool bHasMask, const CPDF_Dictionary *pFormResources, const CPDF_Dictionary *pPageResources, bool bStdCS, CPDF_ColorSpace::Family GroupFamily, bool bLoadMask, const CFX_Size &max_size_required)
Definition cpdf_dib.cpp:269
static bool IsValidJpegBitsPerComponent(int32_t bpc)
static bool IsValidJpegComponent(int32_t comps)
int GetMaxIndex() const
static DataVector< uint8_t > RunLengthEncode(pdfium::span< const uint8_t > src_span)
static std::unique_ptr< ScanlineDecoder > CreateRunLengthDecoder(pdfium::span< const uint8_t > src_buf, int width, int height, int nComps, int bpc)
BasicModule & operator=(const BasicModule &)=delete
BasicModule(const BasicModule &)=delete
static DataVector< uint8_t > A85Encode(pdfium::span< const uint8_t > src_span)
static void Sycc420ToRgbForTesting(opj_image_t *img)
static constexpr uint8_t kMaxResolutionsToSkip
static std::unique_ptr< CJPX_Decoder > Create(pdfium::span< const uint8_t > src_span, CJPX_Decoder::ColorSpaceOption option, uint8_t resolution_levels_to_skip)
bool Decode(pdfium::span< uint8_t > dest_buf, uint32_t pitch, bool swap_rgb, uint32_t component_count)
JpxImageInfo GetInfo() const
static bool IsValidIccComponents(int components)
pdfium::span< const uint8_t > m_pSrcSpan
pdfium::span< const uint8_t > m_pGlobalSpan
std::unique_ptr< CJBig2_Context > m_pContext
UNOWNED_PTR_EXCLUSION uint8_t * m_dest_buf
static FXCODEC_STATUS StartDecode(Jbig2Context *pJbig2Context, JBig2_DocumentContext *pJbig2DocumentContext, uint32_t width, uint32_t height, pdfium::span< const uint8_t > src_span, uint64_t src_key, pdfium::span< const uint8_t > global_span, uint64_t global_key, pdfium::span< uint8_t > dest_buf, uint32_t dest_pitch, PauseIndicatorIface *pPause)
static FXCODEC_STATUS ContinueDecode(Jbig2Context *pJbig2Context, PauseIndicatorIface *pPause)
Jbig2Decoder(const Jbig2Decoder &)=delete
Jbig2Decoder & operator=(const Jbig2Decoder &)=delete
JpegModule & operator=(const JpegModule &)=delete
static absl::optional< ImageInfo > LoadInfo(pdfium::span< const uint8_t > src_span)
static std::unique_ptr< ScanlineDecoder > CreateDecoder(pdfium::span< const uint8_t > src_span, uint32_t width, uint32_t height, int nComps, bool ColorTransform)
JpegModule(const JpegModule &)=delete
virtual pdfium::span< uint8_t > GetNextLine()=0
ScanlineDecoder(int nOrigWidth, int nOrigHeight, int nOutputWidth, int nOutputHeight, int nComps, int nBpc, uint32_t nPitch)
pdfium::span< uint8_t > m_pLastScanline
bool SkipToScanline(int line, PauseIndicatorIface *pPause)
virtual uint32_t GetSrcOffset()=0
pdfium::span< const uint8_t > GetScanline(int line)
virtual bool Rewind()=0
bool operator==(const char *ptr) const
bool IsEmpty() const
Definition bytestring.h:119
bool operator!=(const char *ptr) const
Definition bytestring.h:130
constexpr size_t kHugeImageSize
Definition cpdf_dib.h:39
FXCODEC_STATUS
#define FXARGB_B(argb)
Definition fx_dib.h:127
#define FXARGB_G(argb)
Definition fx_dib.h:126
FXDIB_Format MakeRGBFormat(int bpp)
Definition fx_dib.cpp:23
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
Definition fx_dib.h:118
#define FXARGB_R(argb)
Definition fx_dib.h:125
FXDIB_Format
Definition fx_dib.h:19
int FXSYS_roundf(float f)
Definition fx_system.cpp:92
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224
float m_DecodeStep
Definition cpdf_dib.h:29
int m_ColorKeyMin
Definition cpdf_dib.h:30
int m_ColorKeyMax
Definition cpdf_dib.h:31
float m_DecodeMin
Definition cpdf_dib.h:28
#define UNOWNED_PTR_EXCLUSION