Implement post-transform coefficients
CI / cargo fmt (push) Successful in 1m25s
CI / cargo test (push) Successful in 14m59s
CI / cargo test (GPU) (push) Successful in 16m50s

This commit is contained in:
2026-07-12 10:05:19 -04:00
parent 4005e14ab0
commit 08ada94bd2
4 changed files with 73 additions and 18 deletions
+15 -15
View File
@@ -17,21 +17,21 @@ const IMAGE_DIMENSION: UVec2 = uvec2(600, 600);
pub fn main() -> Result<()> {
let transforms = [
// F_0: (x / 2, y / 2)
Transform::new(
Affine2::from_coefficients(0.5, 0.0, 0.0, 0.0, 0.5, 0.0),
uvec2(0, 1),
),
// F_1: ((x + 1) / 2, y / 2)
Transform::new(
Affine2::from_coefficients(0.5, 0.0, 0.5, 0.0, 0.5, 0.0),
uvec2(0, 1),
),
// F_2: (x / 2, (y + 1) / 2)
Transform::new(
Affine2::from_coefficients(0.5, 0.0, 0.0, 0.0, 0.5, 0.5),
uvec2(0, 1),
),
{
// F_0: (x / 2, y / 2)
let coefficients = Affine2::from_coefficients(0.5, 0.0, 0.0, 0.0, 0.5, 0.0);
Transform::new(coefficients, Affine2::IDENTITY, uvec2(0, 1))
},
{
// F_1: ((x + 1) / 2, y / 2)
let coefficients = Affine2::from_coefficients(0.5, 0.0, 0.5, 0.0, 0.5, 0.0);
Transform::new(coefficients, Affine2::IDENTITY, uvec2(0, 1))
},
{
// F_2: (x / 2, (y + 1) / 2)
let coefficients = Affine2::from_coefficients(0.5, 0.0, 0.0, 0.0, 0.5, 0.5);
Transform::new(coefficients, Affine2::IDENTITY, uvec2(0, 1))
},
];
let weights = [1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0];