7#include "core/fpdfdoc/cpdf_apsettings.h"
12#include "core/fpdfapi/parser/cpdf_array.h"
13#include "core/fpdfapi/parser/cpdf_dictionary.h"
14#include "core/fpdfapi/parser/cpdf_stream.h"
15#include "core/fpdfdoc/cpdf_formcontrol.h"
25 return m_pDict && m_pDict->KeyExist(csEntry);
29 return m_pDict ? m_pDict->GetIntegerFor(
"R") : 0;
33 const ByteString& csEntry)
const {
37 RetainPtr<
const CPDF_Array> pEntry = m_pDict->GetArrayFor(csEntry);
41 const size_t dwCount = pEntry->size();
43 const float g = pEntry->GetFloatAt(0) * 255;
47 float r = pEntry->GetFloatAt(0) * 255;
48 float g = pEntry->GetFloatAt(1) * 255;
49 float b = pEntry->GetFloatAt(2) * 255;
53 float c = pEntry->GetFloatAt(0);
54 float m = pEntry->GetFloatAt(1);
55 float y = pEntry->GetFloatAt(2);
56 float k = pEntry->GetFloatAt(3);
57 float r = (1.0f -
std::min(1.0f, c + k)) * 255;
58 float g = (1.0f -
std::min(1.0f, m + k)) * 255;
59 float b = (1.0f -
std::min(1.0f, y + k)) * 255;
67 const ByteString& csEntry)
const {
71 RetainPtr<
const CPDF_Array> pEntry = m_pDict->GetArrayFor(csEntry);
72 return pEntry ? pEntry->GetFloatAt(index) : 0;
79 RetainPtr<
const CPDF_Array> pEntry = m_pDict->GetArrayFor(csEntry);
83 size_t dwCount = pEntry->size();
89 pEntry->GetFloatAt(1), pEntry->GetFloatAt(2));
93 pEntry->GetFloatAt(1), pEntry->GetFloatAt(2),
94 pEntry->GetFloatAt(3));
100 return m_pDict ? m_pDict->GetUnicodeTextFor(csEntry) : WideString();
104 const ByteString& csEntry)
const {
105 return m_pDict ? m_pDict->GetMutableStreamFor(csEntry) :
nullptr;
109 return CPDF_IconFit(m_pDict ? m_pDict->GetDictFor(
"IF") :
nullptr);
CFX_Color GetOriginalColor(const ByteString &csEntry) const
bool HasMKEntry(const ByteString &csEntry) const
RetainPtr< CPDF_Stream > GetIcon(const ByteString &csEntry) const
CPDF_ApSettings(const CPDF_ApSettings &that)
CPDF_IconFit GetIconFit() const
WideString GetCaption(const ByteString &csEntry) const
float GetOriginalColorComponent(int index, const ByteString &csEntry) const
CFX_Color::TypeAndARGB GetColorARGB(const ByteString &csEntry) const
CPDF_ApSettings(RetainPtr< CPDF_Dictionary > pDict)
int GetTextPosition() const
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
TypeAndARGB(CFX_Color::Type type_in, FX_ARGB argb_in)
constexpr CFX_Color(Type type=CFX_Color::Type::kTransparent, float color1=0.0f, float color2=0.0f, float color3=0.0f, float color4=0.0f)