[−][src]Struct blend2d::image::Image
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]
width: i32,
height: i32,
format: ImageFormat,
data: &R,
codecs: &Array<ImageCodec>
) -> Result<Image>
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]
path: P,
codecs: &Array<ImageCodec>
) -> Result<Image>
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]
&mut self,
size: SizeI,
filter: ImageScaleFilter,
options: Option<&ImageScaleOptions>
) -> Result<()>
pub fn write_to_file<P: AsRef<Path>>(
&self,
path: P,
codec: &ImageCodec
) -> Result<()>
[src]
&self,
path: P,
codec: &ImageCodec
) -> Result<()>
Writes the image to the file at the given path.
pub fn write_to_data(
&self,
dst: &mut Array<u8>,
codec: &ImageCodec
) -> Result<()>
[src]
&self,
dst: &mut Array<u8>,
codec: &ImageCodec
) -> Result<()>
Writes the image to the given Array
.
Trait Implementations
impl DeepClone for Image
[src]
const ASSIGN_DEEP: unsafe extern "C" fn(_: *mut Self::Core, _: *const Self::Core) -> BLResult
[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]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for Image
[src]
fn clone(&self) -> 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]
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]
T: WrappedBlCore,
const IMPL_IDX: usize
[src]
unsafe fn push(&mut BLArrayCore, T)
[src]
unsafe fn insert(&mut BLArrayCore, usize, T)
[src]
unsafe fn replace(&mut BLArrayCore, usize, T)
[src]
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,