Struct darknet::Image
[−]
[src]
pub struct Image(pub image);
Image
Methods
impl Image
[src]
pub fn new(w: i32, h: i32, c: i32) -> Self
[src]
Create a new image.
pub fn load<P: AsRef<Path>>(filename: P) -> Result<Self, Error>
[src]
Load a new image.
pub fn load_color<P: AsRef<Path>>(filename: P) -> Result<Self, Error>
[src]
Load a new image with color.
pub fn decode_jpg(buf: &[u8]) -> Self
[src]
Decode a new image (always color, 3 channels).
pub fn draw_box(&mut self, d: &Detection, w: i32, r: f32, g: f32, b: f32)
[src]
Draw a box based on the detection.
pub fn save<P: AsRef<Path>>(&self, filename: P) -> Result<(), Error>
[src]
Save the image.
pub fn save_jpg<P: AsRef<Path>>(&self, filename: P) -> Result<(), Error>
[src]
Save the image as jpg.
pub fn encode_jpg(&self) -> Vec<u8>
[src]
Save the image as jpg.
pub fn resize(&self, w: i32, h: i32) -> Image
[src]
Resize and return a new image.
pub fn width(&self) -> i32
[src]
Image width.
pub fn height(&self) -> i32
[src]
Image height.
pub fn channel(&self) -> i32
[src]
Image channel.
Trait Implementations
impl Debug for Image
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Image
[src]
fn clone(&self) -> Image
[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