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
cfx_bitmapstorer.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/fxge/dib/cfx_bitmapstorer.h"
8
9
#
include
<
utility
>
10
11
#
include
"core/fxcrt/check_op.h"
12
#
include
"core/fxcrt/stl_util.h"
13
#
include
"core/fxge/dib/cfx_dibitmap.h"
14
15
CFX_BitmapStorer::
CFX_BitmapStorer
() =
default
;
16
17
CFX_BitmapStorer::~
CFX_BitmapStorer
() =
default
;
18
19
RetainPtr
<CFX_DIBitmap> CFX_BitmapStorer::
Detach
() {
20
return
std::move(m_pBitmap);
21
}
22
23
void
CFX_BitmapStorer::
Replace
(
RetainPtr
<CFX_DIBitmap>&& pBitmap) {
24
m_pBitmap = std::move(pBitmap);
25
}
26
27
void
CFX_BitmapStorer::
ComposeScanline
(
int
line,
28
pdfium::span<
const
uint8_t> scanline) {
29
pdfium::span<uint8_t> dest_buf = m_pBitmap->GetWritableScanline(line);
30
if
(!dest_buf.empty()) {
31
fxcrt
::Copy(scanline, dest_buf);
32
}
33
}
34
35
bool
CFX_BitmapStorer::
SetInfo
(
int
width,
36
int
height,
37
FXDIB_Format
src_format,
38
DataVector<uint32_t> src_palette) {
39
DCHECK_NE
(src_format,
FXDIB_Format
::
k1bppMask
);
40
DCHECK_NE
(src_format,
FXDIB_Format
::
k1bppRgb
);
41
auto
pBitmap =
pdfium
::MakeRetain<CFX_DIBitmap>();
42
if
(!pBitmap->Create(width, height, src_format))
43
return
false
;
44
45
if
(!src_palette.empty()) {
46
pBitmap->TakePalette(
std
::move(src_palette));
47
}
48
49
m_pBitmap = std::move(pBitmap);
50
return
true
;
51
}
DCHECK_NE
#define DCHECK_NE(x, y)
Definition
check_op.h:18
CFX_BitmapStorer::ComposeScanline
void ComposeScanline(int line, pdfium::span< const uint8_t > scanline) override
Definition
cfx_bitmapstorer.cpp:27
CFX_BitmapStorer::~CFX_BitmapStorer
~CFX_BitmapStorer() override
CFX_BitmapStorer::Replace
void Replace(RetainPtr< CFX_DIBitmap > &&pBitmap)
Definition
cfx_bitmapstorer.cpp:23
CFX_BitmapStorer::CFX_BitmapStorer
CFX_BitmapStorer()
CFX_BitmapStorer::Detach
RetainPtr< CFX_DIBitmap > Detach()
Definition
cfx_bitmapstorer.cpp:19
CFX_BitmapStorer::SetInfo
bool SetInfo(int width, int height, FXDIB_Format src_format, DataVector< uint32_t > src_palette) override
Definition
cfx_bitmapstorer.cpp:35
fxcrt::RetainPtr
Definition
retain_ptr.h:28
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
FXDIB_Format
FXDIB_Format
Definition
fx_dib.h:21
FXDIB_Format::k1bppRgb
@ k1bppRgb
Definition
fx_dib.h:23
FXDIB_Format::k1bppMask
@ k1bppMask
Definition
fx_dib.h:27
fxcrt
Definition
stl_util.h:17
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxge
dib
cfx_bitmapstorer.cpp
Generated on
for Qt by
1.14.0