本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例8: TForm
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Caption = "远程桌面连接管理器";
Application->Title = Caption;
LoadHeader();
LoadDb();
Timer1->Enabled = true;
}
示例9: LoadHeader
void RSOView::LoadAll(u32 address)
{
LoadHeader(address);
LoadSections();
LoadImports();
LoadExports();
LoadInternals();
LoadExternals();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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));
}
示例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,"=?"));
}
示例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;
}