open class OperationGroup: ImageProcessingOperation {
    public let inputImageRelay = ImageRelay()
    public let outputImageRelay = ImageRelay()

    public var sources: SourceContainer { return inputImageRelay.sources }
    public var targets: TargetContainer { return outputImageRelay.targets }
    public let maximumInputs: UInt = 1

    public private(set) var userInfo: [AnyHashable: Any]?

    public init() {}

    public func newFramebufferAvailable(_ framebuffer: Framebuffer, fromSourceIndex: UInt) {
        userInfo = framebuffer.userInfo

        inputImageRelay.newFramebufferAvailable(framebuffer, fromSourceIndex: fromSourceIndex)
    }

    public func configureGroup(_ configurationOperation: (_ input: ImageRelay, _ output: ImageRelay) -> Void) {
        configurationOperation(inputImageRelay, outputImageRelay)
    }

    public func transmitPreviousImage(to target: ImageConsumer, atIndex: UInt) {
        outputImageRelay.transmitPreviousImage(to: target, atIndex: atIndex)
    }
}
