fn decode_bits(&self, x: u32, y: u32, bits_length: u8)-> u32{
        // I don't know if we have an image with alpha channel so both cases should be implemented.
        if let Some(contained_image) = self.image.as_rgba8() {
            let pixel = contained_image.get_pixel(x, y);
            ContainerImage::extract_hidden_data(&[pixel[0], pixel[1], pixel[2]], bits_length)
        } else {
            let contained_image = self.image.as_rgb8()
                .expect("Something wrong happened when accessing to inner image to encode data");
            let pixel = contained_image.get_pixel(x, y);
            ContainerImage::extract_hidden_data(&[pixel[0], pixel[1], pixel[2]], bits_length)
        }
    }
/// Decode bits hidden into given pixel defined by x and y coordinates.
///
/// # Parameters:
/// * x: X coordinate of pixel where data is going to be hidden.
/// * y: Y coordinate of pixel where data is going to be hidden.
/// * bits_length: How many bits at pixel are actually hiden data.
///
/// # Returns:
/// * Recovered bits are returned into a u32.
Decode bits hidden into given pixel defined by x and y coordinates.
Decode bits hidden into given pixel defined by x and y coordinates .
fn decode_bits(&self, x: u32, y: u32, bits_length: u8)-> u32{
        // I don't know if we have an image with alpha channel so both cases should be implemented.
        if let Some(contained_image) = self.image.as_rgba8() {
            let pixel = contained_image.get_pixel(x, y);
            ContainerImage::extract_hidden_data(&[pixel[0], pixel[1], pixel[2]], bits_length)
        } else {
            let contained_image = self.image.as_rgb8()
                .expect("Something wrong happened when accessing to inner image to encode data");
            let pixel = contained_image.get_pixel(x, y);
            ContainerImage::extract_hidden_data(&[pixel[0], pixel[1], pixel[2]], bits_length)
        }
    }
fn decode_bits ( & self , x : u32 , y : u32 , bits_length : u8 ) -> u32 { // I don't know if we have an image with alpha channel so both cases should be implemented. if let Some ( contained_image ) = self . image . as_rgba8 ( ) { let pixel = contained_image . get_pixel ( x , y ) ; ContainerImage :: extract_hidden_data ( & [ pixel [ 0 ] , pixel [ 1 ] , pixel [ 2 ] ] , bits_length ) } else { let contained_image = self . image . as_rgb8 ( ) . expect ( " " ) ; let pixel = contained_image . get_pixel ( x , y ) ; ContainerImage :: extract_hidden_data ( & [ pixel [ 0 ] , pixel [ 1 ] , pixel [ 2 ] ] , bits_length ) } }
Decode bits hidden into given pixel defined by x and y coordinates.
Decode bits hidden into given pixel defined by x and y coordinates .
&self
x
u32
y
u32
bits_length
u8
&self
x
u32
y
u32
bits_length
u8
parameters:
X coordinate of pixel where data is going to be hidden.
y: Y coordinate of pixel where data is going to be hidden.
bits_length: How many bits at pixel are actually hiden data.
X coordinate of pixel where data is going to be hidden . y : Y coordinate of pixel where data is going to be hidden . bits_length : How many bits at pixel are actually hiden data .
returns:
Recovered bits are returned into a u32.
Recovered bits are returned into a u32 .