コード例 #1
0
ファイル: JXImage.cpp プロジェクト: mta1309/mulberry-lib-jx
JError
JXImage::CreateFromFile
	(
	JXDisplay*			display,
	JXColormap*			colormap,
	const JCharacter*	fileName,
	JXImage**			image,
	const JBoolean		allowApproxColors
	)
{
	const FileType type = GetFileType(fileName);
	if (type == kGIFType)
		{
		return CreateFromGIF(display, colormap, fileName, image, allowApproxColors);
		}
	else if (type == kPNGType)
		{
		return CreateFromPNG(display, colormap, fileName, image, allowApproxColors);
		}
	else if (type == kJPEGType)
		{
		return CreateFromJPEG(display, colormap, fileName, image, allowApproxColors);
		}
	else if (type == kXPMType)
		{
		return CreateFromXPM(display, colormap, fileName, image, allowApproxColors);
		}
	else
		{
		*image = NULL;
		return UnknownFileType(fileName);
		}
}
コード例 #2
0
Vector<Image *> ImageLoader::CreateFromFile(File *file)
{
    if(IsPNGFile(file))
    {
        return CreateFromPNG(file);
    }
    
	if(IsDXTFile(file))
    {
        return CreateFromDXT(file);
    }

    if(IsPVRFile(file))
    {
        return CreateFromPVR(file);
    }
    
	return Vector<Image *>();
}