pub struct Pixbuf(/* private fields */);
Implementations§
Source§impl Pixbuf
impl Pixbuf
pub fn new( colorspace: Colorspace, has_alpha: bool, bits_per_sample: i32, width: i32, height: i32, ) -> Option<Pixbuf>
pub fn new_from_inline(data: &[u8], copy_pixels: bool) -> Result<Pixbuf, Error>
pub fn new_from_resource(resource_path: &str) -> Result<Pixbuf, Error>
pub fn new_from_resource_at_scale( resource_path: &str, width: i32, height: i32, preserve_aspect_ratio: bool, ) -> Result<Pixbuf, Error>
pub fn new_from_stream<P: IsA<InputStream>, Q: IsA<Cancellable>>( stream: &P, cancellable: Option<&Q>, ) -> Result<Pixbuf, Error>
pub fn new_from_stream_at_scale<P: IsA<InputStream>, Q: IsA<Cancellable>>( stream: &P, width: i32, height: i32, preserve_aspect_ratio: bool, cancellable: Option<&Q>, ) -> Result<Pixbuf, Error>
pub fn new_from_xpm_data(data: &[&str]) -> Pixbuf
pub fn add_alpha( &self, substitute_color: bool, r: u8, g: u8, b: u8, ) -> Option<Pixbuf>
pub fn apply_embedded_orientation(&self) -> Option<Pixbuf>
pub fn composite( &self, dest: &Pixbuf, dest_x: i32, dest_y: i32, dest_width: i32, dest_height: i32, offset_x: f64, offset_y: f64, scale_x: f64, scale_y: f64, interp_type: InterpType, overall_alpha: i32, )
pub fn composite_color( &self, dest: &Pixbuf, dest_x: i32, dest_y: i32, dest_width: i32, dest_height: i32, offset_x: f64, offset_y: f64, scale_x: f64, scale_y: f64, interp_type: InterpType, overall_alpha: i32, check_x: i32, check_y: i32, check_size: i32, color1: u32, color2: u32, )
pub fn composite_color_simple( &self, dest_width: i32, dest_height: i32, interp_type: InterpType, overall_alpha: i32, check_size: i32, color1: u32, color2: u32, ) -> Option<Pixbuf>
pub fn copy(&self) -> Option<Pixbuf>
pub fn copy_area( &self, src_x: i32, src_y: i32, width: i32, height: i32, dest_pixbuf: &Pixbuf, dest_x: i32, dest_y: i32, )
pub fn fill(&self, pixel: u32)
pub fn flip(&self, horizontal: bool) -> Option<Pixbuf>
pub fn get_bits_per_sample(&self) -> i32
pub fn get_byte_length(&self) -> usize
pub fn get_colorspace(&self) -> Colorspace
pub fn get_has_alpha(&self) -> bool
pub fn get_height(&self) -> i32
pub fn get_n_channels(&self) -> i32
pub fn get_option(&self, key: &str) -> Option<GString>
pub fn get_rowstride(&self) -> i32
pub fn get_width(&self) -> i32
pub fn new_subpixbuf( &self, src_x: i32, src_y: i32, width: i32, height: i32, ) -> Option<Pixbuf>
pub fn rotate_simple(&self, angle: PixbufRotation) -> Option<Pixbuf>
pub fn saturate_and_pixelate( &self, dest: &Pixbuf, saturation: f32, pixelate: bool, )
pub fn scale( &self, dest: &Pixbuf, dest_x: i32, dest_y: i32, dest_width: i32, dest_height: i32, offset_x: f64, offset_y: f64, scale_x: f64, scale_y: f64, interp_type: InterpType, )
pub fn scale_simple( &self, dest_width: i32, dest_height: i32, interp_type: InterpType, ) -> Option<Pixbuf>
pub fn set_option(&self, key: &str, value: &str) -> bool
pub fn get_property_pixel_bytes(&self) -> Option<Bytes>
pub fn get_formats() -> Vec<PixbufFormat>
Source§impl Pixbuf
impl Pixbuf
pub fn new_from_mut_slice<T: AsMut<[u8]>>( data: T, colorspace: Colorspace, has_alpha: bool, bits_per_sample: i32, width: i32, height: i32, row_stride: i32, ) -> Pixbuf
pub fn new_from_file<T: AsRef<Path>>(filename: T) -> Result<Pixbuf, Error>
pub fn new_from_file_at_size<T: AsRef<Path>>( filename: T, width: i32, height: i32, ) -> Result<Pixbuf, Error>
pub fn new_from_file_at_scale<T: AsRef<Path>>( filename: T, width: i32, height: i32, preserve_aspect_ratio: bool, ) -> Result<Pixbuf, Error>
pub fn new_from_stream_async<'a, P: IsA<InputStream>, Q: IsA<Cancellable>, R: FnOnce(Result<Pixbuf, Error>) + Send + 'static>( stream: &P, cancellable: Option<&Q>, callback: R, )
pub fn new_from_stream_at_scale_async<'a, P: IsA<InputStream>, Q: IsA<Cancellable>, R: FnOnce(Result<Pixbuf, Error>) + Send + 'static>( stream: &P, width: i32, height: i32, preserve_aspect_ratio: bool, cancellable: Option<&Q>, callback: R, )
pub unsafe fn get_pixels(&self) -> &mut [u8] ⓘ
pub fn put_pixel(&self, x: i32, y: i32, red: u8, green: u8, blue: u8, alpha: u8)
pub fn get_file_info<T: AsRef<Path>>( filename: T, ) -> Option<(PixbufFormat, i32, i32)>
pub fn save_to_bufferv( &self, type_: &str, options: &[(&str, &str)], ) -> Result<Vec<u8>, Error>
pub fn savev<T: AsRef<Path>>( &self, filename: T, type_: &str, options: &[(&str, &str)], ) -> Result<(), Error>
Trait Implementations§
Source§impl Ord for Pixbuf
impl Ord for Pixbuf
Source§impl<T: ObjectType> PartialEq<T> for Pixbuf
impl<T: ObjectType> PartialEq<T> for Pixbuf
Source§impl<T: ObjectType> PartialOrd<T> for Pixbuf
impl<T: ObjectType> PartialOrd<T> for Pixbuf
Source§impl StaticType for Pixbuf
impl StaticType for Pixbuf
Source§fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self
.impl Eq for Pixbuf
impl IsA<Icon> for Pixbuf
impl IsA<LoadableIcon> for Pixbuf
Auto Trait Implementations§
impl Freeze for Pixbuf
impl RefUnwindSafe for Pixbuf
impl !Send for Pixbuf
impl !Sync for Pixbuf
impl Unpin for Pixbuf
impl UnwindSafe for Pixbuf
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
Mutably borrows from an owned value. Read more
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
Upcasts an object to a superclass or interface
T
. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
Upcasts an object to a reference of its superclass or interface
T
. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: CanDowncast<T>,
Tries to downcast to a subclass or interface implementor
T
. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: CanDowncast<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: CanDowncast<T>,
Tries to downcast to a reference of its subclass or interface implementor
T
. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
Tries to cast to an object of type
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Tries to cast to reference to an object of type
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
Casts to
T
unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
Casts to
&T
unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<O> LoadableIconExt for Owhere
O: IsA<LoadableIcon>,
impl<O> LoadableIconExt for Owhere
O: IsA<LoadableIcon>,
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
Returns
true
if the object is an instance of (can be cast to) T
.