本文整理汇总了C++中ImageDecoder::frameBufferAtIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageDecoder::frameBufferAtIndex方法的具体用法?C++ ImageDecoder::frameBufferAtIndex怎么用?C++ ImageDecoder::frameBufferAtIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageDecoder
的用法示例。
在下文中一共展示了ImageDecoder::frameBufferAtIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFrameStatus
TEST_F(ImageFrameGeneratorTest, incompleteBitmapCopied)
{
setFrameStatus(ImageFrame::FramePartial);
const ScaledImageFragment* tempImage= m_generator->decodeAndScale(fullSize());
EXPECT_FALSE(tempImage->isComplete());
EXPECT_EQ(1, m_frameBufferRequestCount);
ImageDecoder* tempDecoder = 0;
EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), fullSize(), &tempDecoder));
ASSERT_TRUE(tempDecoder);
EXPECT_NE(tempDecoder->frameBufferAtIndex(0)->getSkBitmap().getPixels(), tempImage->bitmap().getPixels());
ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder);
}
示例2: setFrameStatus
TEST_F(ImageFrameGeneratorTest, frameHasAlpha)
{
setFrameStatus(ImageFrame::FramePartial);
char buffer[100 * 100 * 4];
m_generator->decodeAndScale(0, imageInfo(), buffer, 100 * 4);
EXPECT_TRUE(m_generator->hasAlpha(0));
EXPECT_EQ(1, m_decodeRequestCount);
ImageDecoder* tempDecoder = 0;
EXPECT_TRUE(ImageDecodingStore::instance().lockDecoder(m_generator.get(), fullSize(), &tempDecoder));
ASSERT_TRUE(tempDecoder);
tempDecoder->frameBufferAtIndex(0)->setHasAlpha(false);
ImageDecodingStore::instance().unlockDecoder(m_generator.get(), tempDecoder);
EXPECT_EQ(2, m_decodeRequestCount);
setFrameStatus(ImageFrame::FrameComplete);
m_generator->decodeAndScale(0, imageInfo(), buffer, 100 * 4);
EXPECT_EQ(3, m_decodeRequestCount);
EXPECT_FALSE(m_generator->hasAlpha(0));
}