pub struct CoreImage {
pub x0: u32,
pub y0: u32,
pub x1: u32,
pub y1: u32,
pub numcomps: u32,
pub color_space: ColorSpace,
pub comps: Vec<CoreImageComp>,
pub icc_profile_buf: Vec<u8>,
pub icc_profile_is_cielab: bool,
}Expand description
A decoded (or to-be-encoded) image: geometry, colour space, components and the ICC profile.
Fields§
§x0: u32Image origin x.
y0: u32Image origin y.
x1: u32Image end x.
y1: u32Image end y.
numcomps: u32Number of components.
color_space: ColorSpaceDeclared colour space.
comps: Vec<CoreImageComp>The components.
icc_profile_buf: Vec<u8>Raw ICC profile bytes (JP2 colr box).
icc_profile_is_cielab: boolA non-empty profile buffer with this flag means the profile is CIELab (mirrors the C ABI convention of icc_profile_len == 0).
Implementations§
Source§impl CoreImage
impl CoreImage
Sourcepub fn tile_create(
cmptparms: &[CoreImageComp],
clrspc: ColorSpace,
) -> Option<CoreImage>
pub fn tile_create( cmptparms: &[CoreImageComp], clrspc: ColorSpace, ) -> Option<CoreImage>
Header-only image from component parameters (no data).
Sourcepub fn comps(&self) -> Option<&[CoreImageComp]>
pub fn comps(&self) -> Option<&[CoreImageComp]>
Compatibility accessors over the owned Vecs.
Sourcepub fn comps_mut(&mut self) -> Option<&mut [CoreImageComp]>
pub fn comps_mut(&mut self) -> Option<&mut [CoreImageComp]>
Mutable component slice (C-ABI image API compatibility).
Sourcepub fn comps_data_iter(&self) -> Option<impl Iterator<Item = ImageCompRef<'_>>>
pub fn comps_data_iter(&self) -> Option<impl Iterator<Item = ImageCompRef<'_>>>
Iterates the components with their signed->unsigned adjustments.
Sourcepub fn take_comps(&mut self) -> CoreImage
pub fn take_comps(&mut self) -> CoreImage
Moves the components into a fresh image, emptying this one.
Sourcepub fn set_rgb(
&mut self,
w: usize,
h: usize,
r: &[i32],
g: &[i32],
b: &[i32],
) -> bool
pub fn set_rgb( &mut self, w: usize, h: usize, r: &[i32], g: &[i32], b: &[i32], ) -> bool
Sets three same-sized components from separate RGB planes.
Sourcepub fn comps_data_mut_iter(
&mut self,
) -> Option<impl Iterator<Item = &mut [i32]>>
pub fn comps_data_mut_iter( &mut self, ) -> Option<impl Iterator<Item = &mut [i32]>>
Iterates the components’ sample data mutably.
Sourcepub fn take_icc_profile(&mut self) -> Option<ICCProfile>
pub fn take_icc_profile(&mut self) -> Option<ICCProfile>
Moves the ICC profile out of the image (either kind).
Sourcepub fn clear_icc_profile(&mut self)
pub fn clear_icc_profile(&mut self)
Removes the ICC profile.
Sourcepub fn alloc_comps(&mut self, numcomps: u32) -> bool
pub fn alloc_comps(&mut self, numcomps: u32) -> bool
Reallocates the component list to numcomps default components.
Sourcepub fn comp0_dims_prec(&self) -> (usize, usize, i32)
pub fn comp0_dims_prec(&self) -> (usize, usize, i32)
Component 0’s width, height and precision.
Sourcepub fn comps_same_dims(&self) -> bool
pub fn comps_same_dims(&self) -> bool
Check if all components have the same dimensions.
Sourcepub fn comps_match(&self) -> bool
pub fn comps_match(&self) -> bool
Check if all components have the same dimensions and precision.
Trait Implementations§
Auto Trait Implementations§
impl Forget for CoreImage
impl Freeze for CoreImage
impl Move for CoreImage
impl RefUnwindSafe for CoreImage
impl Send for CoreImage
impl Sync for CoreImage
impl Unpin for CoreImage
impl UnsafeUnpin for CoreImage
impl UnwindSafe for CoreImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more