fn paste_selection (&mut self, x: i32, y:i32, opacity: u8, buffer: orbimage::Image, ){
        
        let w = buffer.width() as i32;
        let h = buffer.height() as i32;
        let xc=x-w/2; //center buffer at cursor 
        let yc=y-h/2;
        let data = buffer.into_data();
        let mut i:usize = 0;
        let mut r;
        let mut g;
        let mut b;
        let mut a;
        let x1:i32;
        let y1:i32;
        
        for y1 in yc..yc+h {
            for x1 in xc..xc+w {
                if i < data.len(){
                    r = data[i].r();
                    g = data[i].g();
                    b = data[i].b();
                    a = data[i].a();
                    if a != 0 {a = opacity}
                    self.pixel(x1,y1,Color::rgba(r,g,b,a));
                }
                i += 1;
            }
        }
    }
///draws an image into current image starting at x,y (paste) with transparency
draws an image into current image starting at x,y (paste) with transparency
draws an image into current image starting at x y ( paste ) with transparency
fn paste_selection (&mut self, x: i32, y:i32, opacity: u8, buffer: orbimage::Image, ){
        let w = buffer.width() as i32;
        let h = buffer.height() as i32;
        let xc=x-w/2; //center buffer at cursor 
        let yc=y-h/2;
        let data = buffer.into_data();
        let mut i:usize = 0;
        let mut r;
        let mut g;
        let mut b;
        let mut a;
        let x1:i32;
        let y1:i32;
        for y1 in yc..yc+h {
            for x1 in xc..xc+w {
                if i < data.len(){
                    r = data[i].r();
                    g = data[i].g();
                    b = data[i].b();
                    a = data[i].a();
                    if a != 0 {a = opacity}
                    self.pixel(x1,y1,Color::rgba(r,g,b,a));
                }
                i += 1;
            }
        }
    }
fn paste_selection ( & mut self , x : i32 , y : i32 , opacity : u8 , buffer : orbimage :: Image , ) { let w = buffer . width ( ) as i32 ; let h = buffer . height ( ) as i32 ; let xc = x - w / 2 ; //center buffer at cursor  let yc = y - h / 2 ; let data = buffer . into_data ( ) ; let mut i : usize = 0 ; let mut r ; let mut g ; let mut b ; let mut a ; let x1 : i32 ; let y1 : i32 ; for y1 in yc .. yc + h { for x1 in xc .. xc + w { if i < data . len ( ) { r = data [ i ] . r ( ) ; g = data [ i ] . g ( ) ; b = data [ i ] . b ( ) ; a = data [ i ] . a ( ) ; if a != 0 { a = opacity } self . pixel ( x1 , y1 , Color :: rgba ( r , g , b , a ) ) ; } i += 1 ; } } }
draws an image into current image starting at x,y (paste) with transparency
draws an image into current image starting at x y ( paste ) with transparency
&mut self
x
i32
y
i32
opacity
u8
buffer
orbimage::Image
&mut self
x
i32
y
i32
opacity
u8
buffer
orbimage::Image