1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// #![cfg(feature = "exr")]
//
// use std::io::Cursor;
//
// use exr::prelude::{f16, ReadChannels, ReadLayers};
// use zune_core::colorspace::ColorSpace;
//
// use crate::errors::ImageErrors;
// use crate::image::Image;
// use crate::traits::DecoderTrait;
//
// pub struct ExrDecoder<'a>
// {
// data: &'a [u8]
// }
//
// impl<'a> ExrDecoder<'a>
// {
// fn a(&self)
// {
// let reader = exr::prelude::read()
// .no_deep_data()
// .largest_resolution_level()
// .rgba_channels(
// // create our image based on the resolution of the file
// |resolution, (r, g, b, a)| {
// let mut output: Vec<f32> = vec![];
//
// output.resize(resolution.x() * resolution.y() * 4, 0.0);
// output
// },
// // insert a single pixel into out image
// |output, position, (r, g, b, a): (f32, f32, f32, f32)| {
// let first = (position.y() * position.width() + position.x()) * 4;
//
// output[first] = r;
// output[first + 1] = g;
// output[first + 2] = b;
// output[first + 3] = a;
// }
// )
// .first_valid_layer()
// .all_attributes()
// .from_buffered(Cursor::new(self.data))
// .unwrap();
// }
// }
//
// impl<'a> DecoderTrait<'a> for ExrDecoder<'a>
// {
// fn decode(&mut self) -> Result<Image, ImageErrors>
// {
// todo!()
// }
//
// fn get_dimensions(&self) -> Option<(usize, usize)>
// {
// todo!()
// }
//
// fn get_out_colorspace(&self) -> ColorSpace
// {
// todo!()
// }
//
// fn get_name(&self) -> &'static str
// {
// "exr"
// }
// }