fn decode_data(&mut self, data_chunk: &Chunk) -> Result<(), ChunkError> {
		let mut decoder = ZlibDecoder::new(data_chunk.data.as_slice());
		let mut decoded = Vec::new();

		match decoder.read_to_end(&mut decoded) {
			Ok(_) => { self.pixels.append(&mut decoded); },
			Err(e) => return Err(ChunkError::new(format!("Couldn't decompress pixel data: {}", e).into()))
		}

		Ok(())
	}
// Dedode data and add it to the pixel array
Dedode data and add it to the pixel array
Dedode data and add it to the pixel array
fn decode_data(&mut self, data_chunk: &Chunk) -> Result<(), ChunkError> {
		let mut decoder = ZlibDecoder::new(data_chunk.data.as_slice());
		let mut decoded = Vec::new();
		match decoder.read_to_end(&mut decoded) {
			Ok(_) => { self.pixels.append(&mut decoded); },
			Err(e) => return Err(ChunkError::new(format!("Couldn't decompress pixel data: {}", e).into()))
		}
		Ok(())
	}
fn decode_data ( & mut self , data_chunk : & Chunk ) -> Result < ( ) , ChunkError > { let mut decoder = ZlibDecoder :: new ( data_chunk . data . as_slice ( ) ) ; let mut decoded = Vec :: new ( ) ; match decoder . read_to_end ( & mut decoded ) { Ok ( _ ) => { self . pixels . append ( & mut decoded ) ; } , Err ( e ) => return Err ( ChunkError :: new ( format ! ( " " e ) . into ( ) ) ) } Ok ( ( ) ) }
Dedode data and add it to the pixel array
Dedode data and add it to the pixel array
&mut self
data_chunk
&Chunk