/// returns current position in stream static long Tell(void* datasource) { if (!ToStream(datasource).CanSeek()) return -1; return static_cast<long>(ToStream(datasource).Position()); }
const mr_string mr_exception::fileName() const { // We never use this value to open a file so we are safe to always convert its width. mr_stringstream ss; ToStream( ss, ExtractFileName( m_fileName ) ); return ss.str(); }
std::ostream& operator<<(std::ostream& os, std::tuple<Ts...> t) { os << '('; apply_void(ToStream(os), t); os << "\b)"; return os; }
void DotGraph::WriteToFile(const char* filename) { FILE* file = my_fopen(filename, "w"); ToStream(file); my_fclose(file); }
bool CPDF_DataAvail::CheckHintTables(DownloadHints* pHints) { if (m_pLinearized->GetPageCount() <= 1) { m_docStatus = PDF_DATAAVAIL_DONE; return true; } if (!m_pLinearized->HasHintTable()) { m_docStatus = PDF_DATAAVAIL_ERROR; return false; } FX_FILESIZE szHintStart = m_pLinearized->GetHintStart(); FX_FILESIZE szHintLength = m_pLinearized->GetHintLength(); if (!IsDataAvail(szHintStart, szHintLength, pHints)) return false; m_syntaxParser.InitParser(m_pFileRead, m_dwHeaderOffset); std::unique_ptr<CPDF_HintTables> pHintTables( new CPDF_HintTables(this, m_pLinearized.get())); std::unique_ptr<CPDF_Object> pHintStream( ParseIndirectObjectAt(szHintStart, 0)); CPDF_Stream* pStream = ToStream(pHintStream.get()); if (pStream && pHintTables->LoadHintStream(pStream)) m_pHintTables = std::move(pHintTables); m_docStatus = PDF_DATAAVAIL_DONE; return true; }
const Link* RecursiveGetLCAWithLength(const Link* from, string tax1, string tax2, bool& found1, bool& found2, double& totlength) { const Link* ret= 0; if (from->isLeaf()) { // found1 |= (from->GetNode()->GetName() == tax1); // found2 |= (from->GetNode()->GetName() == tax2); found1 |= (GetLeafNodeName(from) == tax1); found2 |= (GetLeafNodeName(from) == tax2); if (! ret) { if (found1 && found2) { ret = from; } } } else { for (const Link* link=from->Next(); link!=from; link=link->Next()) { bool tmp1 = false; bool tmp2 = false; const Link* ret2 = RecursiveGetLCAWithLength(link->Out(),tax1,tax2,tmp1,tmp2,totlength); found1 |= tmp1; found2 |= tmp2; if (ret2) { if (ret) { cerr << "error : found node twice\n"; cerr << tax1 << '\t' << tax2 << '\n'; ToStream(cerr,ret2->Out()); cerr << '\n'; ToStream(cerr,ret->Out()); cerr << '\n'; exit(1); } ret = ret2; } } if (! ret) { if (found1 && found2) { ret = from; } } } if ((found1 || found2) && ! (found1 && found2)) { totlength += GetLength(from->GetBranch()); } return ret; }
/// reads data from stream static size_t Read(void* ptr, size_t size, size_t nmemb, void* datasource) { if (ToStream(datasource).AtEndOfStream()) return 0; try { DWORD dwBytesRead = 0; ToStream(datasource).Read(ptr, size*nmemb, dwBytesRead); errno = 0; return dwBytesRead; } catch(...) { errno = 1; return 0; } }
CPDF_Image* CPDF_Image::Clone() { if (m_pStream->GetObjNum()) return m_pDocument->GetPageData()->GetImage(m_pStream); CPDF_Image* pImage = new CPDF_Image(m_pDocument); pImage->LoadImageF(ToStream(m_pStream->CPDF_Object::Clone()), m_bInline); if (m_bInline) pImage->SetInlineDict(ToDictionary(m_pInlineDict->Clone(TRUE))); return pImage; }
/// seeks in stream static int Seek(void* datasource, ogg_int64_t offset, int whence) { if (!ToStream(datasource).CanSeek()) return -1; try { // we can pass 'whence' to Seek() unmodified as long as these conditions are met: static_assert(SEEK_SET == Stream::IStream::seekBegin, "seekBegin must have same value as SEEK_SET"); static_assert(SEEK_CUR == Stream::IStream::seekCurrent, "seekCurrent must have same value as SEEK_CUR"); static_assert(SEEK_END == Stream::IStream::seekEnd, "seekEnd must have same value as SEEK_END"); ToStream(datasource).Seek(offset, static_cast<Stream::IStream::ESeekOrigin>(whence)); } catch(...) { return -1; } return 0; }
/// closes stream static int Close(void* datasource) { try { ToStream(datasource).Close(); } catch(...) { return 1; } return 0; }
CPDF_Type3Char* CPDF_Type3Font::LoadChar(uint32_t charcode, int level) { if (level >= _FPDF_MAX_TYPE3_FORM_LEVEL_) return nullptr; auto it = m_CacheMap.find(charcode); if (it != m_CacheMap.end()) return it->second; const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode); if (!name) return nullptr; CPDF_Stream* pStream = ToStream(m_pCharProcs ? m_pCharProcs->GetDirectObjectBy(name) : nullptr); if (!pStream) return nullptr; std::unique_ptr<CPDF_Type3Char> pNewChar(new CPDF_Type3Char(new CPDF_Form( m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, nullptr))); // This can trigger recursion into this method. The content of |m_CacheMap| // can change as a result. Thus after it returns, check the cache again for // a cache hit. pNewChar->m_pForm->ParseContent(nullptr, nullptr, pNewChar.get(), level + 1); it = m_CacheMap.find(charcode); if (it != m_CacheMap.end()) return it->second; FX_FLOAT scale = m_FontMatrix.GetXUnit(); pNewChar->m_Width = (int32_t)(pNewChar->m_Width * scale + 0.5f); FX_RECT& rcBBox = pNewChar->m_BBox; CFX_FloatRect char_rect( (FX_FLOAT)rcBBox.left / 1000.0f, (FX_FLOAT)rcBBox.bottom / 1000.0f, (FX_FLOAT)rcBBox.right / 1000.0f, (FX_FLOAT)rcBBox.top / 1000.0f); if (rcBBox.right <= rcBBox.left || rcBBox.bottom >= rcBBox.top) char_rect = pNewChar->m_pForm->CalcBoundingBox(); char_rect.Transform(&m_FontMatrix); rcBBox.left = FXSYS_round(char_rect.left * 1000); rcBBox.right = FXSYS_round(char_rect.right * 1000); rcBBox.top = FXSYS_round(char_rect.top * 1000); rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000); ASSERT(!pdfium::ContainsKey(m_CacheMap, charcode)); CPDF_Type3Char* pCachedChar = pNewChar.release(); m_CacheMap[charcode] = pCachedChar; if (pCachedChar->m_pForm->GetPageObjectList()->empty()) pCachedChar->m_pForm.reset(); return pCachedChar; }
void CPDF_StreamContentParser::Handle_ExecuteXObject() { CFX_ByteString name = GetString(0); if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() && m_pLastImage->GetStream()->GetObjNum()) { AddImage(nullptr, m_pLastImage, FALSE); return; } if (m_Options.m_bTextOnly) { if (!m_pResources) return; CPDF_Dictionary* pList = m_pResources->GetDict("XObject"); if (!pList && m_pPageResources && m_pResources != m_pPageResources) pList = m_pPageResources->GetDict("XObject"); if (!pList) return; CPDF_Reference* pRes = ToReference(pList->GetElement(name)); if (!pRes) return; FX_BOOL bForm; if (m_pDocument->IsFormStream(pRes->GetRefObjNum(), bForm) && !bForm) return; } CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name)); if (!pXObject) { m_bResourceMissing = TRUE; return; } CFX_ByteStringC type = pXObject->GetDict() ? pXObject->GetDict()->GetConstString("Subtype") : CFX_ByteStringC(); if (type == "Image") { if (m_Options.m_bTextOnly) { return; } CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE); m_LastImageName = name; m_pLastImage = pObj->m_pImage; if (!m_pObjectList->m_bHasImageMask) m_pObjectList->m_bHasImageMask = m_pLastImage->IsMask(); } else if (type == "Form") { AddForm(pXObject); } else { return; } }
CPDF_ContentParser::Stage CPDF_ContentParser::GetContent() { ASSERT(m_CurrentStage == Stage::kGetContent); ASSERT(m_pObjectHolder->IsPage()); CPDF_Array* pContent = m_pObjectHolder->GetDict()->GetArrayFor(pdfium::page_object::kContents); CPDF_Stream* pStreamObj = ToStream( pContent ? pContent->GetDirectObjectAt(m_CurrentOffset) : nullptr); m_StreamArray[m_CurrentOffset] = pdfium::MakeRetain<CPDF_StreamAcc>(pStreamObj); m_StreamArray[m_CurrentOffset]->LoadAllDataFiltered(); m_CurrentOffset++; return m_CurrentOffset == m_nStreams ? Stage::kPrepareContent : Stage::kGetContent; }
void CPDF_StreamContentParser::Handle_ShadeFill() { if (m_Options.m_bTextOnly) { return; } CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE); if (!pPattern) { return; } if (pPattern->m_PatternType != CPDF_Pattern::SHADING) { return; } CPDF_ShadingPattern* pShading = static_cast<CPDF_ShadingPattern*>(pPattern); if (!pShading->m_bShadingObj) { return; } if (!pShading->Load()) { return; } CPDF_ShadingObject* pObj = new CPDF_ShadingObject; pObj->m_pShading = pShading; SetGraphicStates(pObj, FALSE, FALSE, FALSE); pObj->m_Matrix = m_pCurStates->m_CTM; pObj->m_Matrix.Concat(m_mtContentToUser); CFX_FloatRect bbox; if (!pObj->m_ClipPath.IsNull()) { bbox = pObj->m_ClipPath.GetClipBox(); } else { bbox = m_BBox; } if (pShading->IsMeshShading()) { bbox.Intersect(GetShadingBBox(ToStream(pShading->m_pShadingObj), pShading->m_ShadingType, &pObj->m_Matrix, pShading->m_pFunctions, pShading->m_nFuncs, pShading->m_pCS)); } pObj->m_Left = bbox.left; pObj->m_Right = bbox.right; pObj->m_Top = bbox.top; pObj->m_Bottom = bbox.bottom; m_pObjectList->m_ObjectList.AddTail(pObj); }
bool CPDF_ShadingPattern::Load() { if (m_ShadingType != kInvalidShading) return true; CPDF_Dictionary* pShadingDict = m_pShadingObj ? m_pShadingObj->GetDict() : nullptr; if (!pShadingDict) return false; m_pFunctions.clear(); CPDF_Object* pFunc = pShadingDict->GetDirectObjectFor("Function"); if (pFunc) { if (CPDF_Array* pArray = pFunc->AsArray()) { m_pFunctions.resize(std::min<size_t>(pArray->GetCount(), 4)); for (size_t i = 0; i < m_pFunctions.size(); ++i) m_pFunctions[i] = CPDF_Function::Load(pArray->GetDirectObjectAt(i)); } else { m_pFunctions.push_back(CPDF_Function::Load(pFunc)); } } CPDF_Object* pCSObj = pShadingDict->GetDirectObjectFor("ColorSpace"); if (!pCSObj) return false; CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData(); m_pCS = pDocPageData->GetColorSpace(pCSObj, nullptr); if (m_pCS) m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray()); m_ShadingType = ToShadingType(pShadingDict->GetIntegerFor("ShadingType")); // We expect to have a stream if our shading type is a mesh. if (IsMeshShading() && !ToStream(m_pShadingObj)) return false; return true; }
void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix) { CPDF_Dictionary* pDict = m_pPage->m_pFormDict; CPDF_Object* pContent = pDict ? pDict->GetElementValue("Contents") : NULL; if (!pContent) return; CFX_ByteTextBuf buf; if (CPDF_Array* pArray = pContent->AsArray()) { int iCount = pArray->GetCount(); CPDF_StreamAcc** pContentArray = FX_Alloc(CPDF_StreamAcc*, iCount); int size = 0; int i = 0; for (i = 0; i < iCount; ++i) { pContent = pArray->GetElement(i); CPDF_Stream* pStream = ToStream(pContent); if (!pStream) continue; CPDF_StreamAcc* pStreamAcc = new CPDF_StreamAcc(); pStreamAcc->LoadAllData(pStream); pContentArray[i] = pStreamAcc; size += pContentArray[i]->GetSize() + 1; } int pos = 0; uint8_t* pBuf = FX_Alloc(uint8_t, size); for (i = 0; i < iCount; ++i) { FXSYS_memcpy(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize()); pos += pContentArray[i]->GetSize() + 1; pBuf[pos - 1] = ' '; delete pContentArray[i]; } ProcessForm(buf, pBuf, size, matrix); FX_Free(pBuf); FX_Free(pContentArray); } else if (CPDF_Stream* pStream = pContent->AsStream()) {
void CPDFXFA_DocEnvironment::ExportData(CXFA_FFDoc* hDoc, const CFX_WideString& wsFilePath, bool bXDP) { if (hDoc != m_pContext->GetXFADoc()) return; if (m_pContext->GetDocType() != DOCTYPE_DYNAMIC_XFA && m_pContext->GetDocType() != DOCTYPE_STATIC_XFA) { return; } CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv(); if (!pFormFillEnv) return; int fileType = bXDP ? FXFA_SAVEAS_XDP : FXFA_SAVEAS_XML; CFX_ByteString bs = wsFilePath.UTF16LE_Encode(); if (wsFilePath.IsEmpty()) { if (!pFormFillEnv->GetFormFillInfo() || !pFormFillEnv->GetFormFillInfo()->m_pJsPlatform) { return; } CFX_WideString filepath = pFormFillEnv->JS_fieldBrowse(); bs = filepath.UTF16LE_Encode(); } int len = bs.GetLength(); FPDF_FILEHANDLER* pFileHandler = pFormFillEnv->OpenFile(bXDP ? FXFA_SAVEAS_XDP : FXFA_SAVEAS_XML, (FPDF_WIDESTRING)bs.GetBuffer(len), "wb"); bs.ReleaseBuffer(len); if (!pFileHandler) return; CFX_RetainPtr<IFX_SeekableStream> fileWrite = MakeSeekableStream(pFileHandler); CFX_ByteString content; if (fileType == FXFA_SAVEAS_XML) { content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"; fileWrite->WriteBlock(content.c_str(), fileWrite->GetSize(), content.GetLength()); m_pContext->GetXFADocView()->GetDoc()->SavePackage(XFA_HASHCODE_Data, fileWrite, nullptr); } else if (fileType == FXFA_SAVEAS_XDP) { if (!m_pContext->GetPDFDoc()) return; CPDF_Dictionary* pRoot = m_pContext->GetPDFDoc()->GetRoot(); if (!pRoot) return; CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm"); if (!pAcroForm) return; CPDF_Array* pArray = ToArray(pAcroForm->GetObjectFor("XFA")); if (!pArray) return; int size = pArray->GetCount(); for (int i = 1; i < size; i += 2) { CPDF_Object* pPDFObj = pArray->GetObjectAt(i); CPDF_Object* pPrePDFObj = pArray->GetObjectAt(i - 1); if (!pPrePDFObj->IsString()) continue; if (!pPDFObj->IsReference()) continue; CPDF_Stream* pStream = ToStream(pPDFObj->GetDirect()); if (!pStream) continue; if (pPrePDFObj->GetString() == "form") { m_pContext->GetXFADocView()->GetDoc()->SavePackage(XFA_HASHCODE_Form, fileWrite, nullptr); continue; } if (pPrePDFObj->GetString() == "datasets") { m_pContext->GetXFADocView()->GetDoc()->SavePackage( XFA_HASHCODE_Datasets, fileWrite, nullptr); continue; } if (i == size - 1) { CFX_WideString wPath = CFX_WideString::FromUTF16LE( reinterpret_cast<const unsigned short*>(bs.c_str()), bs.GetLength() / sizeof(unsigned short)); CFX_ByteString bPath = wPath.UTF8Encode(); const char* szFormat = "\n<pdf href=\"%s\" xmlns=\"http://ns.adobe.com/xdp/pdf/\"/>"; content.Format(szFormat, bPath.c_str()); fileWrite->WriteBlock(content.c_str(), fileWrite->GetSize(), content.GetLength()); } std::unique_ptr<CPDF_StreamAcc> pAcc(new CPDF_StreamAcc); pAcc->LoadAllData(pStream); fileWrite->WriteBlock(pAcc->GetData(), fileWrite->GetSize(), pAcc->GetSize()); } } fileWrite->Flush(); }
CPDF_Stream* CPDF_Array::GetStreamAt(size_t i) const { return ToStream(GetDirectObjectAt(i)); }
CPDF_Stream* CPDF_Dictionary::GetStream(const CFX_ByteStringC& key) const { return ToStream(GetElementValue(key)); }
void CPDF_ContentParser::Continue(IFX_Pause* pPause) { int steps = 0; while (m_Status == ToBeContinued) { if (m_InternalStage == STAGE_GETCONTENT) { if (m_CurrentOffset == m_nStreams) { if (!m_StreamArray.empty()) { FX_SAFE_UINT32 safeSize = 0; for (const auto& stream : m_StreamArray) { safeSize += stream->GetSize(); safeSize += 1; } if (!safeSize.IsValid()) { m_Status = Done; return; } m_Size = safeSize.ValueOrDie(); m_pData = FX_Alloc(uint8_t, m_Size); uint32_t pos = 0; for (const auto& stream : m_StreamArray) { FXSYS_memcpy(m_pData + pos, stream->GetData(), stream->GetSize()); pos += stream->GetSize(); m_pData[pos++] = ' '; } m_StreamArray.clear(); } else { m_pData = (uint8_t*)m_pSingleStream->GetData(); m_Size = m_pSingleStream->GetSize(); } m_InternalStage = STAGE_PARSE; m_CurrentOffset = 0; } else { CPDF_Array* pContent = m_pObjectHolder->m_pFormDict->GetArrayFor("Contents"); m_StreamArray[m_CurrentOffset].reset(new CPDF_StreamAcc); CPDF_Stream* pStreamObj = ToStream( pContent ? pContent->GetDirectObjectAt(m_CurrentOffset) : nullptr); m_StreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, false); m_CurrentOffset++; } } if (m_InternalStage == STAGE_PARSE) { if (!m_pParser) { m_pParser.reset(new CPDF_StreamContentParser( m_pObjectHolder->m_pDocument, m_pObjectHolder->m_pPageResources, nullptr, nullptr, m_pObjectHolder, m_pObjectHolder->m_pResources, &m_pObjectHolder->m_BBox, nullptr, 0)); m_pParser->GetCurStates()->m_ColorState.SetDefault(); } if (m_CurrentOffset >= m_Size) { m_InternalStage = STAGE_CHECKCLIP; } else { m_CurrentOffset += m_pParser->Parse(m_pData + m_CurrentOffset, m_Size - m_CurrentOffset, PARSE_STEP_LIMIT); } } if (m_InternalStage == STAGE_CHECKCLIP) { if (m_pType3Char) { m_pType3Char->m_bColored = m_pParser->IsColored(); m_pType3Char->m_Width = FXSYS_round(m_pParser->GetType3Data()[0] * 1000); m_pType3Char->m_BBox.left = FXSYS_round(m_pParser->GetType3Data()[2] * 1000); m_pType3Char->m_BBox.bottom = FXSYS_round(m_pParser->GetType3Data()[3] * 1000); m_pType3Char->m_BBox.right = FXSYS_round(m_pParser->GetType3Data()[4] * 1000); m_pType3Char->m_BBox.top = FXSYS_round(m_pParser->GetType3Data()[5] * 1000); } for (auto& pObj : *m_pObjectHolder->GetPageObjectList()) { if (!pObj->m_ClipPath) continue; if (pObj->m_ClipPath.GetPathCount() != 1) continue; if (pObj->m_ClipPath.GetTextCount()) continue; CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0); if (!ClipPath.IsRect() || pObj->IsShading()) continue; CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0), ClipPath.GetPointX(2), ClipPath.GetPointY(2)); CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top); if (old_rect.Contains(obj_rect)) pObj->m_ClipPath.SetNull(); } m_Status = Done; return; } steps++; if (pPause && pPause->NeedToPauseNow()) break; } }
void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_Matrix* pMatrix, FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode) { CPDF_Function** pFuncs = pPattern->m_pFunctions; int nFuncs = pPattern->m_nFuncs; CPDF_Dictionary* pDict = pPattern->m_pShadingObj->GetDict(); CPDF_ColorSpace* pColorSpace = pPattern->m_pCS; if (!pColorSpace) { return; } FX_ARGB background = 0; if (!pPattern->m_bShadingObj && pPattern->m_pShadingObj->GetDict()->KeyExist("Background")) { CPDF_Array* pBackColor = pPattern->m_pShadingObj->GetDict()->GetArray("Background"); if (pBackColor && pBackColor->GetCount() >= (FX_DWORD)pColorSpace->CountComponents()) { CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents()); for (int i = 0; i < pColorSpace->CountComponents(); i++) { comps[i] = pBackColor->GetNumber(i); } FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; pColorSpace->GetRGB(comps, R, G, B); background = ArgbEncode(255, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255)); } } if (pDict->KeyExist("BBox")) { CFX_FloatRect rect = pDict->GetRect("BBox"); rect.Transform(pMatrix); clip_rect.Intersect(rect.GetOutterRect()); } CPDF_DeviceBuffer buffer; buffer.Initialize(m_pContext, m_pDevice, &clip_rect, m_pCurObj, 150); CFX_Matrix FinalMatrix = *pMatrix; FinalMatrix.Concat(*buffer.GetMatrix()); CFX_DIBitmap* pBitmap = buffer.GetBitmap(); if (!pBitmap->GetBuffer()) { return; } pBitmap->Clear(background); int fill_mode = m_Options.m_Flags; switch (pPattern->m_ShadingType) { case kInvalidShading: case kMaxShading: return; case kFunctionBasedShading: DrawFuncShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha); break; case kAxialShading: DrawAxialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha); break; case kRadialShading: DrawRadialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha); break; case kFreeFormGouraudTriangleMeshShading: { DrawFreeGouraudShading(pBitmap, &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, pColorSpace, alpha); } break; case kLatticeFormGouraudTriangleMeshShading: { DrawLatticeGouraudShading(pBitmap, &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, pColorSpace, alpha); } break; case kCoonsPatchMeshShading: case kTensorProductPatchMeshShading: { DrawCoonPatchMeshes( pPattern->m_ShadingType == kTensorProductPatchMeshShading, pBitmap, &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, pColorSpace, fill_mode, alpha); } break; } if (bAlphaMode) { pBitmap->LoadChannel(FXDIB_Red, pBitmap, FXDIB_Alpha); } if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) { pBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor); } buffer.OutputToDevice(); }
CPDF_Stream* CPDF_Array::GetStream(FX_DWORD i) const { return ToStream(GetElementValue(i)); }