diff options
author | metamuffin <metamuffin@disroot.org> | 2022-12-06 19:30:03 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-12-06 19:30:03 +0100 |
commit | 70514416c2ade2abe628efbd0a629a66febdeb13 (patch) | |
tree | 03b54f677046afe5a2e1b04768c1cb9104771462 /evc/src/frame.rs | |
parent | c4e995d29209e0e0a1aafd9652971b8980fafb15 (diff) | |
download | video-codec-experiments-70514416c2ade2abe628efbd0a629a66febdeb13.tar video-codec-experiments-70514416c2ade2abe628efbd0a629a66febdeb13.tar.bz2 video-codec-experiments-70514416c2ade2abe628efbd0a629a66febdeb13.tar.zst |
minor stuff, store translation as i8
Diffstat (limited to 'evc/src/frame.rs')
-rw-r--r-- | evc/src/frame.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/evc/src/frame.rs b/evc/src/frame.rs index 81390a2..3c40a3d 100644 --- a/evc/src/frame.rs +++ b/evc/src/frame.rs @@ -49,6 +49,11 @@ impl Frame { pub fn view_area_mut<'a>(&'a mut self, offset: Vec2, size: Vec2) -> View<&'a mut Frame> { View::new(self, offset, size) } + pub fn set(&mut self, pos: Vec2, color: Pixel) { + if pos.x >= 0 && pos.y >= 0 && pos.x < self.size.x && pos.y < self.size.y { + self[pos] = color + } + } } impl Index<Vec2> for Frame { |