mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
3a7a3166a3
Add metal renderer for tint color. Добавил метал вью для рендеринга картинок. Подтянул новый алгоритм сравнения снепшотов. Обновил часть снепшотов (проверили, что все ок). Немного обновил RemoteImageViewContainer.
51 lines
1.0 KiB
Swift
51 lines
1.0 KiB
Swift
import UIKit
|
|
|
|
import Base
|
|
|
|
public protocol ImageViewProtocol {
|
|
var appearanceAnimation: ImageViewAnimation? { get set }
|
|
var imageRedrawingStyle: ImageRedrawingStyle? { get set }
|
|
var imageContentMode: ImageContentMode { get set }
|
|
}
|
|
|
|
public struct ImageViewAnimation {
|
|
let duration: Double
|
|
let delay: Double
|
|
let startAlpha: Double
|
|
let endAlpha: Double
|
|
let options: UIView.AnimationOptions
|
|
|
|
public init(
|
|
duration: Double,
|
|
delay: Double,
|
|
startAlpha: Double,
|
|
endAlpha: Double,
|
|
options: UIView.AnimationOptions
|
|
) {
|
|
self.duration = duration
|
|
self.delay = delay
|
|
self.startAlpha = startAlpha
|
|
self.endAlpha = endAlpha
|
|
self.options = options
|
|
}
|
|
}
|
|
|
|
public struct ImageRedrawingStyle: Equatable {
|
|
let tintColor: Color
|
|
let tintMode: TintMode?
|
|
|
|
public init(tintColor: Color, tintMode: TintMode? = nil) {
|
|
self.tintColor = tintColor
|
|
self.tintMode = tintMode
|
|
}
|
|
|
|
public enum TintMode {
|
|
case sourceIn
|
|
case sourceAtop
|
|
case darken
|
|
case lighten
|
|
case multiply
|
|
case screen
|
|
}
|
|
}
|