MCPcopy Create free account
hub / github.com/RenderKit/embree / compareToReferenceImage

Method compareToReferenceImage

tutorials/common/tutorial/tutorial.cpp:646–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644 }
645
646 void TutorialApplication::compareToReferenceImage(const FileName& fileName)
647 {
648 resize(width,height);
649 ISPCCamera ispccamera = camera.getISPCCamera(width,height);
650 initRayStats();
651
652 for (unsigned int i=0; i<numFrames; i++)
653 render(pixels,width,height,render_time,ispccamera);
654
655 Ref<Image> image = new Image4uc(width, height, (Col4uc*)pixels);
656 Ref<Image> reference = loadImage(fileName);
657 const double error = compareImages(image,reference);
658 if (error > referenceImageThreshold) // error corresponds roughly to number of pixels that are completely off in color
659 throw std::runtime_error("reference image differs by " + std::to_string(error));
660 }
661
662 void TutorialApplication::set_parameter(size_t parm, ssize_t val) {
663 rtcSetDeviceProperty(nullptr,(RTCDeviceProperty)parm,val);

Callers

nothing calls this directly

Calls 6

renderFunction · 0.85
loadImageFunction · 0.85
compareImagesFunction · 0.85
getISPCCameraMethod · 0.80
to_stringFunction · 0.70
resizeFunction · 0.50

Tested by

no test coverage detected