30bool nearlyEqual(
float a,
float b,
float epsilon = 1.0e-6f)
32 return std::fabs(a - b) <= epsilon;
46 error =
"Bloom strength clamp failed";
61 if (!nearlyEqual(noBloom.
r, scene.
r) ||
62 !nearlyEqual(noBloom.
g, scene.
g) ||
63 !nearlyEqual(noBloom.
b, scene.
b)) {
64 error =
"Zero-strength bloom must reproduce the scene exactly";
69 if (!nearlyEqual(combined.
r, 0.35f) ||
70 !nearlyEqual(combined.
g, 0.60f) ||
71 !nearlyEqual(combined.
b, 0.85f)) {
72 std::ostringstream stream;
73 stream <<
"Bloom combination failed: "
74 << combined.
r <<
", " << combined.
g <<
", " << combined.
b;
85 if (!(hdr.
r > 1.0f)) {
86 error =
"Bloom composition must preserve HDR values above 1.0";
static float clampStrength(float strength)
Performs clamp strength.
static QuantumBloomSample combine(const QuantumBloomSample &scene, const QuantumBloomSample &blurredHighlights, float strength)
Performs combine.
bool runQuantumBloomTests(std::string &error)
Runs quantum bloom tests.
Declares the quantumbloom visualization component used by QPE.
Declares regression and invariant tests for quantumbloom tests.
Data record containing Quantum Bloom Sample.