use crate::core::geometry::{Bounds2i, Point2i}; use crate::core::pbrt::Float; use crate::spectra::colorspace::RGBColorSpace; use crate::utils::math::SquareMatrix; use smallvec::SmallVec; use std::collections::HashMap; use std::ops::{Deref, DerefMut}; #[derive(Debug, Clone, Default)] pub struct ImageChannelDesc { pub offset: Vec, } impl ImageChannelDesc { pub fn new(offset: &[usize]) -> Self { Self { offset: offset.into(), } } pub fn size(&self) -> usize { self.offset.len() } pub fn is_empty(&self) -> bool { self.offset.is_empty() } pub fn is_identity(&self) -> bool { for i in 0..self.size() { if self.offset[i] != i { return false; } } true } } #[derive(Debug, Default)] pub struct ImageMetadata { pub render_time_seconds: Option, pub camera_from_world: Option>, pub ndc_from_world: Option>, pub pixel_bounds: Option, pub full_resolution: Option, pub samples_per_pixel: Option, pub mse: Option, pub colorspace: Option, pub strings: HashMap, pub string_vectors: HashMap>, }