Struct greenglas::image::Image
[−]
[src]
pub struct Image { /* fields omitted */ }
The Transformable Data Type Image
Methods
impl Image
[src]
fn new(image: DynamicImage) -> Image
Create a new Image from a DynamicImage
fn from_path<P>(path: P) -> Image where
P: AsRef<Path>,
P: AsRef<Path>,
Create a new Image from a Path
fn from_buffer(buf: &[u8]) -> Image
Create a new Image from Buffer
fn from_rgb_pixels(
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
Create a new Image from RGB style pixel container such as Vec
fn from_rgba_pixels(
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
Create a new Image from RGBa style pixel container such as Vec
fn from_luma_pixels(
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
Create a new Image from Luma (greyscale) style pixel container such as Vec
fn from_lumaa_pixels(
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
w: u32,
h: u32,
buf: Vec<u8>
) -> Result<Image, TransformerError>
Create a new Image from LumaA style pixel container such as Vec
Trait Implementations
impl Set for Image
[src]
fn set<M>(self, modifier: M) -> Self where
M: Modifier<Self>,
M: Modifier<Self>,
Modify self using the provided modifier.
fn set_mut<M>(&mut self, modifier: M) -> &mut Self where
M: Modifier<Self>,
M: Modifier<Self>,
Modify self through a mutable reference with the provided modifier.
impl Transformer for Image
[src]
fn transform_to_vec(&self) -> Vec<f32>
Transforms the non-numeric data into a numeric Vec
fn transform(
&self,
shape: &[usize]
) -> Result<SharedTensor<f32>, TransformerError>
&self,
shape: &[usize]
) -> Result<SharedTensor<f32>, TransformerError>
Transforms non-numeric data into a numeric SharedTensor
Read more
fn write_to_memory<T: NumCast + Copy>(
mem: &mut FlatBox,
data: &[T]
) -> Result<(), TransformerError>
mem: &mut FlatBox,
data: &[T]
) -> Result<(), TransformerError>
Write into a native Coaster Memory.
fn write_to_memory_offset<T: NumCast + Copy>(
mem: &mut FlatBox,
data: &[T],
offset: usize
) -> Result<(), TransformerError>
mem: &mut FlatBox,
data: &[T],
offset: usize
) -> Result<(), TransformerError>
Write into a native Coaster Memory with a offset.