本文整理汇总了C++中Timing::Format方法的典型用法代码示例。如果您正苦于以下问题:C++ Timing::Format方法的具体用法?C++ Timing::Format怎么用?C++ Timing::Format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timing
的用法示例。
在下文中一共展示了Timing::Format方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EmberRender
bool EmberRender(EmberOptions& opt)
{
#ifdef USECL EmberCLns::OpenCLInfo& info(EmberCLns::OpenCLInfo::Instance());#endif
std::cout.imbue(std::locale(""));
if (opt.DumpArgs())
cout << opt.GetValues(OPT_USE_RENDER) << endl;
if (opt.OpenCLInfo())
{
cout << "\nOpenCL Info: " << endl;
cout << info.DumpInfo();
return true;
}
Timing t;
bool writeSuccess = false;
byte* finalImagep;
uint padding;
size_t i, channels;
size_t strips;
size_t iterCount;
string filename;
string inputPath = GetPath(opt.Input());
ostringstream os;
pair<size_t, size_t> p;
vector<Ember<T>> embers;
vector<byte> finalImage;
EmberStats stats;
EmberReport emberReport;
EmberImageComments comments;
XmlToEmber<T> parser;
EmberToXml<T> emberToXml;
vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>> randVec;
const vector<pair<size_t, size_t>> devices = Devices(opt.Devices());
unique_ptr<RenderProgress<T>> progress(new RenderProgress<T>());
unique_ptr<Renderer<T, float>> renderer(CreateRenderer<T>(opt.EmberCL() ? OPENCL_RENDERER : CPU_RENDERER, devices, false, 0, emberReport));
vector<string> errorReport = emberReport.ErrorReport();
if (!errorReport.empty())
emberReport.DumpErrorReport();
if (!renderer.get())
{
cout << "Renderer creation failed, exiting." << endl;
return false;
}
if (opt.EmberCL() && renderer->RendererType() != OPENCL_RENDERER)//OpenCL init failed, so fall back to CPU.
opt.EmberCL(false);
if (!InitPaletteList<T>(opt.PalettePath()))
return false;
if (!ParseEmberFile(parser, opt.Input(), embers))
return false;
if (!opt.EmberCL())
{
if (opt.ThreadCount() == 0)
{
cout << "Using " << Timing::ProcessorCount() << " automatically detected threads." << endl;
opt.ThreadCount(Timing::ProcessorCount());
}
else
{
cout << "Using " << opt.ThreadCount() << " manually specified threads." << endl;
}
renderer->ThreadCount(opt.ThreadCount(), opt.IsaacSeed() != "" ? opt.IsaacSeed().c_str() : nullptr);
}
else
{
cout << "Using OpenCL to render." << endl;
if (opt.Verbose())
{
for (auto& device : devices)
{
cout << "Platform: " << info.PlatformName(device.first) << endl;
cout << "Device: " << info.DeviceName(device.first, device.second) << endl;
}
}
if (opt.ThreadCount() > 1)
cout << "Cannot specify threads with OpenCL, using 1 thread." << endl;
opt.ThreadCount(1);
renderer->ThreadCount(opt.ThreadCount(), opt.IsaacSeed() != "" ? opt.IsaacSeed().c_str() : nullptr);
if (opt.BitsPerChannel() != 8)
{
cout << "Bits per channel cannot be anything other than 8 with OpenCL, setting to 8." << endl;
opt.BitsPerChannel(8);
}
}
if (opt.Format() != "jpg" &&
opt.Format() != "png" &&
opt.Format() != "ppm" &&
//.........这里部分代码省略.........