当前位置: 首页>>代码示例>>C++>>正文


C++ CPDF_Stream::GetStreamFilter方法代码示例

本文整理汇总了C++中CPDF_Stream::GetStreamFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Stream::GetStreamFilter方法的具体用法?C++ CPDF_Stream::GetStreamFilter怎么用?C++ CPDF_Stream::GetStreamFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPDF_Stream的用法示例。


在下文中一共展示了CPDF_Stream::GetStreamFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Continue

void CPDF_ContentParser::Continue(IFX_Pause* pPause)
{
    while (m_Status == ToBeContinued) {
        if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
            if (m_pStreamFilter == NULL) {
                if (m_CurrentOffset == m_nStreams) {
                    m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
                    if (m_pType3Char) {
                        m_pType3Char->m_bColored = m_pParser->m_bColored;
                        m_pType3Char->m_Width = FXSYS_round(m_pParser->m_Type3Data[0] * 1000);
                        m_pType3Char->m_BBox.left = FXSYS_round(m_pParser->m_Type3Data[2] * 1000);
                        m_pType3Char->m_BBox.bottom = FXSYS_round(m_pParser->m_Type3Data[3] * 1000);
                        m_pType3Char->m_BBox.right = FXSYS_round(m_pParser->m_Type3Data[4] * 1000);
                        m_pType3Char->m_BBox.top = FXSYS_round(m_pParser->m_Type3Data[5] * 1000);
                        m_pType3Char->m_bPageRequired = m_pParser->m_bResourceMissing;
                    }
                    delete m_pParser;
                    m_pParser = NULL;
                    continue;
                }
                CPDF_Object* pContent = m_pObjects->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
                if (pContent->GetType() == PDFOBJ_STREAM) {
                    m_pStreamFilter = ((CPDF_Stream*)pContent)->GetStreamFilter();
                } else {
                    CPDF_Stream* pStream = ((CPDF_Array*)pContent)->GetStream(m_CurrentOffset);
                    if (pStream == NULL) {
                        m_CurrentOffset ++;
                        continue;
                    }
                    m_pStreamFilter = pStream->GetStreamFilter();
                }
            }
            FX_DWORD len = m_pStreamFilter->ReadBlock(m_pParser->m_pStreamBuf, STREAM_PARSE_BUFSIZE);
            m_pParser->InputData(m_pParser->m_pStreamBuf, len);
            if (m_pParser->m_bAbort) {
                delete m_pStreamFilter;
                m_pStreamFilter = NULL;
                m_Status = Done;
                delete m_pParser;
                m_pParser = NULL;
                return;
            }
            if (len < STREAM_PARSE_BUFSIZE) {
                m_pParser->Finish();
                m_CurrentOffset ++;
                delete m_pStreamFilter;
                m_pStreamFilter = NULL;
            }
            if (pPause && pPause->NeedToPauseNow()) {
                return;
            }
        }
        if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
            FX_POSITION pos = m_pObjects->m_ObjectList.GetHeadPosition();
            while (pos) {
                CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetNext(pos);
                if (pObj == NULL) {
                    continue;
                }
                if (pObj->m_ClipPath.IsNull()) {
                    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->m_Type == PDFPAGE_SHADING) {
                    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();
                }
            }
            if (m_pObjects->m_ObjectList.GetCount() == 1) {
                CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetAt(m_pObjects->m_ObjectList.GetHeadPosition());
                if (pObj && pObj->m_Type == PDFPAGE_TEXT) {
                    CPDF_TextObject* pText = (CPDF_TextObject*)pObj;
                }
            }
            m_Status = Done;
            return;
        }
    }
}
开发者ID:codemonkey85,项目名称:pdfium,代码行数:90,代码来源:fpdf_page_parser_new.cpp


注:本文中的CPDF_Stream::GetStreamFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。