本文整理汇总了C++中icloser函数的典型用法代码示例。如果您正苦于以下问题:C++ icloser函数的具体用法?C++ icloser怎么用?C++ icloser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了icloser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ilLoadPltPal
//! Loads an .plt palette file.
ILboolean ilLoadPltPal(ILconst_string FileName)
{
ILHANDLE PltFile;
if (!iCheckExtension(FileName, IL_TEXT("plt"))) {
ilSetError(IL_INVALID_EXTENSION);
return IL_FALSE;
}
if (iCurImage == NULL) {
ilSetError(IL_ILLEGAL_OPERATION);
return IL_FALSE;
}
PltFile = iopenr(FileName);
if (PltFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return IL_FALSE;
}
if (iCurImage->Pal.Palette && iCurImage->Pal.PalSize > 0 && iCurImage->Pal.PalType != IL_PAL_NONE) {
ifree(iCurImage->Pal.Palette);
iCurImage->Pal.Palette = NULL;
}
iCurImage->Pal.PalSize = GetLittleUInt();
if (iCurImage->Pal.PalSize == 0) {
ilSetError(IL_INVALID_FILE_HEADER);
return IL_FALSE;
}
iCurImage->Pal.PalType = IL_PAL_RGB24;
iCurImage->Pal.Palette = (ILubyte*)ialloc(iCurImage->Pal.PalSize);
if (!iCurImage->Pal.Palette) {
icloser(PltFile);
return IL_FALSE;
}
if (iread(iCurImage->Pal.Palette, iCurImage->Pal.PalSize, 1) != 1) {
ifree(iCurImage->Pal.Palette);
iCurImage->Pal.Palette = NULL;
icloser(PltFile);
return IL_FALSE;
}
icloser(PltFile);
return IL_TRUE;
}
示例2: ilIsValid_JPEG
//! Checks if the file specified in FileName is a valid .jpg file.
ILboolean ilIsValid_JPEG(ILconst_string FileName)
{
ILHANDLE JpegFile;
ILboolean bJpeg = IL_FALSE;
if (!iCheckExtension(FileName, IL_TEXT("jpg")) &&
!iCheckExtension(FileName, IL_TEXT("jpe")) &&
!iCheckExtension(FileName, IL_TEXT("jpeg")) &&
!iCheckExtension(FileName, IL_TEXT("jif")) &&
!iCheckExtension(FileName, IL_TEXT("jfif")))
{
ilSetError(IL_INVALID_EXTENSION);
return bJpeg;
}
JpegFile = iopenr(FileName);
if (JpegFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bJpeg;
}
bJpeg = ilIsValidF_JPEG(JpegFile);
icloser(JpegFile);
return bJpeg;
}
示例3: ilLoadJpeg
ILboolean ilLoadJpeg(ILconst_string FileName)
{
ILHANDLE JpegFile;
ILboolean bJpeg = IL_FALSE;
JpegFile = iopenr(FileName);
if (JpegFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bJpeg;
}
bJpeg = ilLoadJpegF(JpegFile);
icloser(JpegFile);
return bJpeg;
}
示例4: ilLoadActPal
//! Loads an .act palette file.
ILboolean ilLoadActPal(ILconst_string FileName)
{
ILHANDLE ActFile;
if (!iCheckExtension(FileName, IL_TEXT("act"))) {
ilSetError(IL_INVALID_EXTENSION);
return IL_FALSE;
}
if (iCurImage == NULL) {
ilSetError(IL_ILLEGAL_OPERATION);
return IL_FALSE;
}
ActFile = iopenr(FileName);
if (ActFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return IL_FALSE;
}
if (iCurImage->Pal.Palette && iCurImage->Pal.PalSize > 0 && iCurImage->Pal.PalType != IL_PAL_NONE) {
ifree(iCurImage->Pal.Palette);
iCurImage->Pal.Palette = NULL;
}
iCurImage->Pal.PalType = IL_PAL_RGB24;
iCurImage->Pal.PalSize = 768;
iCurImage->Pal.Palette = (ILubyte*)ialloc(768);
if (!iCurImage->Pal.Palette) {
icloser(ActFile);
return IL_FALSE;
}
if (iread(iCurImage->Pal.Palette, 1, 768) != 768) {
icloser(ActFile);
return IL_FALSE;
}
icloser(ActFile);
return IL_TRUE;
}
示例5: ilLoadIff
//! Reads an IFF file
ILboolean ilLoadIff(const ILstring FileName)
{
ILHANDLE iffFile;
ILboolean ret = IL_FALSE;
iffFile = iopenr(FileName);
if (iffFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return ret;
}
ret = ilLoadIffF(iffFile);
icloser(iffFile);
return ret;
}
示例6: ilLoadBlp
//! Reads a BLP file
ILboolean ilLoadBlp(ILconst_string FileName)
{
ILHANDLE BlpFile;
ILboolean bBlp = IL_FALSE;
BlpFile = iopenr(FileName);
if (BlpFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bBlp;
}
bBlp = ilLoadBlpF(BlpFile);
icloser(BlpFile);
return bBlp;
}
示例7: ilLoadIcns
//! Reads an icon file.
ILboolean ilLoadIcns(ILconst_string FileName)
{
ILHANDLE IcnsFile;
ILboolean bIcns = IL_FALSE;
IcnsFile = iopenr(FileName);
if (IcnsFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bIcns;
}
bIcns = ilLoadIcnsF(IcnsFile);
icloser(IcnsFile);
return bIcns;
}
示例8: ilLoadWdp
//! Reads a WDP file
ILboolean ilLoadWdp(ILconst_string FileName)
{
ILHANDLE WdpFile;
ILboolean bWdp = IL_FALSE;
WdpFile = iopenr(FileName);
if (WdpFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bWdp;
}
bWdp = ilLoadWdpF(WdpFile);
icloser(WdpFile);
return bWdp;
}
示例9: ilLoad_ROT
//! Reads a ROT file
ILboolean ilLoad_ROT(ILconst_string FileName)
{
ILHANDLE RotFile;
ILboolean bRot = IL_FALSE;
RotFile = iopenr(FileName);
if (RotFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bRot;
}
bRot = ilLoadF_ROT(RotFile);
icloser(RotFile);
return bRot;
}
示例10: ilLoadSgi
/*! Reads a SGI file */
ILboolean ilLoadSgi(ILconst_string FileName)
{
ILHANDLE SgiFile;
ILboolean bSgi = IL_FALSE;
SgiFile = iopenr(FileName);
if (SgiFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bSgi;
}
bSgi = ilLoadSgiF(SgiFile);
icloser(SgiFile);
return bSgi;
}
示例11: ilLoadPsp
//! Reads a PSP file
ILboolean ilLoadPsp(ILconst_string FileName)
{
ILHANDLE PSPFile;
ILboolean bPsp = IL_FALSE;
PSPFile = iopenr(FileName);
if (PSPFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bPsp;
}
bPsp = ilLoadPspF(PSPFile);
icloser(PSPFile);
return bPsp;
}
示例12: ilLoad_TIFF
//! Reads a Tiff file
ILboolean ilLoad_TIFF(ILconst_string FileName)
{
ILHANDLE TiffFile;
ILboolean bTiff = IL_FALSE;
TiffFile = iopenr(FileName);
if (TiffFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
}
else {
bTiff = ilLoadF_TIFF(TiffFile);
icloser(TiffFile);
}
return bTiff;
}
示例13: ilLoadLif
//! Reads a .Lif file
ILboolean ilLoadLif(ILconst_string FileName)
{
ILHANDLE LifFile;
ILboolean bLif = IL_FALSE;
LifFile = iopenr(FileName);
if (LifFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bLif;
}
bLif = ilLoadLifF(LifFile);
icloser(LifFile);
return bLif;
}
示例14: ilLoadKtx
//! Reads a .ktx file
ILboolean ilLoadKtx(ILconst_string FileName)
{
ILHANDLE KtxFile;
ILboolean bKtx = IL_FALSE;
KtxFile = iopenr(FileName);
if (KtxFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bKtx;
}
bKtx = ilLoadKtxF(KtxFile);
icloser(KtxFile);
return bKtx;
}
示例15: ilLoadCut
//! Reads a .cut file
ILboolean ilLoadCut(ILconst_string FileName)
{
ILHANDLE CutFile;
ILboolean bCut = IL_FALSE;
CutFile = iopenr(FileName);
if (CutFile == NULL) {
ilSetError(IL_COULD_NOT_OPEN_FILE);
return bCut;
}
bCut = ilLoadCutF(CutFile);
icloser(CutFile);
return bCut;
}