2017-02-27 1 views
2

내가 -->은 무엇입니까 GPUImage2무엇 - 운영자가 스위프트

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

의 소스 코드를 보면 의미> (보다 큼 대시 대시)?

+0

해당 패키지에만 해당되며 "일반적인"신속한 문제는 아닙니다. – Fattie

답변

3

소스에 대상을 추가하도록 선언 된 연산자입니다.

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") 
    } 
} 
3

함께 기능 쇄 파이프에 사용되는 특정 프로젝트 지정 연산자이다. 이 프로젝트는 삽입 연산자가있는 framework/Source/Pipeline.swift에 정의되어 있습니다.