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


C++ Memory::GetData方法代码示例

本文整理汇总了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
开发者ID:KoMaTo3,项目名称:py.texture.compress,代码行数:7,代码来源:memoryreader.cpp

示例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
开发者ID:KoMaTo3,项目名称:py.texture.compress,代码行数:21,代码来源:filemanager.cpp

示例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 ) {
开发者ID:KoMaTo3,项目名称:py.texture.compress,代码行数:31,代码来源:module.cpp


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