[][src]Struct blend2d::image::Image

#[repr(transparent)]
pub struct Image { /* fields omitted */ }

A 2D raster image.

Methods

impl Image[src]

pub fn new(width: i32, height: i32, format: ImageFormat) -> Result<Image>[src]

Creates a new empty image with the specified dimensions and image format.

pub fn from_data<R: AsRef<[u8]>>(
    width: i32,
    height: i32,
    format: ImageFormat,
    data: &R,
    codecs: &Array<ImageCodec>
) -> Result<Image>
[src]

Attempts to create a new image with the specified dimensions and image format by decoding the data with the given codec.

pub fn from_path<P: AsRef<Path>>(
    path: P,
    codecs: &Array<ImageCodec>
) -> Result<Image>
[src]

pub fn format(&self) -> ImageFormat[src]

This image's format.

pub fn size(&self) -> SizeI[src]

This image's dimensions.

pub fn width(&self) -> i32[src]

This image's width.

pub fn height(&self) -> i32[src]

This image's height.

pub fn data(&self) -> ImageData[src]

Returns an ImageData instance containing most of this image's information.

pub fn scale(
    &mut self,
    size: SizeI,
    filter: ImageScaleFilter,
    options: Option<&ImageScaleOptions>
) -> Result<()>
[src]

pub fn write_to_file<P: AsRef<Path>>(
    &self,
    path: P,
    codec: &ImageCodec
) -> Result<()>
[src]

Writes the image to the file at the given path.

pub fn write_to_data(
    &self,
    dst: &mut Array<u8>,
    codec: &ImageCodec
) -> Result<()>
[src]

Writes the image to the given Array.

Trait Implementations

impl DeepClone for Image[src]

fn clone_deep(&self) -> Self[src]

Returns a deeply cloned copy of the value.

impl<'_> From<&'_ Image> for Pattern[src]

impl PartialEq<Image> for Image[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Clone for Image[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl AsMut<[u8]> for Image[src]

impl AsRef<[u8]> for Image[src]

impl Drop for Image[src]

impl DerefMut for Image[src]

impl Deref for Image[src]

type Target = [u8]

The resulting type after dereferencing.

impl Debug for Image[src]

Auto Trait Implementations

impl Unpin for Image

impl !Sync for Image

impl !Send for Image

impl RefUnwindSafe for Image

impl UnwindSafe for Image

Blanket Implementations

impl<T> ArrayType for T where
    T: WrappedBlCore, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]