MCPcopy Create free account
hub / github.com/RenderKit/oidn / makeRandomImage

Function makeRandomImage

apps/oidnTest.cpp:548–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548std::shared_ptr<ImageBuffer> makeRandomImage(DeviceRef& device, int W, int H, int C = 3,
549 DataType dataType = DataType::Float32,
550 float minValue = 0.f, float maxValue = 1.f)
551{
552 Random rng;
553 auto image = std::make_shared<ImageBuffer>(device, W, H, C, dataType);
554 for (size_t i = 0; i < image->getSize(); ++i)
555 image->set(i, minValue + rng.getFloat() * (maxValue - minValue));
556 return image;
557}
558
559bool isBetween(const std::shared_ptr<ImageBuffer>& image, float a, float b)
560{

Callers 1

oidnTest.cppFile · 0.85

Calls 3

getSizeMethod · 0.80
getFloatMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected