Skip to main content

CoreImage

Struct CoreImage 

Source
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: u32

Image origin x.

§y0: u32

Image origin y.

§x1: u32

Image end x.

§y1: u32

Image end y.

§numcomps: u32

Number of components.

§color_space: ColorSpace

Declared colour space.

§comps: Vec<CoreImageComp>

The components.

§icc_profile_buf: Vec<u8>

Raw ICC profile bytes (JP2 colr box).

§icc_profile_is_cielab: bool

A 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

Source

pub fn new() -> CoreImage

Creates an empty image.

Source

pub fn tile_create( cmptparms: &[CoreImageComp], clrspc: ColorSpace, ) -> Option<CoreImage>

Header-only image from component parameters (no data).

Source

pub fn comps(&self) -> Option<&[CoreImageComp]>

Compatibility accessors over the owned Vecs.

Source

pub fn comps_mut(&mut self) -> Option<&mut [CoreImageComp]>

Mutable component slice (C-ABI image API compatibility).

Source

pub fn comps_data_iter(&self) -> Option<impl Iterator<Item = ImageCompRef<'_>>>

Iterates the components with their signed->unsigned adjustments.

Source

pub fn take_comps(&mut self) -> CoreImage

Moves the components into a fresh image, emptying this one.

Source

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.

Source

pub fn comps_data_mut_iter( &mut self, ) -> Option<impl Iterator<Item = &mut [i32]>>

Iterates the components’ sample data mutably.

Source

pub fn take_icc_profile(&mut self) -> Option<ICCProfile>

Moves the ICC profile out of the image (either kind).

Source

pub fn clear_icc_profile(&mut self)

Removes the ICC profile.

Source

pub fn alloc_comps(&mut self, numcomps: u32) -> bool

Reallocates the component list to numcomps default components.

Source

pub fn comp0_dims_prec(&self) -> (usize, usize, i32)

Component 0’s width, height and precision.

Source

pub fn comps_same_dims(&self) -> bool

Check if all components have the same dimensions.

Source

pub fn comps_match(&self) -> bool

Check if all components have the same dimensions and precision.

Trait Implementations§

Source§

impl Clone for CoreImage

Source§

fn clone(&self) -> CoreImage

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 CoreImage

Source§

fn default() -> CoreImage

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.