diff options
author | metamuffin <metamuffin@disroot.org> | 2022-12-30 19:25:28 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-12-30 19:25:28 +0100 |
commit | 23d6c2d3b56145999c14596733853bc6de49eff3 (patch) | |
tree | 5357c90cb2acd8ea44b6af1aa07a546af9a7639f /evc/src/helpers/vector.rs | |
parent | cb2597ef6c3c11c11ba50021a5502efef1cf127a (diff) | |
download | video-codec-experiments-23d6c2d3b56145999c14596733853bc6de49eff3.tar video-codec-experiments-23d6c2d3b56145999c14596733853bc6de49eff3.tar.bz2 video-codec-experiments-23d6c2d3b56145999c14596733853bc6de49eff3.tar.zst |
fixed: linear transform, value scale and command line ars
Diffstat (limited to 'evc/src/helpers/vector.rs')
-rw-r--r-- | evc/src/helpers/vector.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/evc/src/helpers/vector.rs b/evc/src/helpers/vector.rs index 0209c58..a4766d1 100644 --- a/evc/src/helpers/vector.rs +++ b/evc/src/helpers/vector.rs @@ -20,6 +20,14 @@ impl From<Vec2<u16>> for Vec2<isize> { } } } +impl From<Vec2<f32>> for Vec2<isize> { + fn from(value: Vec2<f32>) -> Self { + Self { + x: value.x as isize, + y: value.y as isize, + } + } +} impl Vec2<isize> { pub const ZERO: Vec2<isize> = Vec2 { x: 0, y: 0 }; @@ -58,7 +66,7 @@ impl Vec2<isize> { Self { x: self.x, y: 0 } } pub fn y_only(&self) -> Self { - Self { x: self.x, y: 0 } + Self { x: 0, y: self.y } } } |