Struct exr::image::pixel_vec::PixelVec [−][src]
Expand description
Store all samples in a single array.
All samples will be converted to the type T
.
This supports all the sample types, f16
, f32
, and u32
.
The flattened vector contains all rows one after another. In each row, for each pixel, its red, green, blue, and then alpha samples are stored one after another.
Use PixelVec.compute_pixel_index(position)
to compute the flat index of a specific pixel.
Fields
resolution: Vec2<usize>
The resolution of this layer.
pixels: Vec<T>
The flattened vector contains all rows one after another. In each row, for each pixel, its red, green, blue, and then alpha samples are stored one after another.
Use Flattened::compute_pixel_index(image, position)
to compute the flat index of a specific pixel.
Implementations
impl<Pixel> PixelVec<Pixel>
[src]
impl<Pixel> PixelVec<Pixel>
[src]pub fn constructor<Channels>(resolution: Vec2<usize>, _: &Channels) -> Self where
Pixel: Default + Clone,
[src]
pub fn constructor<Channels>(resolution: Vec2<usize>, _: &Channels) -> Self where
Pixel: Default + Clone,
[src]Create a new flattened pixel storage, filled with default pixels.
Accepts a Channels
parameter, which is not used, so that it can be passed as a function pointer instead of calling it.
pub fn get_pixel(&self, position: Vec2<usize>) -> &Pixel where
Pixel: Sync,
[src]
pub fn get_pixel(&self, position: Vec2<usize>) -> &Pixel where
Pixel: Sync,
[src]Examine a pixel of a PixelVec<T>
image.
Can usually be used as a function reference instead of calling it directly.
pub fn set_pixel(&mut self, position: Vec2<usize>, pixel: Pixel)
[src]
pub fn set_pixel(&mut self, position: Vec2<usize>, pixel: Pixel)
[src]Update a pixel of a PixelVec<T>
image.
Can usually be used as a function reference instead of calling it directly.
pub fn new(resolution: impl Into<Vec2<usize>>, pixels: Vec<Pixel>) -> Self
[src]
pub fn new(resolution: impl Into<Vec2<usize>>, pixels: Vec<Pixel>) -> Self
[src]Create a new flattened pixel storage, checking the length of the provided pixels vector.
pub fn compute_pixel_index(&self, position: Vec2<usize>) -> usize
[src]
pub fn compute_pixel_index(&self, position: Vec2<usize>) -> usize
[src]Compute the flat index of a specific pixel. Returns a range of either 3 or 4 samples.
The computed index can be used with PixelVec.samples[index]
.
Panics for invalid sample coordinates.
Trait Implementations
impl<Px> GetPixel for PixelVec<Px> where
Px: Clone + Sync,
[src]
impl<Px> GetPixel for PixelVec<Px> where
Px: Clone + Sync,
[src]impl<Px> ValidateResult for PixelVec<Px> where
Px: ValidateResult,
[src]
impl<Px> ValidateResult for PixelVec<Px> where
Px: ValidateResult,
[src]fn validate_result(
&self,
other: &Self,
options: ValidationOptions,
location: String
) -> ValidationResult
[src]
fn validate_result(
&self,
other: &Self,
options: ValidationOptions,
location: String
) -> ValidationResult
[src]Compare self with the other. Exceptional behaviour: Read more
fn assert_equals_result(&self, result: &Self)
[src]
fn assert_equals_result(&self, result: &Self)
[src]Compare self with the other. Panics if not equal. Read more
impl<T: Eq> Eq for PixelVec<T>
[src]
impl<T> StructuralEq for PixelVec<T>
[src]
impl<T> StructuralPartialEq for PixelVec<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for PixelVec<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PixelVec<T> where
T: Send,
T: Send,
impl<T> Sync for PixelVec<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PixelVec<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PixelVec<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more