pub unsafe trait ImageExt {
Show 20 methods
// Required methods
fn copy(&self) -> Self
where Self: Sized;
fn copy_sized(&self, w: i32, h: i32) -> Self
where Self: Sized;
fn draw(&mut self, x: i32, y: i32, width: i32, height: i32);
fn draw_ext(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
cx: i32,
cy: i32,
);
fn w(&self) -> i32;
fn h(&self) -> i32;
fn as_image_ptr(&self) -> *mut Fl_Image;
unsafe fn from_image_ptr(ptr: *mut Fl_Image) -> Self
where Self: Sized;
fn as_rgb_data(&self) -> Vec<u8> ⓘ;
fn as_rgb_image(&self) -> Result<RgbImage, FltkError>;
fn scale(
&mut self,
width: i32,
height: i32,
proportional: bool,
can_expand: bool,
);
fn count(&self) -> i32;
fn data_w(&self) -> i32;
fn data_h(&self) -> i32;
fn depth(&self) -> ColorDepth;
fn ld(&self) -> i32;
fn inactive(&mut self);
unsafe fn delete(img: Self)
where Self: Sized;
fn was_deleted(&self) -> bool;
unsafe fn into_image<I: ImageExt>(self) -> I
where Self: Sized;
}
Expand description
Required Methods§
Sourcefn copy_sized(&self, w: i32, h: i32) -> Selfwhere
Self: Sized,
fn copy_sized(&self, w: i32, h: i32) -> Selfwhere
Self: Sized,
Performs a deep copy of the image but to a new size. This will make use of the scaling algorithm when resizing.
Sourcefn draw(&mut self, x: i32, y: i32, width: i32, height: i32)
fn draw(&mut self, x: i32, y: i32, width: i32, height: i32)
Draws the image at the presupplied coordinates and size
Sourcefn draw_ext(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
cx: i32,
cy: i32,
)
fn draw_ext( &mut self, x: i32, y: i32, width: i32, height: i32, cx: i32, cy: i32, )
Draws the image at the presupplied coordinates and size and offset cx, cy
Sourcefn as_image_ptr(&self) -> *mut Fl_Image
fn as_image_ptr(&self) -> *mut Fl_Image
Returns a pointer of the image
Sourceunsafe fn from_image_ptr(ptr: *mut Fl_Image) -> Selfwhere
Self: Sized,
unsafe fn from_image_ptr(ptr: *mut Fl_Image) -> Selfwhere
Self: Sized,
Sourcefn as_rgb_data(&self) -> Vec<u8> ⓘ
fn as_rgb_data(&self) -> Vec<u8> ⓘ
Returns the underlying raw rgb image data
Sourcefn as_rgb_image(&self) -> Result<RgbImage, FltkError>
fn as_rgb_image(&self) -> Result<RgbImage, FltkError>
Sourcefn scale(
&mut self,
width: i32,
height: i32,
proportional: bool,
can_expand: bool,
)
fn scale( &mut self, width: i32, height: i32, proportional: bool, can_expand: bool, )
Scales the image
Sourcefn count(&self) -> i32
fn count(&self) -> i32
Return the count of pointers in an image (Pixmaps have more than 1, bitmaps have 0, Rgb based images have 1)
Sourcefn depth(&self) -> ColorDepth
fn depth(&self) -> ColorDepth
Gets the image’s depth
Sourcefn was_deleted(&self) -> bool
fn was_deleted(&self) -> bool
Checks if the image was deleted
Sourceunsafe fn into_image<I: ImageExt>(self) -> Iwhere
Self: Sized,
unsafe fn into_image<I: ImageExt>(self) -> Iwhere
Self: Sized,
Transforms an Image base into another Image
§Safety
Can be unsafe if used to downcast to an image of different format