在Swift中->(大于破折号)运算符是什么意思

角izz

我看一下GPUImage2的源代码

    picture = PictureInput(image:UIImage(named:"WID-small.jpg")!)
    filter = SaturationAdjustment()
    picture --> filter --> renderView
    picture.processImage()

怎么-->办?

FlowUI。SimpleUITesting.com

这是声明为将目标目标添加到源中的运算符。

infix operator --> : AdditionPrecedence
//precedencegroup ProcessingOperationPrecedence {
//    associativity: left
////    higherThan: Multiplicative
//}
@discardableResult public func --><T:ImageConsumer>(source:ImageSource, destination:T) -> T {
    source.addTarget(destination)
    return destination
}

该函数在pipeline.swift文件中声明

addTarget功能也很自我描述。

public func addTarget(_ target:ImageConsumer, atTargetIndex:UInt? = nil) {
    if let targetIndex = atTargetIndex {
        target.setSource(self, atIndex:targetIndex)
        targets.append(target, indexAtTarget:targetIndex)
        transmitPreviousImage(to:target, atIndex:targetIndex)
    } else if let indexAtTarget = target.addSource(self) {
        targets.append(target, indexAtTarget:indexAtTarget)
        transmitPreviousImage(to:target, atIndex:indexAtTarget)
    } else {
        debugPrint("Warning: tried to add target beyond target's input capacity")
    }
}

就像其他人说的那样编辑,该运算符是该项目的自定义项,并且自2018年3月29日起并未内置快速语言

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在Python方法签名中,->(大于-破折号的箭头符号)是什么意思?

什么是Ruby / Rails中的->(大于破折号)运算符

在Git中,“-”(破折号)是什么意思?

`git switch -`中的破折号是什么意思?

=> 运算符在 Swift 中是什么意思?

//运算符在Julia中是什么意思?

:=运算符在mysql中是什么意思?

/ =运算符在Python中是什么意思?

<< =运算符在Java中是什么意思?

JavaScript中的'/ ='运算符是什么意思?

Haskell中的/ =运算符是什么意思?

这些运算符在Elixir中是什么意思?〜>>,<<〜

问号运算符在Ruby中是什么意思?

这个 `^` 运算符在 Dart 中是什么意思?

在Delphi中,“&”运算符是什么意思?

Python中的运算符“ <>”是什么意思?

这个“ >> =”运算符在C中是什么意思?

C#中的“ <<”运算符是什么意思

这个运算符`=>`在verilog中是什么意思

ls -l输出中的第一个破折号是什么意思?

在“ p4 where”的输出中,前导“-”(破折号)是什么意思?

sed命令中的破折号e(-e)是什么意思?

Ubuntu dpkg版本号中的冒号(:)和破折号(-)是什么意思?

svg 的 d 属性中的破折号“-”是什么意思?

“ git checkout-...”中的-(单破折号)是什么意思?

在“找不到命令”错误中,在“ bash”之前加破折号“-”是什么意思?

Unix命令行中的破折号“-”是什么意思?

三元运算符中的“ + =”运算符是什么意思?

[[Element] .Element]在Swift的==运算符重载中是什么意思?