pub fn transformation(&self, cod: &str, a: f32, b:i32){
        let mut width = self.rect.get().width as u32;
        let mut height = self.rect.get().height as u32;
        let image_data;
        let new_slice;
        let mut image;
        if self.mask_flag.get() {
            //get image data in form of [Color] slice
            image_data = self.mask.clone().into_inner().into_data();
            new_slice = self.trans_from_slice(&image_data,width,height,cod,a,b);
            image = self.mask.borrow_mut();
        }else{
            //first prepare for undo 
            self.undo_save();
            //get image data in form of [Color] slice
            image_data = self.image.clone().into_inner().into_data();
            new_slice = self.trans_from_slice(&image_data,width,height,cod,a,b);
            image = self.image.borrow_mut();
        }
        if cod == "resize" {
            width = a as u32;
            height = b as u32;
            self.rect.set(Rect::new(0,CANVASOFFSET,width,height));
        }
        image.clear();
        if cod == "rotate90" {
            image.image(0, 0, height, width, &new_slice[..]);
        }else{
            image.image(0, 0, width, height, &new_slice[..]);
        }
    }
///apply some transformations to entire canvas or mask
apply some transformations to entire canvas or mask
apply some transformations to entire canvas or mask
pub fn transformation(&self, cod: &str, a: f32, b:i32){
        let mut width = self.rect.get().width as u32;
        let mut height = self.rect.get().height as u32;
        let image_data;
        let new_slice;
        let mut image;
        if self.mask_flag.get() {
            //get image data in form of [Color] slice
            image_data = self.mask.clone().into_inner().into_data();
            new_slice = self.trans_from_slice(&image_data,width,height,cod,a,b);
            image = self.mask.borrow_mut();
        }else{
            //first prepare for undo 
            self.undo_save();
            //get image data in form of [Color] slice
            image_data = self.image.clone().into_inner().into_data();
            new_slice = self.trans_from_slice(&image_data,width,height,cod,a,b);
            image = self.image.borrow_mut();
        }
        if cod == "resize" {
            width = a as u32;
            height = b as u32;
            self.rect.set(Rect::new(0,CANVASOFFSET,width,height));
        }
        image.clear();
        if cod == "rotate90" {
            image.image(0, 0, height, width, &new_slice[..]);
        }else{
            image.image(0, 0, width, height, &new_slice[..]);
        }
    }
pub fn transformation ( & self , cod : & str , a : f32 , b : i32 ) { let mut width = self . rect . get ( ) . width as u32 ; let mut height = self . rect . get ( ) . height as u32 ; let image_data ; let new_slice ; let mut image ; if self . mask_flag . get ( ) { //get image data in form of [Color] slice image_data = self . mask . clone ( ) . into_inner ( ) . into_data ( ) ; new_slice = self . trans_from_slice ( & image_data , width , height , cod , a , b ) ; image = self . mask . borrow_mut ( ) ; } else { //first prepare for undo  self . undo_save ( ) ; //get image data in form of [Color] slice image_data = self . image . clone ( ) . into_inner ( ) . into_data ( ) ; new_slice = self . trans_from_slice ( & image_data , width , height , cod , a , b ) ; image = self . image . borrow_mut ( ) ; } if cod == " " { width = a as u32 ; height = b as u32 ; self . rect . set ( Rect :: new ( 0 , CANVASOFFSET , width , height ) ) ; } image . clear ( ) ; if cod == " " { image . image ( 0 , 0 , height , width , & new_slice [ .. ] ) ; } else { image . image ( 0 , 0 , width , height , & new_slice [ .. ] ) ; } }
apply some transformations to entire canvas or mask
apply some transformations to entire canvas or mask
&self
cod
&str
a
f32
b
i32
&self
cod
&str
a
f32
b
i32