[][src]Trait fltk::prelude::ImageExt

pub unsafe trait ImageExt {
    fn copy(&self) -> Self;
fn draw(&mut self, x: i32, y: i32, width: i32, height: i32);
fn width(&self) -> i32;
fn height(&self) -> i32;
unsafe fn as_ptr(&self) -> *mut c_void;
unsafe fn as_image_ptr(&self) -> *mut Fl_Image;
unsafe fn from_image_ptr(ptr: *mut Fl_Image) -> Self;
fn to_rgb_data(&self) -> Vec<u8>;
fn to_raw_data(&self) -> *const *const u8;
fn to_rgb(&self) -> Result<RgbImage, FltkError>;
fn scale(
        &mut self,
        width: i32,
        height: i32,
        proportional: bool,
        can_expand: bool
    );
fn count(&self) -> u32;
fn data_w(&self) -> u32;
fn data_h(&self) -> u32;
fn depth(&self) -> u32;
fn ld(&self) -> u32;
fn inactive(&mut self);
fn into_png(self) -> Result<PngImage, FltkError>;
fn into_jpeg(self) -> Result<JpegImage, FltkError>;
fn into_bmp(self) -> Result<BmpImage, FltkError>;
unsafe fn delete(&mut self);
fn was_deleted(&self) -> bool; }

Defines the methods implemented by all image types

Required methods

fn copy(&self) -> Self

Performs a deep copy of the image

fn draw(&mut self, x: i32, y: i32, width: i32, height: i32)

Draws the image at the presupplied coordinates and size

fn width(&self) -> i32

Return the width of the image

fn height(&self) -> i32

Return the height of the image

unsafe fn as_ptr(&self) -> *mut c_void

Returns a void pointer of the image, for internal use

Safety

Can return multiple mutable pointers to the image

unsafe fn as_image_ptr(&self) -> *mut Fl_Image

Retunrs a pointer of the image

Safety

Can return multiple mutable pointers to the image

unsafe fn from_image_ptr(ptr: *mut Fl_Image) -> Self

Transforms a raw image pointer to an image

Safety

The pointer must be valid

fn to_rgb_data(&self) -> Vec<u8>

Returns the underlying raw rgb image data

fn to_raw_data(&self) -> *const *const u8

Returns the underlying raw image data

fn to_rgb(&self) -> Result<RgbImage, FltkError>

Transforms the image into an RgbImage

fn scale(
    &mut self,
    width: i32,
    height: i32,
    proportional: bool,
    can_expand: bool
)

Scales the image

fn count(&self) -> u32

Return the count of an image

fn data_w(&self) -> u32

Gets the image's data width

fn data_h(&self) -> u32

Gets the image's data height

fn depth(&self) -> u32

Gets the image's depth

fn ld(&self) -> u32

Gets the image's line data size

fn inactive(&mut self)

Greys the image

fn into_png(self) -> Result<PngImage, FltkError>

Transforms an image to a PngImage

fn into_jpeg(self) -> Result<JpegImage, FltkError>

Transforms an image to a JpegImage

fn into_bmp(self) -> Result<BmpImage, FltkError>

Transforms an image to a BmpImage

unsafe fn delete(&mut self)

Deletes the image

Safety

An image shouldn't be deleted while it's being used by a widget

fn was_deleted(&self) -> bool

Checks if the image was deleted

Loading content...

Implementors

impl ImageExt for BmpImage[src]

impl ImageExt for GifImage[src]

impl ImageExt for Image[src]

impl ImageExt for JpegImage[src]

impl ImageExt for Pixmap[src]

impl ImageExt for PngImage[src]

impl ImageExt for PnmImage[src]

impl ImageExt for RgbImage[src]

impl ImageExt for SharedImage[src]

impl ImageExt for SvgImage[src]

impl ImageExt for TiledImage[src]

impl ImageExt for XbmImage[src]

impl ImageExt for XpmImage[src]

Loading content...