本文整理汇总了C++中CPDF_Stream::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Stream::Release方法的具体用法?C++ CPDF_Stream::Release怎么用?C++ CPDF_Stream::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Stream
的用法示例。
在下文中一共展示了CPDF_Stream::Release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Handle_BeginImage
void CPDF_StreamContentParser::Handle_BeginImage()
{
FX_FILESIZE savePos = m_pSyntax->GetPos();
CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
while (1) {
CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
if (type == CPDF_StreamParser::Keyword) {
CFX_ByteString bsKeyword(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize());
if (bsKeyword != FX_BSTRC("ID")) {
m_pSyntax->SetPos(savePos);
pDict->Release();
return;
}
}
if (type != CPDF_StreamParser::Name) {
break;
}
CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1, m_pSyntax->GetWordSize() - 1);
CPDF_Object* pObj = m_pSyntax->ReadNextObject();
if (!key.IsEmpty()) {
pDict->SetAt(key, pObj, m_pDocument);
} else if (pObj) {
pObj->Release();
}
}
_PDF_ReplaceAbbr(pDict);
CPDF_Object* pCSObj = NULL;
if (pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
if (pCSObj->GetType() == PDFOBJ_NAME) {
CFX_ByteString name = pCSObj->GetString();
if (name != FX_BSTRC("DeviceRGB") && name != FX_BSTRC("DeviceGray") && name != FX_BSTRC("DeviceCMYK")) {
pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
if (pCSObj && !pCSObj->GetObjNum()) {
pCSObj = pCSObj->Clone();
pDict->SetAt(FX_BSTRC("ColorSpace"), pCSObj, m_pDocument);
}
}
}
}
CPDF_Stream* pStream = m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj, m_Options.m_bDecodeInlineImage);
while (1) {
CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
if (type == CPDF_StreamParser::EndOfData) {
break;
}
if (type != CPDF_StreamParser::Keyword) {
continue;
}
if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' &&
m_pSyntax->GetWordBuf()[1] == 'I') {
break;
}
}
if (m_Options.m_bTextOnly) {
if (pStream) {
pStream->Release();
} else {
pDict->Release();
}
return;
}
pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, TRUE);
if (!pImgObj) {
if (pStream) {
pStream->Release();
} else {
pDict->Release();
}
}
}