本文整理汇总了C++中Memory::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ Memory::GetData方法的具体用法?C++ Memory::GetData怎么用?C++ Memory::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memory
的用法示例。
在下文中一共展示了Memory::GetData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
MemoryReader::MemoryReader( Memory &source )
:curPos( 0 )
{
this->curData = source.GetData();
this->curLength = source.GetLength();
this->curPos = 0;
}//constructor
示例2: LOGE
bool FileManagerWin32::GetFile( const std::string& fileName, Memory& fileContent, bool endZeroByte ) const {
std::string name = fileName;
FILE *file;
fileContent.Free();
fopen_s( &file, name.c_str(), "rb" );
if( !file ) {
LOGE( "File '%s' not found", name.c_str() );
return false;
}
fseek( file, 0, SEEK_END );
size_t fileSize = ftell( file );
if( fileSize ) {
fseek( file, 0, SEEK_SET );
fileContent.Alloc( fileSize + ( endZeroByte ? 1 : 0 ) );
fread( fileContent.GetData(), fileSize, 1, file );
fileContent[ fileContent.GetLength() - 1 ] = 0;
}
fclose( file );
return true;
}//GetFile
示例3: Py_BuildValue
}
Module::EncodeETC1( imageDataRGBA, width, height, imageDataETC1, quality );
return Py_BuildValue( "{s:y#,s:i,s:i,s:i}", "data", imageDataETC1.GetData(), imageDataETC1.GetLength(), "width", width, "height", height, "length", imageDataETC1.GetLength() );
}//picture2etc1
void Module::EncodeETC1( Memory &inBuffer, size_t width, size_t height, Memory &outBuffer, int quality ) {
size_t
resultBufferSize = ( width * height ) >> 1,
blocksPerRow = width >> 2,
blocksPerColumn = height >> 2;
Memory memBlock( 4 * 4 * 4 );
outBuffer.Alloc( resultBufferSize );
uint8_t
*srcData = memBlock.GetData(),
*destData = outBuffer.GetData();
rg_etc1::etc1_pack_params packParams;
packParams.m_dithering = false;
switch( quality ) {
case 0: packParams.m_quality = rg_etc1::cLowQuality; break;
case 1: packParams.m_quality = rg_etc1::cMediumQuality; break;
case 2: packParams.m_quality = rg_etc1::cHighQuality; break;
default: packParams.m_quality = rg_etc1::cLowQuality; break; LOGE( "Module::EncodeETC1 => quality[%d] is unavailable", quality ); break;
}
rg_etc1::pack_etc1_block_init();
for( size_t blockRow = 0; blockRow < blocksPerColumn; ++blockRow ) {
for( size_t blockColumn = 0; blockColumn < blocksPerRow; ++blockColumn ) {
for( size_t row = 0; row < 4; ++row ) {