     
     @IBAction func switchBackground() {
         print("switchBackground")
+        let rawValue = (backgroundMode.rawValue + 1) % BackgroundMode.limit.rawValue
+        backgroundMode = BackgroundMode(rawValue: rawValue)!
     }
     
     @IBAction func undo() {

    let layer:CALayer
    let maskColor:UIColor?
    let fPlus:Bool
}

protocol SNTrimControllerDelegate : class {

            builder.minSegment = 8.0 / xform.a
        }
    }
    
    // Background
    private var backgroundMode = BackgroundMode.limit {
        didSet {
            checkerView.image = nil
            thumbImage.image = nil
            switch(backgroundMode) {
            case .checker:
                checkerView.image = checkerImage
                thumbImage.image = checkerImage
            case .black:
                checkerView.backgroundColor = UIColor.blackColor()
                thumbImage.backgroundColor = UIColor.blackColor()
            case .white:
                checkerView.backgroundColor = UIColor.whiteColor()
                thumbImage.backgroundColor = UIColor.whiteColor()
            default:
                break
            }
        }
    }
    private var checkerImage:UIImage?

    // Image Cache
    private let cacheCycle = 8
    private let cacheMax = 8
