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
14CPDF_Icon::CPDF_Icon(RetainPtr<const CPDF_Stream> pStream)
16
17CPDF_Icon::~CPDF_Icon() = default;
18
19CFX_SizeF CPDF_Icon::GetImageSize() const {
20 CFX_FloatRect rect = m_pStream->GetDict()->GetRectFor("BBox");
21 return {rect.right - rect.left, rect.top - rect.bottom};
22}
23
24CFX_Matrix CPDF_Icon::GetImageMatrix() const {
25 return m_pStream->GetDict()->GetMatrixFor("Matrix");
26}
27
28ByteString CPDF_Icon::GetImageAlias() const {
29 return m_pStream->GetDict()->GetByteStringFor("Name");
30}
fxcrt::ByteString ByteString
Definition bytestring.h:180
CFX_Matrix GetImageMatrix() const
Definition cpdf_icon.cpp:24
CPDF_Icon(RetainPtr< const CPDF_Stream > pStream)
Definition cpdf_icon.cpp:14
CFX_SizeF GetImageSize() const
Definition cpdf_icon.cpp:19
ByteString GetImageAlias() const
Definition cpdf_icon.cpp:28
CFX_STemplate< float > CFX_SizeF