本文整理汇总了C++中TBitmap::unloadBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ TBitmap::unloadBitmap方法的具体用法?C++ TBitmap::unloadBitmap怎么用?C++ TBitmap::unloadBitmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBitmap
的用法示例。
在下文中一共展示了TBitmap::unloadBitmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: denoiseNLMeans
template<typename I, typename O> int denoiseNLMeans(std::string inputfile, EBitmapType inputtype, std::string outputfile, EBitmapType outputtype, int r = 3, int f = 1, Float k = 0.7, Float sigma = 0.1, bool dump = true) {
NLMeansDenoiser<I, O> *denoiser = new NLMeansDenoiser<I, O>(sigma, dump);
TBitmap<I> *input = new TBitmap<I>();
if (!input->loadBitmap(inputfile, inputtype)){
std::cout << "Input bitmap " << inputfile << " failed to load!\n";
std::cin.get();
return 0;
}
DenoiserInput<I> *dInput = new DenoiserInput<I>(outputfile);
dInput->addImageBlock(new TImageBlock<I>(Point2i(0., 0.), input->getSize(), 1, false, input));
DenoiserOutput<O> *dOutput = denoiser->denoise(dInput);
LOG(EInfo, "Denoising finished. Time taken = %d seconds", dOutput->getDenoiseDuration());
dumpMap(dOutput->getDenoisedImage()->getBitmap(), outputfile, outputtype);
input->unloadBitmap();
std::cin.get();
_CrtDumpMemoryLeaks(); // prints mem leaks
return 0;
}
示例2: denoiseModifiedNLMeans
template<typename I, typename O> int denoiseModifiedNLMeans(std::string inputfile, EBitmapType inputtype, std::string outputfile, EBitmapType outputtype, int r = 3, int f = 1, Float k = 0.7, Float sigma = 0.1, bool dump = true) {
ModifiedNLMeansDenoiser<I, O> *denoiser = new ModifiedNLMeansDenoiser<I, O>(r, f, k, sigma, dump);
TBitmap<I> *inputA = new TBitmap<I>;
//BitmapI *inputsppA = new BitmapI;
TBitmap<I> *inputsppA = new TBitmap<I>;
TBitmap<I> *inputvarA = new TBitmap<I>;
TBitmap<I> *inputvarsA = new TBitmap<I>;
TBitmap<I> *inputB = new TBitmap<I>;
//BitmapI *inputsppB = new BitmapI;
TBitmap<I> *inputsppB = new TBitmap<I>;
TBitmap<I> *inputvarB = new TBitmap<I>;
TBitmap<I> *inputvarsB = new TBitmap<I>;
Assert(inputA->loadBitmap(inputfile + "_A", inputtype), "Input bitmap A failed to load!");
Assert(inputsppA->loadBitmap(inputfile + "_spp_A", inputtype), "Input spp bitmap A failed to load!");
Assert(inputvarA->loadBitmap(inputfile + "_variance_A", inputtype), "Input variance bitmap A failed to load!");
Assert(inputvarsA->loadBitmap(inputfile + "_variance_square_A", inputtype), "Input variance square bitmap A failed to load!");
Assert(inputB->loadBitmap(inputfile + "_B", inputtype), "Input bitmap B failed to load!");
Assert(inputsppB->loadBitmap(inputfile + "_spp_B", inputtype), "Input spp bitmap B failed to load!");
Assert(inputvarsB->loadBitmap(inputfile + "_variance_square_B", inputtype), "Input variance square bitmap B failed to load!");
Assert(inputvarB->loadBitmap(inputfile + "_variance_B", inputtype), "Input variance bitmap B failed to load!");
DenoiserInput<I> *dInput = new DenoiserInput<I>(outputfile);
dInput->addImageBlock(new TImageBlock<I>(Point2i(0., 0.), inputA->getSize(), 1, false, inputA, inputsppA, inputvarA, inputvarsA));
dInput->addImageBlock(new TImageBlock<I>(Point2i(0., 0.), inputB->getSize(), 1, false, inputB, inputsppB, inputvarB, inputvarsB));
DenoiserOutput<O> *dOutput = denoiser->denoise(dInput);
LOG(EInfo, "Denoising finished. Time taken = %d seconds", dOutput->getDenoiseDuration());
dumpMap(dOutput->getDenoisedImage()->getBitmap(), outputfile, outputtype);
inputA->unloadBitmap();
inputsppA->unloadBitmap();
inputvarA->unloadBitmap();
inputvarsA->unloadBitmap();
inputB->unloadBitmap();
inputsppB->unloadBitmap();
inputvarB->unloadBitmap();
inputvarsB->unloadBitmap();
std::cin.get();
_CrtDumpMemoryLeaks(); // prints mem leaks
return 0;
}