本文整理汇总了C++中ImageLoader::FlipVertically方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageLoader::FlipVertically方法的具体用法?C++ ImageLoader::FlipVertically怎么用?C++ ImageLoader::FlipVertically使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageLoader
的用法示例。
在下文中一共展示了ImageLoader::FlipVertically方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TextureProcessorMain
void* TextureProcessorMain(std::vector<std::string>* args)
{
auto start = std::chrono::high_resolution_clock::now();
std::string filename;
int numArgs = args->size();
if (numArgs > 0)
{
filename = (*args)[0];
}
else
{
cout << "ERROR : You must specify a filename.";
cin.get();
}
if (numArgs > 1)
{
for (int i = 1; i < numArgs; ++i)
{
std::string argument = (*args)[i];
if (argument.find("texformat") != string::npos)
{
if (numArgs >= i + 1)
texFormat = (TEXTURE_FORMAT)atoi((*args)[i + 1].c_str());
else cout << "Please provide a valid texture format.";
}
else if (argument.find("mipmaps") != string::npos)
{
generateMipmaps = true;
}
else if (argument.find("memory") != string::npos)
{
useMemory = true;
}
else if (argument.find("reverse") != string::npos)
{
reverseChannels = true;
}
else if (argument.find("flipvertical") != string::npos)
{
flipVertically = true;
}
}
}
string extension = filename.substr(filename.find(".") + 1);
ImageLoader* loader = NULL;
if (extension == "jpg" || extension == "jpeg")
{
loader = new JpegLoader();
}
else if (extension == "png")
{
loader = new PngLoader();
}
else if (extension == "bmp")
{
loader = new BmpLoader();
}
/*ilInit();
ilEnable(IL_FILE_OVERWRITE);
ilEnable(IL_ORIGIN_SET);
ilSetInteger(IL_ORIGIN_MODE, IL_ORIGIN_UPPER_LEFT); */
auto startLoad = std::chrono::high_resolution_clock::now();
loader->Load(filename, reverseChannels == true ? ImageLoader::PixelChannelOrder::ORDER_BGR : ImageLoader::PixelChannelOrder::ORDER_RGB);
if (flipVertically)
loader->FlipVertically();
auto endLoad = std::chrono::high_resolution_clock::now();
long long timeLoad = std::chrono::duration_cast<std::chrono::milliseconds>(endLoad - startLoad).count();
//TextureLoader loader = TextureLoader(filename.c_str());
//std::cout << "timeLoad : " << timeLoad << "\n";
//loader.SetTextureFormat(texFormat);
auto startMip = std::chrono::high_resolution_clock::now();
if(generateMipmaps)
loader->GenerateMipmaps();
auto endMip = std::chrono::high_resolution_clock::now();
//.........这里部分代码省略.........