Most of the compute side is mocked up and compiling.

This commit is contained in:
2019-08-28 00:35:36 -07:00
parent 9b8d5cd828
commit a3607ebc7d
6 changed files with 211 additions and 45 deletions

View File

@@ -38,7 +38,7 @@ pub struct ComputeImage {
impl ComputeImage {
fn load_raw(filename: String) -> (Vec<u8>, (u32,u32)) {
pub fn load_raw(filename: String) -> (Vec<u8>, (u32,u32)) {
let project_root =
std::env::current_dir()
@@ -141,6 +141,7 @@ impl ComputeImage {
let xy = self.get_size();
self.rw_buffers.get(0).unwrap().write().unwrap().map(|x| x);
let data_buffer_content = self.rw_buffers.get(0).unwrap().read().unwrap();
ImageBuffer::from_fn(xy.0, xy.1, |x, y| {
let r = data_buffer_content[((xy.0 * y + x) * 4 + 0) as usize] as u8;