Merge some byte swap/premultiply functions in their own crate

This commit is contained in:
Anthony Ramine 2018-10-06 00:40:48 +02:00
parent a2e3dd4e86
commit 784fbb2bc1
18 changed files with 85 additions and 96 deletions

View file

@ -7,6 +7,7 @@ use canvas_data::*;
use canvas_traits::canvas::*;
use euclid::Size2D;
use ipc_channel::ipc::{self, IpcSender};
use pixels;
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::thread;
@ -141,7 +142,7 @@ impl<'a> CanvasPaintThread <'a> {
let data = match imagedata {
None => vec![0; image_size.width as usize * image_size.height as usize * 4],
Some(mut data) => {
byte_swap(&mut data);
pixels::byte_swap_colors_inplace(&mut data);
data.into()
},
};