Skip to content

Commit

Permalink
Rename byte_swap_and_premultiply to byte_swap_colors_inplace
Browse files Browse the repository at this point in the history
The function did not actually premultiply.
  • Loading branch information
nox committed Oct 5, 2018
1 parent 82c7d71 commit a2e3dd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/net_traits/image/base.rs
Expand Up @@ -47,7 +47,7 @@ pub struct ImageMetadata {
// reference count them.

// TODO(pcwalton): Speed up with SIMD, or better yet, find some way to not do this.
fn byte_swap_and_premultiply(data: &mut [u8]) {
fn byte_swap_colors_inplace(data: &mut [u8]) {
let length = data.len();

let mut i = 0;
Expand Down Expand Up @@ -82,7 +82,7 @@ pub fn load_from_memory(buffer: &[u8]) -> Option<Image> {
DynamicImage::ImageRgba8(rgba) => rgba,
image => image.to_rgba(),
};
byte_swap_and_premultiply(&mut *rgba);
byte_swap_colors_inplace(&mut *rgba);
Some(Image {
width: rgba.width(),
height: rgba.height(),
Expand Down

0 comments on commit a2e3dd4

Please sign in to comment.