epresentation of the receiver.
    /// - returns:	A UIImage object.
    open var uiimage: UIImage {
        let layer = imageView.layer as CALayer
        let contents = layer.contents as! CGImage // swiftlint:disable:this force_cast
        return UIImage(cgImage: contents, scale: CGFloat(scale), orientation: imageView.image!.imageOrientation)
    }

    /// Returns a CGImageRef representation of the receiver.
    /// - returns:	A CGImageRef object.
    open var cgImage: CGImage {
        return uiimage.cgImage!
    }

    /// Returns a CIImage representation of the receiver. Generally, this would be used to work with filters.
    /// - returns:	A CIImage object.
    open var ciImage: CIImage {
        return CIImage(cgImage: cgImage)
    }

    /// An object that provides the contents of the layer. Animatable.
    /// The default value of this property is nil.
    /// If you are using the layer to display a static image, you can set this property to the CGImageRef containing the image
    /// you want to display. Assigning a value to this property causes the layer to use your image rather than create a
    /// separate backing store.
    open var contents: CGImage {
        get {
            let layer = imageView.layer as CALayer
            return layer.contents as! CGImage // swiftlint:disable:this force_cast
        } set(val) {
            imageView.layer.contents = val
        }
    }

    /// The current rotation value of the view. Animatable.
    /// - returns: A Double value representing the cumulative rotation of the view, measured in Radians.
    open override var rotation: Double {
        get {
            if let number = imageLayer.value(forKeyPath: Layer.rotationKey) as? NSNumber {
                return number.doubleValue
            }
            return  0.0
        }
        set {
            imageLayer.setValue(newValue, forKeyPath: Layer.rotationKey)
        }
    }

    /// The scale factor of the image. (read-only)
    var scale: Double {
        return Double(imageView.image!.scale)
    }
