GitHub project page

Struct lodepng::CVec [-]  [+] [src]

pub struct CVec<T> {
    // some fields omitted
}

Horrible kludge to free memory allocated by lodepng

Methods

impl<T> CVec<T>

unsafe fn new(ptr: *mut T, elements: usize) -> CVec<T>

fn len(&self) -> usize

Number of elements (pixels for pixel type, bytes for u8 type only)

fn to_vec(&self) -> Vec<T>

Copies elements into a Vec

fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T]

Exposes memory as slice without copying

fn as_u8_slice<'a>(&'a self) -> &'a [u8]

Exposes memory as raw bytes slice without copying

Trait Implementations

impl<T> AsSlice<T> for CVec<T>

fn as_slice(&self) -> &[T]

Exposes pixel's memory as slice without copying

impl<T> Drop for CVec<T>

fn drop(&mut self)