44 for (
const auto& it : locker) {
45 RetainPtr<CPDF_Object> pObject = it.second->GetMutableDirect();
49 uint32_t key = it.first.GetID();
51 case FXBSTR_ID(
'L',
'W', 0, 0):
52 mutable_graph_state().SetLineWidth(pObject->GetNumber());
54 case FXBSTR_ID(
'L',
'C', 0, 0):
55 mutable_graph_state().SetLineCap(
56 static_cast<CFX_GraphStateData::LineCap>(pObject->GetInteger()));
58 case FXBSTR_ID(
'L',
'J', 0, 0):
59 mutable_graph_state().SetLineJoin(
60 static_cast<CFX_GraphStateData::LineJoin>(pObject->GetInteger()));
62 case FXBSTR_ID(
'M',
'L', 0, 0):
63 mutable_graph_state().SetMiterLimit(pObject->GetNumber());
65 case FXBSTR_ID(
'D', 0, 0, 0): {
66 const CPDF_Array* pDash = pObject->AsArray();
70 RetainPtr<
const CPDF_Array> pArray = pDash->GetArrayAt(0);
74 SetLineDash(pArray.Get(), pDash->GetFloatAt(1), 1.0f);
77 case FXBSTR_ID(
'R',
'I', 0, 0):
78 mutable_general_state().SetRenderIntent(pObject->GetString());
80 case FXBSTR_ID(
'F',
'o',
'n',
't'): {
81 const CPDF_Array* pFont = pObject->AsArray();
85 mutable_text_state().SetFontSize(pFont->GetFloatAt(1));
86 mutable_text_state().SetFont(
87 pParser->FindFont(pFont->GetByteStringAt(0)));
90 case FXBSTR_ID(
'T',
'R', 0, 0):
91 if (pGS->KeyExist(
"TR2")) {
95 case FXBSTR_ID(
'T',
'R',
'2', 0):
96 mutable_general_state().SetTR(!pObject->IsName() ? std::move(pObject)
99 case FXBSTR_ID(
'B',
'M', 0, 0): {
100 const CPDF_Array* pArray = pObject->AsArray();
101 mutable_general_state().SetBlendMode(pArray ? pArray->GetByteStringAt(0)
102 : pObject->GetString());
103 if (general_state().GetBlendType() > BlendMode::kMultiply) {
104 pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(
true);
108 case FXBSTR_ID(
'S',
'M',
'a',
's'): {
109 RetainPtr<CPDF_Dictionary> pMaskDict = ToDictionary(pObject);
110 mutable_general_state().SetSoftMask(pMaskDict);
112 mutable_general_state().SetSMaskMatrix(
113 pParser->GetCurStates()->m_CTM);
116 case FXBSTR_ID(
'C',
'A', 0, 0):
117 mutable_general_state().SetStrokeAlpha(
118 std::clamp(pObject->GetNumber(), 0.0f, 1.0f));
120 case FXBSTR_ID(
'c',
'a', 0, 0):
121 mutable_general_state().SetFillAlpha(
122 std::clamp(pObject->GetNumber(), 0.0f, 1.0f));
124 case FXBSTR_ID(
'O',
'P', 0, 0):
125 mutable_general_state().SetStrokeOP(!!pObject->GetInteger());
126 if (!pGS->KeyExist(
"op"))
127 mutable_general_state().SetFillOP(!!pObject->GetInteger());
129 case FXBSTR_ID(
'o',
'p', 0, 0):
130 mutable_general_state().SetFillOP(!!pObject->GetInteger());
132 case FXBSTR_ID(
'O',
'P',
'M', 0):
133 mutable_general_state().SetOPMode(pObject->GetInteger());
135 case FXBSTR_ID(
'B',
'G', 0, 0):
136 if (pGS->KeyExist(
"BG2")) {
140 case FXBSTR_ID(
'B',
'G',
'2', 0):
141 mutable_general_state().SetBG(std::move(pObject));
143 case FXBSTR_ID(
'U',
'C',
'R', 0):
144 if (pGS->KeyExist(
"UCR2")) {
148 case FXBSTR_ID(
'U',
'C',
'R',
'2'):
149 mutable_general_state().SetUCR(std::move(pObject));
151 case FXBSTR_ID(
'H',
'T', 0, 0):
152 mutable_general_state().SetHT(std::move(pObject));
154 case FXBSTR_ID(
'F',
'L', 0, 0):
155 mutable_general_state().SetFlatness(pObject->GetNumber());
157 case FXBSTR_ID(
'S',
'M', 0, 0):
158 mutable_general_state().SetSmoothness(pObject->GetNumber());
160 case FXBSTR_ID(
'S',
'A', 0, 0):
161 mutable_general_state().SetStrokeAdjust(!!pObject->GetInteger());
163 case FXBSTR_ID(
'A',
'I',
'S', 0):
164 mutable_general_state().SetAlphaSource(!!pObject->GetInteger());
166 case FXBSTR_ID(
'T',
'K', 0, 0):
167 mutable_general_state().SetTextKnockout(!!pObject->GetInteger());