Skip to main content

CoreImageComp

Struct CoreImageComp 

Source
pub struct CoreImageComp {
Show 13 fields pub dx: u32, pub dy: u32, pub w: u32, pub h: u32, pub x0: u32, pub y0: u32, pub prec: u32, pub bpp: u32, pub sgnd: u32, pub resno_decoded: u32, pub factor: u32, pub alpha: u16, pub data: Vec<i32>,
}
Expand description

One image component: geometry, sample format, and the raw sample data.

Fields§

§dx: u32

Horizontal subsampling factor.

§dy: u32

Vertical subsampling factor.

§w: u32

Component width in samples.

§h: u32

Component height in samples.

§x0: u32

Component origin x.

§y0: u32

Component origin y.

§prec: u32

Sample precision in bits (1..=31 supported).

§bpp: u32

Bits per sample as declared (JP2 bpc; may differ from prec).

§sgnd: u32

1 for signed samples.

§resno_decoded: u32

Resolution actually decoded (0-based decomposition index).

§factor: u32

Resolution reduction factor applied by the decode.

§alpha: u16

1 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

Source

pub fn data(&self) -> Option<&[i32]>

Data accessor kept for compatibility with the C-ABI image API.

Source

pub fn data_mut(&mut self) -> Option<&mut [i32]>

Mutable data accessor (C-ABI image API compatibility).

Source

pub fn alloc_data(&mut self) -> bool

Allocate (zeroed) data for w * h samples.

Source

pub fn clear_data(&mut self)

Clears the sample data (keeping the geometry).

Source

pub fn set_dims(&mut self, w: u32, h: u32)

Updates the component dimensions, clearing the data when they change.

Source

pub fn set_data(&mut self, data: &[i32]) -> bool

Replaces the sample data (returns true for C-ABI parity).

Source

pub fn copy_props(&mut self, other: &CoreImageComp)

Copy component properties (not data).

Source

pub fn copy(&mut self, other: &CoreImageComp) -> bool

Copy properties and data from another core component.

Source

pub fn clip(&mut self, precision: u32)

Clip component samples to precision bits.

Source

pub fn scale(&mut self, precision: u32)

Scale component samples to precision bits.

Source§

impl CoreImageComp

Source

pub fn width(&self) -> u32

Component width in samples.

Source

pub fn height(&self) -> u32

Component height in samples.

Source

pub fn precision(&self) -> u32

Sample precision in bits.

Source

pub fn bpp(&self) -> u32

Bits per sample as declared.

Source

pub fn is_alpha(&self) -> bool

Whether this component is the alpha channel.

Source

pub fn is_signed(&self) -> bool

Whether the sample data is signed.

Trait Implementations§

Source§

impl Clone for CoreImageComp

Source§

fn clone(&self) -> CoreImageComp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for CoreImageComp

Source§

fn default() -> CoreImageComp

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.