pub struct CoreImageComp {}Expand description
One image component: geometry, sample format, and the raw sample data.
Fields§
§dx: u32Horizontal subsampling factor.
dy: u32Vertical subsampling factor.
w: u32Component width in samples.
h: u32Component height in samples.
x0: u32Component origin x.
y0: u32Component origin y.
prec: u32Sample precision in bits (1..=31 supported).
bpp: u32Bits per sample as declared (JP2 bpc; may differ from prec).
sgnd: u321 for signed samples.
resno_decoded: u32Resolution actually decoded (0-based decomposition index).
factor: u32Resolution reduction factor applied by the decode.
alpha: u161 when this component is the alpha channel.
data: Vec<i32>The sample values, row-major, w * h entries (i32 for 0.7; see
doc/component-data-types.md).
Implementations§
Source§impl CoreImageComp
impl CoreImageComp
Sourcepub fn data(&self) -> Option<&[i32]>
pub fn data(&self) -> Option<&[i32]>
Data accessor kept for compatibility with the C-ABI image API.
Sourcepub fn data_mut(&mut self) -> Option<&mut [i32]>
pub fn data_mut(&mut self) -> Option<&mut [i32]>
Mutable data accessor (C-ABI image API compatibility).
Sourcepub fn alloc_data(&mut self) -> bool
pub fn alloc_data(&mut self) -> bool
Allocate (zeroed) data for w * h samples.
Sourcepub fn clear_data(&mut self)
pub fn clear_data(&mut self)
Clears the sample data (keeping the geometry).
Sourcepub fn set_dims(&mut self, w: u32, h: u32)
pub fn set_dims(&mut self, w: u32, h: u32)
Updates the component dimensions, clearing the data when they change.
Sourcepub fn set_data(&mut self, data: &[i32]) -> bool
pub fn set_data(&mut self, data: &[i32]) -> bool
Replaces the sample data (returns true for C-ABI parity).
Sourcepub fn copy_props(&mut self, other: &CoreImageComp)
pub fn copy_props(&mut self, other: &CoreImageComp)
Copy component properties (not data).
Sourcepub fn copy(&mut self, other: &CoreImageComp) -> bool
pub fn copy(&mut self, other: &CoreImageComp) -> bool
Copy properties and data from another core component.
Source§impl CoreImageComp
impl CoreImageComp
Trait Implementations§
Source§impl Clone for CoreImageComp
impl Clone for CoreImageComp
Source§fn clone(&self) -> CoreImageComp
fn clone(&self) -> CoreImageComp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for CoreImageComp
impl Default for CoreImageComp
Source§fn default() -> CoreImageComp
fn default() -> CoreImageComp
Auto Trait Implementations§
impl Forget for CoreImageComp
impl Freeze for CoreImageComp
impl Move for CoreImageComp
impl RefUnwindSafe for CoreImageComp
impl Send for CoreImageComp
impl Sync for CoreImageComp
impl Unpin for CoreImageComp
impl UnsafeUnpin for CoreImageComp
impl UnwindSafe for CoreImageComp
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