本文整理汇总了C++中Bounds2i::Area方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds2i::Area方法的具体用法?C++ Bounds2i::Area怎么用?C++ Bounds2i::Area使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds2i
的用法示例。
在下文中一共展示了Bounds2i::Area方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BDPTIntegrator
BDPTIntegrator *CreateBDPTIntegrator(const ParamSet ¶ms,
std::shared_ptr<Sampler> sampler,
std::shared_ptr<const Camera> camera) {
int maxDepth = params.FindOneInt("maxdepth", 5);
bool visualizeStrategies = params.FindOneBool("visualizestrategies", false);
bool visualizeWeights = params.FindOneBool("visualizeweights", false);
if ((visualizeStrategies || visualizeWeights) && maxDepth > 5) {
Warning(
"visualizestrategies/visualizeweights was enabled, limiting "
"maxdepth to 5");
maxDepth = 5;
}
int np;
const int *pb = params.FindInt("pixelbounds", &np);
Bounds2i pixelBounds = camera->film->GetSampleBounds();
if (pb) {
if (np != 4)
Error("Expected four values for \"pixelbounds\" parameter. Got %d.",
np);
else {
pixelBounds = Intersect(pixelBounds,
Bounds2i{{pb[0], pb[2]}, {pb[1], pb[3]}});
if (pixelBounds.Area() == 0)
Error("Degenerate \"pixelbounds\" specified.");
}
}
std::string lightStrategy = params.FindOneString("lightsamplestrategy",
"power");
return new BDPTIntegrator(sampler, camera, maxDepth, visualizeStrategies,
visualizeWeights, pixelBounds, lightStrategy);
}
示例2: VolPathIntegrator
VolPathIntegrator *CreateVolPathIntegrator(
const ParamSet ¶ms, std::shared_ptr<Sampler> sampler,
std::shared_ptr<const Camera> camera) {
int maxDepth = params.FindOneInt("maxdepth", 5);
int np;
const int *pb = params.FindInt("pixelbounds", &np);
Bounds2i pixelBounds = camera->film->croppedPixelBounds;
if (pb) {
if (np != 4)
Error("Expected four values for \"pixelbounds\" parameter. Got %d.",
np);
else {
pixelBounds = Intersect(pixelBounds,
Bounds2i{{pb[0], pb[2]}, {pb[1], pb[3]}});
if (pixelBounds.Area() == 0)
Error("Degenerate \"pixelbounds\" specified.");
}
}
return new VolPathIntegrator(maxDepth, camera, sampler, pixelBounds);
}
示例3: VolPathIntegrator
VolPathIntegrator *CreateVolPathIntegrator(
const ParamSet ¶ms, std::shared_ptr<Sampler> sampler,
std::shared_ptr<const Camera> camera) {
int maxDepth = params.FindOneInt("maxdepth", 5);
int np;
const int *pb = params.FindInt("pixelbounds", &np);
Bounds2i pixelBounds = camera->film->GetSampleBounds();
if (pb) {
if (np != 4)
Error("Expected four values for \"pixelbounds\" parameter. Got %d.",
np);
else {
pixelBounds = Intersect(pixelBounds,
Bounds2i{{pb[0], pb[2]}, {pb[1], pb[3]}});
if (pixelBounds.Area() == 0)
Error("Degenerate \"pixelbounds\" specified.");
}
}
Float rrThreshold = params.FindOneFloat("rrthreshold", 1.);
std::string lightStrategy =
params.FindOneString("lightsamplestrategy", "spatial");
return new VolPathIntegrator(maxDepth, camera, sampler, pixelBounds,
rrThreshold, lightStrategy);
}