[−][src]Function photon::channels::swap_channels
pub fn swap_channels(img: &mut PhotonImage, channel1: usize, channel2: usize)
Swap two channels.
Arguments
img
- A PhotonImage.channel1
- An index from 0 to 2, representing the Red, Green or Blue channels respectively. Red would be represented by 0, Green by 1, and Blue by 2.channel2
- An index from 0 to 2, representing the Red, Green or Blue channels respectively. Same as above.
Example
// For example, to swap the values of the Red channel with the values of the Blue channel: photon::channels::swap_channels(&mut img, 0, 2);