-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
454 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pub(crate) fn merge_channels_3<T: Copy>( | ||
image: &mut [T], | ||
width: usize, | ||
height: usize, | ||
first: &[T], | ||
second: &[T], | ||
third: &[T], | ||
) { | ||
let mut shift = 0usize; | ||
let mut shift_plane = 0usize; | ||
for _ in 0..height { | ||
let shifted_image = &mut image[shift..]; | ||
let shifted_first_plane = &first[shift_plane..]; | ||
let shifted_second_plane = &second[shift_plane..]; | ||
let shifted_third_plane = &third[shift_plane..]; | ||
for x in 0..width { | ||
let px = x * 3; | ||
shifted_image[px] = shifted_first_plane[x]; | ||
shifted_image[px + 1] = shifted_second_plane[x]; | ||
shifted_image[px + 2] = shifted_third_plane[x]; | ||
} | ||
shift += width * 3; | ||
shift_plane += width; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pub(crate) fn split_channels_3<T: Copy>( | ||
image: &[T], | ||
width: usize, | ||
height: usize, | ||
first: &mut [T], | ||
second: &mut [T], | ||
third: &mut [T], | ||
) { | ||
let mut shift = 0usize; | ||
let mut shift_plane = 0usize; | ||
for _ in 0..height { | ||
let shifted_image = &image[shift..]; | ||
let shifted_first_plane = &mut first[shift_plane..]; | ||
let shifted_second_plane = &mut second[shift_plane..]; | ||
let shifted_third_plane = &mut third[shift_plane..]; | ||
for x in 0..width { | ||
let px = x * 3; | ||
shifted_first_plane[x] = shifted_image[px]; | ||
shifted_second_plane[x] = shifted_image[px + 1]; | ||
shifted_third_plane[x] = shifted_image[px + 2]; | ||
} | ||
shift += width * 3; | ||
shift_plane += width; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.