message: Update encode_rgb as well.
diff: @@ -120,23 +120,20 @@ impl<'a, W: Write + 'a> BMPEncoder<'a, W> {
  row_pad_size: u32,
  bytes_per_pixel: u32,
  ) -> io::Result<()> {
  - let x_stride = bytes_per_pixel;
  + let width = width as usize;
  + let height = height as usize;
  + let x_stride = bytes_per_pixel as usize;
  let y_stride = width * x_stride;
  - for row in 0..height {
  + for row in (0..height).rev() {
  // from the bottom up
  - let row_start = (height - row - 1) * y_stride;
  - for col in 0..width {
  - let pixel_start = (row_start + (col * x_stride)) as usize;
  - let r = image[pixel_start];
  - let g = image[pixel_start + 1];
  - let b = image[pixel_start + 2];
  + let row_start = row * y_stride;
  + for px in image[row_start.. row_start + y_stride].chunks_exact(x_stride) {
  + let r = px[0];
  + let g = px[1];
  + let b = px[2];
  // written as BGR
  - self.writer.write_u8(b)?;
  - self.writer.write_u8(g)?;
  - self.writer.write_u8(r)?;
  - // alpha is never written as it's not widely supported
  + self.writer.write(&[b, g, r])?;
  }
  -
  self.write_row_pad(row_pad_size)?;
  }
  @@ -282,6 +279,17 @@ mod tests {
  buf
  }
  + #[cfg(feature = "benchmarks")]
  + #[bench]
  + fn bench_encode_rgb(b: &mut Bencher) {
  + let mut v= Vec::with_capacity(2000 * 2000);
  + let mut x = BMPEncoder::new(&mut v);
  + let mut im = vec![0; 2000 * 2000];
  + b.iter(|| {
  + x.encode_rgb(&mut im, 500, 2000, 0, 4);
  + });
  + }
  +
  #[cfg(feature = "benchmarks")]
  #[bench]
  fn bench_encode_rgba(b: &mut Bencher) {
  