| 82 | } |
| 83 | |
| 84 | void test_masks() { |
| 85 | require_vector_close( |
| 86 | engine::sampling::build_soft_mask({0, 0, 1, 1, 1, 0, 0}, 2), |
| 87 | {1.0F / 3.0F, 2.0F / 3.0F, 1.0F, 1.0F, 1.0F, 2.0F / 3.0F, 1.0F / 3.0F}, |
| 88 | 1.0e-6F, |
| 89 | "soft mask reference"); |
| 90 | require_vector_close(engine::sampling::build_soft_mask({0, 0, 0}, 2), {0.0F, 0.0F, 0.0F}, 0.0F, "soft mask all zero"); |
| 91 | require_vector_close(engine::sampling::build_soft_mask({1, 1, 1}, 2), {1.0F, 1.0F, 1.0F}, 0.0F, "soft mask all one"); |
| 92 | |
| 93 | require_vector_close( |
| 94 | engine::sampling::blend_by_mask( |
| 95 | {10.0F, 20.0F, 30.0F, 40.0F, 50.0F, 60.0F, 70.0F, 80.0F}, |
| 96 | {1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F, 8.0F}, |
| 97 | engine::sampling::build_soft_mask({0, 1, 1, 0}, 1), |
| 98 | 2), |
| 99 | {5.5F, 11.0F, 30.0F, 40.0F, 50.0F, 60.0F, 38.5F, 44.0F}, |
| 100 | 1.0e-6F, |
| 101 | "blend by mask reference"); |
| 102 | |
| 103 | require_vector_close( |
| 104 | engine::sampling::repaint_step_injection( |
| 105 | {10.0F, 20.0F, 30.0F, 40.0F, 50.0F, 60.0F}, |
| 106 | {1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F}, |
| 107 | {0, 1, 0}, |
| 108 | 0.25F, |
| 109 | {-1.0F, -2.0F, -3.0F, -4.0F, -5.0F, -6.0F}, |
| 110 | 2), |
| 111 | {0.5F, 1.0F, 30.0F, 40.0F, 2.5F, 3.0F}, |
| 112 | 0.0F, |
| 113 | "repaint injection reference"); |
| 114 | } |
| 115 | |
| 116 | } // namespace |
| 117 |
no test coverage detected