@@ -33,12 +33,10 @@ public class Image: View, NSCopying {
33
33
34
34
/// Shape's contents are drawn on a ShapeLayer.
35
35
public var imageLayer : ImageLayer {
36
- get {
37
- return self . imageView. imageLayer
38
- }
36
+ return self . imageView. imageLayer
39
37
}
40
38
41
- //MARK: Initializers
39
+ // MARK: Initializers
42
40
43
41
/// Initializes an empty Image
44
42
public override init ( ) {
@@ -288,7 +286,7 @@ public class Image: View, NSCopying {
288
286
return img
289
287
}
290
288
291
- //MARK: Properties
289
+ // MARK: Properties
292
290
293
291
/// Returns the UIImageView of the object.
294
292
/// - returns: A UIImageView object.
@@ -299,27 +297,21 @@ public class Image: View, NSCopying {
299
297
/// Returns a UIImage representation of the receiver.
300
298
/// - returns: A UIImage object.
301
299
public var uiimage : UIImage {
302
- get {
303
- let layer = imageView. layer as CALayer
304
- let contents = layer. contents as! CGImage // swiftlint:disable:this force_cast
305
- return UIImage ( cgImage: contents, scale: CGFloat ( scale) , orientation: imageView. image!. imageOrientation)
306
- }
300
+ let layer = imageView. layer as CALayer
301
+ let contents = layer. contents as! CGImage // swiftlint:disable:this force_cast
302
+ return UIImage ( cgImage: contents, scale: CGFloat ( scale) , orientation: imageView. image!. imageOrientation)
307
303
}
308
304
309
305
/// Returns a CGImageRef representation of the receiver.
310
306
/// - returns: A CGImageRef object.
311
307
public var cgImage : CGImage {
312
- get {
313
- return uiimage. cgImage!
314
- }
308
+ return uiimage. cgImage!
315
309
}
316
310
317
311
/// Returns a CIImage representation of the receiver. Generally, this would be used to work with filters.
318
312
/// - returns: A CIImage object.
319
313
public var ciImage : CIImage {
320
- get {
321
- return CIImage ( cgImage: cgImage)
322
- }
314
+ return CIImage ( cgImage: cgImage)
323
315
}
324
316
325
317
/// An object that provides the contents of the layer. Animatable.
@@ -350,7 +342,6 @@ public class Image: View, NSCopying {
350
342
}
351
343
}
352
344
353
-
354
345
/// The scale factor of the image. (read-only)
355
346
var scale : Double {
356
347
return Double ( imageView. image!. scale)
@@ -402,19 +393,15 @@ public class Image: View, NSCopying {
402
393
internal var _originalSize : Size = Size ( )
403
394
/// The original size of the receiver when it was initialized.
404
395
public var originalSize : Size {
405
- get {
406
- return _originalSize
407
- }
396
+ return _originalSize
408
397
}
409
398
410
399
/// The original width/height ratio of the receiver when it was initialized.
411
400
public var originalRatio : Double {
412
- get {
413
- return _originalSize. width / _originalSize. height
414
- }
401
+ return _originalSize. width / _originalSize. height
415
402
}
416
403
417
- //MARK: Filters
404
+ // MARK: Filters
418
405
lazy internal var output : CIImage = self . ciImage
419
406
lazy internal var filterQueue : DispatchQueue = {
420
407
return DispatchQueue . global ( qos: . background)
0 commit comments