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


C++ LoadHeader函数代码示例

本文整理汇总了C++中LoadHeader函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadHeader函数的具体用法?C++ LoadHeader怎么用?C++ LoadHeader使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Decode

Image* TGAImageDecoder::Decode(DataStream* ds) {
    TGAHeader header;
    if (!LoadHeader(&header, ds)) return 0;
    ImageFormat fmt = IMAGE_FORMAT_UNKNOWN;
    if (header.bitsperpixel==32)
        fmt = IMAGE_FORMAT_RGBA;
    else if(header.bitsperpixel==24)
        fmt = IMAGE_FORMAT_RGB;
    else if (header.bitsperpixel==8)
        fmt = IMAGE_FORMAT_GRAY;

    bool rle = (header.datatypecode & 8)!=0;
    UInt32 width = header.width;
    UInt32 height = header.height;
    ImageImpl* img = new ImageImpl(width,height,fmt);
    bool res = rle ? LoadRLE(ds,img) : LoadRAW(ds,img);
    if (!res) {
        delete img;
        img = 0;
    } else {
        img->SwapChannelsRB();
        if ( (header.imagedescriptor & 0x20 ) == 0) {
            img->FlipV();
        }
    }
    return img;
}
开发者ID:dtozik,项目名称:GHL,代码行数:27,代码来源:tga_image_decoder.cpp

示例2: BmpIO_Load

// イメージ読み込み指示
IBMP* BmpIO_Load( File::IResourceFile *infile )
{
	unsigned int ctsize;	// カラーテーブルのエントリ数
	int blen;		// 1ピクセルあたりビット長
	IBMP *pBmp;
	int w, h;
	BOOL r;

	// ファイルヘッダの入力、カラーテーブル長、
	// pixelsの領域長、ピクセルあたりのビット長を取得
	if ( !LoadHeader( infile, &ctsize, &blen, &w, &h ) ) return FALSE;

	// メモリ領域を確保
	pBmp = BmpIO_CreateBitmap( w, h, blen );
	if ( NULL == pBmp ) return NULL;

	// ピクセルあたりビット長別にファイルボディ部を読み込む
	if ( 24 != blen )
		r = LoadBody1( infile, blen, pBmp );
	else
		r = LoadBody24( infile, pBmp );

	if ( !r ) {
		// 失敗
		BmpIO_DeleteBitmap( pBmp );
		return NULL;
	}

	return pBmp;
}
开发者ID:omochi64,项目名称:Hashireisen2D,代码行数:31,代码来源:BmpIoLib.cpp

示例3: luaU_undump

/*
** load precompiled chunk
*/
Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
{
 LoadState S;
 Closure* cl;
 if (*name=='@' || *name=='=')
  S.name=name+1;
 else if (*name==LUA_SIGNATURE[0])
  S.name="binary string";
 else
  S.name=name;
 S.L=L;
 S.Z=Z;
 S.b=buff;
 LoadHeader(&S);
 cl=luaF_newLclosure(L,1);
 setclLvalue(L,L->top,cl); incr_top(L);
 cl->l.p=luaF_newproto(L);
 LoadFunction(&S,cl->l.p);
 if (cl->l.p->sizeupvalues != 1)
 {
  Proto* p=cl->l.p;
  cl=luaF_newLclosure(L,cl->l.p->sizeupvalues);
  cl->l.p=p;
  setclLvalue(L,L->top-1,cl);
 }
 luai_verifycode(L,buff,cl->l.p);
 return cl;
}
开发者ID:RBACS,项目名称:KnightOnline-Projectv1886,代码行数:31,代码来源:lundump.c

示例4: LoadHeader

//----------------------------------------------------------------------------------------------------------------------
bool HoudiniGeo::Load(
                      const std::string& _fName
                     )
{
  // Open the stream and parse
  std::ifstream fileIn;
  fileIn.open(_fName.c_str());
  if (!fileIn.is_open())
  {
    std::cout <<"File : "<<_fName<<" Not founds "<<std::endl;
    return false;
  }
// first we check the header to see if we have a valid file
// if only OBJ's did this!!

  LoadHeader(fileIn);
  // check to see if we need to load any attribs
  if(m_nPointAttrib !=0)
  {
    LoadPointAttribDictionary(fileIn);
  }
  LoadPoints(fileIn);
  // set the center and BBox
  this->CalcDimensions();

  fileIn.close();
  return true;
}
开发者ID:suncorner,项目名称:NGL,代码行数:29,代码来源:HoudiniGeo.cpp

示例5: ASSERT

