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
cpdf_icon.cpp
Go to the documentation of this file.
1
// Copyright 2019 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/fpdfdoc/cpdf_icon.h"
8
9
#
include
<
utility
>
10
11
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
12
#
include
"core/fpdfapi/parser/cpdf_stream.h"
13
14
CPDF_Icon::
CPDF_Icon
(
RetainPtr
<
const
CPDF_Stream> pStream)
15
:
m_pStream
(
std
::
move
(
pStream
)) {}
16
17
CPDF_Icon::~
CPDF_Icon
() =
default
;
18
19
CFX_SizeF CPDF_Icon::
GetImageSize
()
const
{
20
RetainPtr
<
const
CPDF_Dictionary> pDict = m_pStream->GetDict();
21
if
(!pDict)
22
return
CFX_SizeF();
23
24
CFX_FloatRect
rect = pDict->GetRectFor(
"BBox"
);
25
return
{rect
.
right
- rect
.
left
, rect
.
top
- rect
.
bottom
};
26
}
27
28
CFX_Matrix
CPDF_Icon::
GetImageMatrix
()
const
{
29
RetainPtr
<
const
CPDF_Dictionary> pDict = m_pStream->GetDict();
30
if
(!pDict)
31
return
CFX_Matrix
(
)
;
32
33
return
pDict->GetMatrixFor(
"Matrix"
);
34
}
35
36
ByteString CPDF_Icon::
GetImageAlias
()
const
{
37
RetainPtr
<
const
CPDF_Dictionary> pDict = m_pStream->GetDict();
38
if
(!pDict)
39
return
ByteString
(
)
;
40
41
return
pDict->GetByteStringFor(
"Name"
);
42
}
CFX_FloatRect
Definition
fx_coordinates.h:189
CFX_FloatRect::left
float left
Definition
fx_coordinates.h:273
CFX_FloatRect::bottom
float bottom
Definition
fx_coordinates.h:274
CFX_FloatRect::right
float right
Definition
fx_coordinates.h:275
CFX_FloatRect::top
float top
Definition
fx_coordinates.h:276
CFX_Matrix
Definition
fx_coordinates.h:452
CFX_Matrix::CFX_Matrix
CFX_Matrix()=default
CPDF_Icon::GetImageMatrix
CFX_Matrix GetImageMatrix() const
Definition
cpdf_icon.cpp:28
CPDF_Icon::CPDF_Icon
CPDF_Icon(RetainPtr< const CPDF_Stream > pStream)
Definition
cpdf_icon.cpp:14
CPDF_Icon::GetImageSize
CFX_SizeF GetImageSize() const
Definition
cpdf_icon.cpp:19
CPDF_Icon::GetImageAlias
ByteString GetImageAlias() const
Definition
cpdf_icon.cpp:36
CPDF_Icon::~CPDF_Icon
~CPDF_Icon()
fxcrt::ByteString::ByteString
ByteString()
fxcrt::RetainPtr
Definition
retain_ptr.h:29
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfdoc
cpdf_icon.cpp
Generated on Thu Nov 14 2024 00:57:21 for Qt by
1.12.0