cleanup Buf struct
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Buf {
|
||||
pub width: usize,
|
||||
pub height: usize,
|
||||
width: usize,
|
||||
height: usize,
|
||||
pub buf: Vec<f32>,
|
||||
}
|
||||
|
||||
impl Buf {
|
||||
pub const fn new(width: usize, height: usize, buf: Vec<f32>) -> Self {
|
||||
Buf { width, height, buf }
|
||||
pub fn new(width: usize, height: usize) -> Self {
|
||||
Buf {
|
||||
width,
|
||||
height,
|
||||
buf: vec![0.0; height * width],
|
||||
}
|
||||
}
|
||||
|
||||
// Truncate x and y and return a corresponding index into the data slice.
|
||||
|
||||
Reference in New Issue
Block a user