use xege::*;
fn main() {
let img1 = Image::from_file("examples/demo.jpg").unwrap();
let mut img2 = Image::new(500, 500);
let mut xege = initgraph(500, 500, Init::Default).unwrap();
img2.drawimage_with_scale(
&img1,
Rect {
x: 0,
y: 0,
width: 500,
height: 500,
},
Rect {
x: 0,
y: 0,
width: img1.getwidth() as _,
height: img1.getheight() as _,
},
);
// Get red channel
xege.setfillcolor(Color::rgb(0xFF, 0x7F, 0x3F));
xege.putimage(0, 0, &img2, |pen, src, _dst| src & pen);
xege.window.flush();
loop {}
}