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.cpp
Go to the documentation of this file.
1
// Copyright 2017 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
#
include
"core/fxcodec/scanlinedecoder.h"
8
9
#
include
"core/fxcrt/pauseindicator_iface.h"
10
11
namespace
fxcodec
{
12
13
ScanlineDecoder
::
ScanlineDecoder
() :
ScanlineDecoder
(
0
,
0
,
0
,
0
,
0
,
0
,
0
)
{}
14
15
ScanlineDecoder
::
ScanlineDecoder
(
int
nOrigWidth,
16
int
nOrigHeight,
17
int
nOutputWidth,
18
int
nOutputHeight,
19
int
nComps,
20
int
nBpc,
21
uint32_t nPitch)
22
:
m_OrigWidth
(nOrigWidth),
23
m_OrigHeight
(nOrigHeight),
24
m_OutputWidth
(nOutputWidth),
25
m_OutputHeight
(nOutputHeight),
26
m_nComps
(nComps),
27
m_bpc
(nBpc),
28
m_Pitch
(nPitch) {}
29
30
ScanlineDecoder
::~
ScanlineDecoder
() =
default
;
31
32
pdfium::span<
const
uint8_t>
ScanlineDecoder
::
GetScanline
(
int
line) {
33
if
(m_NextLine == line + 1)
34
return
m_pLastScanline;
35
36
if
(
m_NextLine
< 0 ||
m_NextLine
> line) {
37
if
(!
Rewind
(
)
)
38
return
pdfium::span<
const
uint8_t>();
39
m_NextLine
= 0;
40
}
41
while
(
m_NextLine
< line) {
42
GetNextLine
();
43
m_NextLine
++;
44
}
45
m_pLastScanline = GetNextLine();
46
m_NextLine
++;
47
return
m_pLastScanline;
48
}
49
50
bool
ScanlineDecoder
::
SkipToScanline
(
int
line,
PauseIndicatorIface
* pPause) {
51
if
(
m_NextLine
== line ||
m_NextLine
== line + 1)
52
return
false
;
53
54
if
(
m_NextLine
< 0 ||
m_NextLine
> line) {
55
Rewind
(
)
;
56
m_NextLine
= 0;
57
}
58
m_pLastScanline = pdfium::span<uint8_t>();
59
while
(
m_NextLine
< line) {
60
m_pLastScanline = GetNextLine();
61
m_NextLine
++;
62
if
(pPause && pPause
->
NeedToPauseNow
(
)
) {
63
return
true
;
64
}
65
}
66
return
false
;
67
}
68
69
}
// namespace fxcodec
PauseIndicatorIface
Definition
pauseindicator_iface.h:10
PauseIndicatorIface::NeedToPauseNow
virtual bool NeedToPauseNow()=0
fxcodec::ScanlineDecoder
Definition
scanlinedecoder.h:18
fxcodec::ScanlineDecoder::m_OrigHeight
int m_OrigHeight
Definition
scanlinedecoder.h:45
fxcodec::ScanlineDecoder::m_nComps
int m_nComps
Definition
scanlinedecoder.h:48
fxcodec::ScanlineDecoder::m_OutputWidth
int m_OutputWidth
Definition
scanlinedecoder.h:46
fxcodec::ScanlineDecoder::GetNextLine
virtual pdfium::span< uint8_t > GetNextLine()=0
fxcodec::ScanlineDecoder::m_Pitch
uint32_t m_Pitch
Definition
scanlinedecoder.h:50
fxcodec::ScanlineDecoder::ScanlineDecoder
ScanlineDecoder(int nOrigWidth, int nOrigHeight, int nOutputWidth, int nOutputHeight, int nComps, int nBpc, uint32_t nPitch)
Definition
scanlinedecoder.cpp:15
fxcodec::ScanlineDecoder::m_OrigWidth
int m_OrigWidth
Definition
scanlinedecoder.h:44
fxcodec::ScanlineDecoder::~ScanlineDecoder
virtual ~ScanlineDecoder()
fxcodec::ScanlineDecoder::ScanlineDecoder
ScanlineDecoder()
Definition
scanlinedecoder.cpp:13
fxcodec::ScanlineDecoder::m_OutputHeight
int m_OutputHeight
Definition
scanlinedecoder.h:47
fxcodec::ScanlineDecoder::m_bpc
int m_bpc
Definition
scanlinedecoder.h:49
fxcodec::ScanlineDecoder::SkipToScanline
bool SkipToScanline(int line, PauseIndicatorIface *pPause)
Definition
scanlinedecoder.cpp:50
fxcodec::ScanlineDecoder::m_NextLine
int m_NextLine
Definition
scanlinedecoder.h:51
fxcodec::ScanlineDecoder::GetScanline
pdfium::span< const uint8_t > GetScanline(int line)
Definition
scanlinedecoder.cpp:32
fxcodec::ScanlineDecoder::Rewind
virtual bool Rewind()=0
fxcodec
Definition
fpdf_parser_decode.h:27
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxcodec
scanlinedecoder.cpp
Generated on Wed Nov 13 2024 00:58:09 for Qt by
1.12.0