STDMETHODIMP CImpIPersistStream::Load(LPSTREAM pIStream)
{                      
	ASSERT(pIStream);

ebFILEHEADER Head; 
	memset(&Head, 0, sizeof(Head));                          	
HRESULT hr = LoadHeader (pIStream, &Head) ;
	if (FAILED (hr)) return hr;

	if(m_hCode) CoTaskMemFree(m_hCode); 
	m_hCode = NULL;

	if (Head.dwCodeSz > 0 && Head.dwScriptSz > 0) 
		hr = LoadCode_FromDB (pIStream, Head); 
	else if (Head.dwScriptSz > 0)
		hr = LoadScript_FromDB (pIStream, Head);
	else 
		ASSERT(0);

	if (FAILED(hr)) return hr;					

	m_fIsDirty = false;
	
return hr;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:25,代码来源:STRMIMP.CPP

示例6: LoadHeader

BYTE MMXCore::CheckROM()
{
	LoadHeader();
	if (*(LPDWORD)(header->title+0) == 0x4147454D)
		if (*(LPDWORD)(header->title+4) == 0x204E414D)
		{
			switch(*(LPWORD)(header->title+8))
			{
			case 0x2058:
				type = 0;
				break;
			case 0x3258:
				type = 1;
				break;
			case 0x3358:
				type = 2;
				break;
			default:
				type = 0xFF;
				return 0;
			}
			return type+1;
		}
	type = 0xFF;
	return 0;
}
开发者ID:Xeeynamo,项目名称:MegaEdX,代码行数:26,代码来源:MMXCore.cpp

示例7: LoadHeader

//=================================================================================================
// Load metadata only from mesh (points)
void Mesh::LoadMetadata(StreamReader& stream)
{
	if(vb)
		return;
	LoadHeader(stream);
	stream.SetOffset(head.points_offset);
	LoadPoints(stream);
}
开发者ID:lcs2,项目名称:carpg,代码行数:10,代码来源:Mesh.cpp

示例8: TForm

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    Caption = "远程桌面连接管理器";
    Application->Title = Caption;
    LoadHeader();
    LoadDb();
    Timer1->Enabled = true;
}
开发者ID:zjhupo,项目名称:mstscManage,代码行数:10,代码来源:mstscManFrm.cpp

示例9: LoadHeader

void RSOView::LoadAll(u32 address)
{
  LoadHeader(address);
  LoadSections();
  LoadImports();
  LoadExports();
  LoadInternals();
  LoadExternals();
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:9,代码来源:RSO.cpp

示例10: VerifyHeader

void CWorkGrammar::VerifyHeader(TInputStream* input)
{
    if (!LoadHeader(input)) {
        Stroka msg = "Failed to load tomita grammar: the binary is incompatible with your program. "
                     "You should either re-compiler your .bin, or rebuild your program from corresponding version of sources.\n";
        Cerr << msg << Endl;
        ythrow yexception() << msg;
    }
}
开发者ID:dubrousky,项目名称:tomita-parser,代码行数:9,代码来源:loader.cpp

示例11: Load

bool PSFLoader::Load(bool show)
{
	if(!psf_f.IsOpened()) return false;

	m_show_log = show;

	if(!LoadHeader()) return false;
	if(!LoadKeyTable()) return false;
	if(!LoadDataTable()) return false;

	return true;
}
开发者ID:Apicio,项目名称:rpcs3,代码行数:12,代码来源:PSF.cpp

示例12: GetFileInfo

 bool TGAImageDecoder::GetFileInfo(DataStream* ds, ImageInfo* info) {
     TGAHeader header;
     if (!LoadHeader(&header, ds)) return false;
     if (header.bitsperpixel==32)
         info->image_format = IMAGE_FORMAT_RGBA;
     else if(header.bitsperpixel==24)
         info->image_format = IMAGE_FORMAT_RGB;
     else if (header.bitsperpixel==8)
         info->image_format = IMAGE_FORMAT_GRAY;
     else
         return false;
     info->width = header.width;
     info->height = header.height;
     return true;
 }
开发者ID:andryblack,项目名称:GHL,代码行数:15,代码来源:tga_image_decoder.cpp

示例13: killaU_undump

/*
** load precompiled chunk
*/
killa_Proto* killaU_undump (killa_State* L, killa_ZIO* Z, killa_Mbuffer* buff, const char* name)
{
 LoadState S;
 if (*name=='@' || *name=='=')
  S.name=name+1;
 else if (*name == KILLA_SIGNATURE[0])
  S.name="binary string";
 else
  S.name=name;
 S.L=L;
 S.Z=Z;
 S.b=buff;
 LoadHeader(&S);
 return killai_verifycode(L,buff,LoadFunction(&S));
}
开发者ID:caivega,项目名称:Killa,代码行数:18,代码来源:kundump.c

示例14: luaU_undump

/*
** load precompiled chunk
*/
Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
{
 LoadState S;
 if (*name=='@' || *name=='=')
  S.name=name+1;
 else if (*name==LUA_SIGNATURE[0])
  S.name="binary string";
 else
  S.name=name;
 S.L=L;
 S.Z=Z;
 S.b=buff;
 LoadHeader(&S);
 return LoadFunction(&S,luaS_newliteral(L,"=?"));
}
开发者ID:alucard-dracula,项目名称:yggdrasil,代码行数:18,代码来源:lundump.c

示例15: LoadHeader

int SWF::LoadSWF(const char* path)
{
	m_pFile = new SWF_FILE;
	m_pFile->LoadSWF(path);
	
	if(!m_pFile->IsLoaded())
		return -1;
	
	LoadHeader(m_pFile);

	while(!m_bIsEnd)
		LoadTag(m_pFile);
	
	return 0;
}
开发者ID:kelathor,项目名称:openswf,代码行数:15,代码来源:opeswf.cpp


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