fn encode_header(&mut self, total_data_size: u32){
        let bits_per_pixel = SIZE_LENGTH / HEADER_PIXEL_LENGTH;
        for i in 0..HEADER_PIXEL_LENGTH {
            let mask_for_portion = !mask::<u32>(SIZE_LENGTH - bits_per_pixel, false) >> (bits_per_pixel * i);
            let bits_portion = total_data_size & mask_for_portion;
            let bits_normalized = (bits_portion as u64) >> (bits_per_pixel * (HEADER_PIXEL_LENGTH - 1 - i));
            self.encode_bits(bits_normalized as u32, bits_per_pixel, i as u32, 0);
        }
    }
/// First HEADER_PIXEL_LENGTH pixels of container image hides a u32 with encoded
/// data length. This functions encodes that u32 in those pixels.
///
/// This way decoding function knows how many bytes decode from host image.
///
/// # Parameters:
/// * total_data_size: Total amount of bytes for data hidden.
First HEADER_PIXEL_LENGTH pixels of container image hides a u32 with encoded
data length. This functions encodes that u32 in those pixels.

This way decoding function knows how many bytes decode from host image.
First HEADER_PIXEL_LENGTH pixels of container image hides a u32 with encoded data length . This functions encodes that u32 in those pixels . This way decoding function knows how many bytes decode from host image .
fn encode_header(&mut self, total_data_size: u32){
        let bits_per_pixel = SIZE_LENGTH / HEADER_PIXEL_LENGTH;
        for i in 0..HEADER_PIXEL_LENGTH {
            let mask_for_portion = !mask::<u32>(SIZE_LENGTH - bits_per_pixel, false) >> (bits_per_pixel * i);
            let bits_portion = total_data_size & mask_for_portion;
            let bits_normalized = (bits_portion as u64) >> (bits_per_pixel * (HEADER_PIXEL_LENGTH - 1 - i));
            self.encode_bits(bits_normalized as u32, bits_per_pixel, i as u32, 0);
        }
    }
fn encode_header ( & mut self , total_data_size : u32 ) { let bits_per_pixel = SIZE_LENGTH / HEADER_PIXEL_LENGTH ; for i in 0 .. HEADER_PIXEL_LENGTH { let mask_for_portion = ! mask :: < u32 > ( SIZE_LENGTH - bits_per_pixel , false ) >> ( bits_per_pixel * i ) ; let bits_portion = total_data_size & mask_for_portion ; let bits_normalized = ( bits_portion as u64 ) >> ( bits_per_pixel * ( HEADER_PIXEL_LENGTH - 1 - i ) ) ; self . encode_bits ( bits_normalized as u32 , bits_per_pixel , i as u32 , 0 ) ; } }
First HEADER_PIXEL_LENGTH pixels of container image hides a u32 with encoded
data length.
First HEADER_PIXEL_LENGTH pixels of container image hides a u32 with encoded data length .
&mut self
total_data_size
u32
&mut self
total_data_size
u32
parameters:
Total amount of bytes for data hidden.
Total amount of bytes for data hidden .