feat: Pass affine transform coefficients
This commit is contained in:
parent
a05df7276c
commit
0c092a4d82
@ -1,8 +1,32 @@
|
|||||||
|
#[derive(Copy, Clone, Default, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
|
#[repr(C)]
|
||||||
|
pub struct Coefs {
|
||||||
|
a: f32,
|
||||||
|
b: f32,
|
||||||
|
c: f32,
|
||||||
|
d: f32,
|
||||||
|
e: f32,
|
||||||
|
f: f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Coefs {
|
||||||
|
pub fn identity() -> Self {
|
||||||
|
Coefs {
|
||||||
|
a: 1.,
|
||||||
|
b: 0.,
|
||||||
|
c: 0.,
|
||||||
|
d: 0.,
|
||||||
|
e: 1.,
|
||||||
|
f: 0.,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Default, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
#[derive(Copy, Clone, Default, Debug, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct TransformSpec {
|
pub struct TransformSpec {
|
||||||
// pub coefs: glam::Affine2,
|
pub coefs: Coefs,
|
||||||
// pub post_coefs: glam::Affine2,
|
pub post_coefs: Coefs,
|
||||||
pub variation_offset: u32,
|
pub variation_offset: u32,
|
||||||
pub variation_count: u32,
|
pub variation_count: u32,
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ extern crate core;
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod tests {
|
pub mod tests {
|
||||||
use flare_kernel::{TransformSpec, VariationKind, VariationParams, VariationSpec};
|
use flare_kernel::{Coefs, TransformSpec, VariationKind, VariationParams, VariationSpec};
|
||||||
use futures::channel::oneshot;
|
use futures::channel::oneshot;
|
||||||
use futures_executor::block_on;
|
use futures_executor::block_on;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
@ -239,8 +239,8 @@ pub mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
pub fn apply_linear_transform() {
|
pub fn apply_linear_transform() {
|
||||||
let transform = TransformSpec {
|
let transform = TransformSpec {
|
||||||
// coefs: glam::Affine2::IDENTITY,
|
coefs: Coefs::identity(),
|
||||||
// post_coefs: glam::Affine2::IDENTITY,
|
post_coefs: Coefs::identity(),
|
||||||
variation_offset: 0,
|
variation_offset: 0,
|
||||||
variation_count: 1,
|
variation_count: 1,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user