Struct gdk_pixbuf::Pixbuf
source · [−]pub struct Pixbuf(_, _);Implementations
sourceimpl 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>
sourceimpl 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]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[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
sourceimpl Ord for Pixbuf
impl Ord for Pixbuf
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: ObjectType> PartialOrd<T> for Pixbuf
impl<T: ObjectType> PartialOrd<T> for Pixbuf
sourcefn partial_cmp(&self, other: &T) -> Option<Ordering>
fn partial_cmp(&self, other: &T) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresourceimpl StaticType for Pixbuf
impl StaticType for Pixbuf
sourcefn 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 RefUnwindSafe for Pixbuf
impl !Send for Pixbuf
impl !Sync for Pixbuf
impl Unpin for Pixbuf
impl UnwindSafe for Pixbuf
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
sourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn 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 moresourceunsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
Casts to
T unconditionally. Read moresourceunsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
Casts to
&T unconditionally. Read moresourceimpl<O> LoadableIconExt for Owhere
O: IsA<LoadableIcon>,
impl<O> LoadableIconExt for Owhere
O: IsA<LoadableIcon>,
fn load<P>(
&self,
size: i32,
cancellable: Option<&P>
) -> Result<(InputStream, GString), Error>where
P: IsA<Cancellable>,
fn load_async<P, Q>(&self, size: i32, cancellable: Option<&P>, callback: Q)where
P: IsA<Cancellable>,
Q: 'static + FnOnce(Result<(InputStream, GString), Error>) + Send,
sourceimpl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
sourcefn 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.