Преглед изворни кода

Rename DefaultProcessor to DefaultImageProcessor

onevcat пре 9 година
родитељ
комит
027a522c49
2 измењених фајлова са 15 додато и 15 уклоњено
  1. 12 12
      Sources/ImageProcessor.swift
  2. 3 3
      Sources/KingfisherOptionsInfo.swift

+ 12 - 12
Sources/ImageProcessor.swift

@@ -94,17 +94,17 @@ fileprivate struct GeneralProcessor: ImageProcessor {
 
 /// The default processor. It convert the input data to a valid image.
 /// Images of .PNG, .JPEG and .GIF format are supported.
-/// If an image is given, `DefaultProcessor` will do nothing on it and just return that image.
-public struct DefaultProcessor: ImageProcessor {
+/// If an image is given, `DefaultImageProcessor` will do nothing on it and just return that image.
+public struct DefaultImageProcessor: ImageProcessor {
     
-    /// A default `DefaultProcessor` could be used across.
-    public static let `default` = DefaultProcessor()
+    /// A default `DefaultImageProcessor` could be used across.
+    public static let `default` = DefaultImageProcessor()
     
     public let identifier = ""
     
-    /// Initialize a `DefaultProcessor`
+    /// Initialize a `DefaultImageProcessor`
     ///
-    /// - returns: An initialized `DefaultProcessor`.
+    /// - returns: An initialized `DefaultImageProcessor`.
     public init() {}
     
     public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
@@ -152,7 +152,7 @@ public struct RoundCornerImageProcessor: ImageProcessor {
             let size = targetSize ?? image.kf_size
             return image.kf_image(withRoundRadius: cornerRadius, fit: size, scale: options.scaleFactor)
         case .data(_):
-            return (DefaultProcessor() |> self).process(item: item, options: options)
+            return (DefaultImageProcessor() |> self).process(item: item, options: options)
         }
     }
 }
@@ -179,7 +179,7 @@ public struct ResizingImageProcessor: ImageProcessor {
         case .image(let image):
             return image.kf_resize(to: targetSize)
         case .data(_):
-            return (DefaultProcessor() |> self).process(item: item, options: options)
+            return (DefaultImageProcessor() |> self).process(item: item, options: options)
         }
     }
 }
@@ -208,7 +208,7 @@ public struct BlurImageProcessor: ImageProcessor {
             let radius = blurRadius * options.scaleFactor
             return image.kf_blurred(withRadius: radius)
         case .data(_):
-            return (DefaultProcessor() |> self).process(item: item, options: options)
+            return (DefaultImageProcessor() |> self).process(item: item, options: options)
         }
     }
 }
@@ -242,7 +242,7 @@ public struct OverlayImageProcessor: ImageProcessor {
         case .image(let image):
             return image.kf_overlaying(with: overlay, fraction: fraction)
         case .data(_):
-            return (DefaultProcessor() |> self).process(item: item, options: options)
+            return (DefaultImageProcessor() |> self).process(item: item, options: options)
         }
     }
 }
@@ -270,7 +270,7 @@ public struct TintImageProcessor: ImageProcessor {
         case .image(let image):
             return image.kf_tinted(with: tint)
         case .data(_):
-            return (DefaultProcessor() |> self).process(item: item, options: options)
+            return (DefaultImageProcessor() |> self).process(item: item, options: options)
         }
     }
 }
@@ -314,7 +314,7 @@ public struct ColorControlsProcessor: ImageProcessor {
         case .image(let image):
             return image.kf_adjusted(brightness: brightness, contrast: contrast, saturation: saturation, inputEV: inputEV)
         case .data(_):
-            return (DefaultProcessor() |> self).process(item: item, options: options)
+            return (DefaultImageProcessor() |> self).process(item: item, options: options)
         }
     }
 }

+ 3 - 3
Sources/KingfisherOptionsInfo.swift

@@ -99,7 +99,7 @@ public enum KingfisherOptionsInfoItem {
     /// Processor for processing when the downloading finishes, a processor will convert the downloaded data to an image
     /// and/or apply some filter on it. If a cache is connected to the downloader (it happenes when you are using
     /// KingfisherManager or the image extension methods), the converted image will also be sent to cache as well as the
-    /// image view. `DefaultProcessor.default` will be used by default.
+    /// image view. `DefaultImageProcessor.default` will be used by default.
     case processor(ImageProcessor)
 }
 
@@ -230,11 +230,11 @@ extension Collection where Iterator.Element == KingfisherOptionsInfoItem {
     }
     
     var processor: ImageProcessor {
-        if let item = kf_firstMatchIgnoringAssociatedValue(.processor(DefaultProcessor.default)),
+        if let item = kf_firstMatchIgnoringAssociatedValue(.processor(DefaultImageProcessor.default)),
             case .processor(let processor) = item
         {
             return processor
         }
-        return DefaultProcessor.default
+        return DefaultImageProcessor.default
     }
 }