読者です 読者をやめる 読者になる 読者になる

quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

NSScreencast Episode #148 Function Composition with CI Filters

Function Composition with CI Filters - NSScreencast

Filterをfuncなどを使って実装

  • typealias Filter = CIImage -> CIImage
  • func
    • func sepia() -> Filter {
    • func blur(radius: Double) -> Filter {
    • func vortex(angle: Double) -> Filter {
      • CIFilter(name: "CIVortexDistortion"
      • vortex 渦、渦巻き
  • Not readable only with func - too many parens
  • composeFilters
    • infix operator • { associativity left }
    • func •(f1: Filter, f2: Filter) -> Filter {
      • return {
        • image in
        • f2(f1(image))
    • let filter = sepia() • blur(4.0) • vortex(200)
    • let output = filter(cimg)

funcの中身よくわからない

    return {
        image in
        let filter = CIFilter(name: "CIGaussianBlur", withInputParameters: [
            kCIInputImageKey: image,