Struct fltk::image::RgbImage[][src]

pub struct RgbImage { /* fields omitted */ }
Expand description

Creates a struct holding a raw RGB image

Implementations

impl RgbImage[src]

pub fn new(
    data: &[u8],
    w: i32,
    h: i32,
    depth: ColorDepth
) -> Result<RgbImage, FltkError>
[src]

Initializes a new raw RgbImage, copies the data and handles its lifetime. If you need to work with RGB data,

Errors

Errors on invalid or unsupported image format

pub unsafe fn from_data(
    data: &[u8],
    w: i32,
    h: i32,
    depth: ColorDepth
) -> Result<RgbImage, FltkError>
[src]

Initializes a new raw RgbImage from shared data, doesn’t handle the data’s lifetime

Safety

The data must be valid for the lifetime of the image

Errors

Errors on invalid or unsupported image format

pub unsafe fn new2(
    data: &[u8],
    w: i32,
    h: i32,
    depth: i32,
    line_data: i32
) -> Result<RgbImage, FltkError>
[src]

Initializes a new raw RgbImage, copies the data and handles its lifetime. If you need to work with RGB data,

Errors

Errors on invalid or unsupported image format

Safety

Passing wrong line data can read to over or underflow

pub unsafe fn from_data2(
    data: &[u8],
    w: i32,
    h: i32,
    depth: i32,
    line_data: i32
) -> Result<RgbImage, FltkError>
[src]

Initializes a new raw RgbImage from shared data, doesn’t handle the data’s lifetime

Safety

The data must be valid for the lifetime of the image

Errors

Errors on invalid or unsupported image format

Safety

Passing wrong line data can read to over or underflow

pub unsafe fn into_parts(self) -> (Vec<u8>, i32, i32)[src]

Deconstructs a raw RgbImage into parts

Safety

Destructures the image into its raw elements

Trait Implementations

impl Clone for RgbImage[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for RgbImage[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Drop for RgbImage[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl ImageExt for RgbImage[src]

fn copy(&self) -> Self[src]

Performs a deep copy of the image

fn draw(&mut self, arg2: i32, arg3: i32, arg4: i32, arg5: i32)[src]

Draws the image at the presupplied coordinates and size

fn width(&self) -> i32[src]

Return the width of the image

fn height(&self) -> i32[src]

Return the height of the image

fn w(&self) -> i32[src]

Return the width of the image

fn h(&self) -> i32[src]

Return the height of the image

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

Retunrs a pointer of the image Read more

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

Transforms a raw image pointer to an image Read more

fn to_rgb_data(&self) -> Vec<u8>[src]

Returns the underlying raw rgb image data

fn to_raw_data(&self) -> *const *const u8[src]

Returns the underlying raw image data

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

Transforms the image into an RgbImage Read more

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

Scales the image

fn count(&self) -> i32[src]

Return the count of an image

fn data_w(&self) -> i32[src]

Gets the image’s data width

fn data_h(&self) -> i32[src]

Gets the image’s data height

fn depth(&self) -> ColorDepth[src]

Gets the image’s depth

fn ld(&self) -> i32[src]

Gets the image’s line data size

fn inactive(&mut self)[src]

Greys the image

unsafe fn delete(img: Self)[src]

Deletes the image Read more

unsafe fn increment_arc(&mut self)[src]

INTERNAL: Manually increment the atomic refcount Read more

unsafe fn decrement_arc(&mut self)[src]

INTERNAL: Manually decrement the atomic refcount Read more

fn was_deleted(&self) -> bool[src]

Checks if the image was deleted

unsafe fn into_image<I: ImageExt>(self) -> I[src]

Transforms an Image base into another Image Read more

impl Send for RgbImage[src]

impl Sync for RgbImage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.