FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) { if (m_Status == 1) { if (m_pQuickStretcher->Continue(pPause)) { return TRUE; } if (m_pQuickStretcher->m_pBitmap->IsAlphaMask()) m_pRenderStatus->m_pDevice->SetBitMask( m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, m_pQuickStretcher->m_ResultTop, m_FillArgb); else m_pRenderStatus->m_pDevice->SetDIBits( m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, m_pQuickStretcher->m_ResultTop, m_BlendType); return FALSE; } if (m_Status == 2) { if (m_pTransformer->Continue(pPause)) { return TRUE; } CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); if (pBitmap == NULL) { return FALSE; } if (pBitmap->IsAlphaMask()) { if (m_BitmapAlpha != 255) { m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha); } m_Result = m_pRenderStatus->m_pDevice->SetBitMask( pBitmap, m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_FillArgb); } else { if (m_BitmapAlpha != 255) { pBitmap->MultiplyAlpha(m_BitmapAlpha); } m_Result = m_pRenderStatus->m_pDevice->SetDIBits( pBitmap, m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_BlendType); } delete pBitmap; return FALSE; } if (m_Status == 3) { return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause); } if (m_Status == 4) { if (m_Loader.Continue(m_LoadHandle, pPause)) { return TRUE; } if (StartRenderDIBSource()) { return Continue(pPause); } } return FALSE; }
FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType) { m_pRenderStatus = pStatus; m_bStdCS = bStdCS; m_pImageObject = (CPDF_ImageObject*)pObj; m_BlendType = blendType; m_pObj2Device = pObj2Device; CPDF_Dictionary* pOC = m_pImageObject->m_pImage->GetOC(); if (pOC && m_pRenderStatus->m_Options.m_pOCContext && !m_pRenderStatus->m_Options.m_pOCContext->CheckOCGVisible(pOC)) { return FALSE; } m_ImageMatrix = m_pImageObject->m_Matrix; m_ImageMatrix.Concat(*pObj2Device); if (StartLoadDIBSource()) { return TRUE; } return StartRenderDIBSource(); }
bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device, bool bStdCS, int blendType) { m_pRenderStatus = pStatus; m_bStdCS = bStdCS; m_pImageObject = pObj->AsImage(); m_BlendType = blendType; m_pObj2Device = pObj2Device; CPDF_Dictionary* pOC = m_pImageObject->GetImage()->GetOC(); if (pOC && m_pRenderStatus->m_Options.m_pOCContext && !m_pRenderStatus->m_Options.m_pOCContext->CheckOCGVisible(pOC)) { return false; } m_ImageMatrix = m_pImageObject->matrix(); m_ImageMatrix.Concat(*pObj2Device); if (StartLoadDIBSource()) return true; return StartRenderDIBSource(); }
bool CPDF_ImageRenderer::Continue(IFX_Pause* pPause) { if (m_Status == 2) { if (m_pTransformer->Continue(pPause)) return true; std::unique_ptr<CFX_DIBitmap> pBitmap(m_pTransformer->DetachBitmap()); if (!pBitmap) return false; if (pBitmap->IsAlphaMask()) { if (m_BitmapAlpha != 255) m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha); m_Result = m_pRenderStatus->m_pDevice->SetBitMask( pBitmap.get(), m_pTransformer->result().left, m_pTransformer->result().top, m_FillArgb); } else { if (m_BitmapAlpha != 255) pBitmap->MultiplyAlpha(m_BitmapAlpha); m_Result = m_pRenderStatus->m_pDevice->SetDIBitsWithBlend( pBitmap.get(), m_pTransformer->result().left, m_pTransformer->result().top, m_BlendType); } return false; } if (m_Status == 3) return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause); if (m_Status == 4) { if (m_Loader.Continue(pPause)) return true; if (StartRenderDIBSource()) return Continue(pPause); } return false; }