Help us understand the problem. What is going on with this article?

GPUImageLookUpWithIntensity

GPUImageLookUpWithIntensity.swift
import AVFoundation
import Foundation

import UIKit
import GPUImage

class LiveCameraVC: UIViewController
{



 //   @IBOutlet weak var modifiedImageView = GPUImageView()

    @IBOutlet weak var modifiedImageView: GPUImageView!

    var videoCamera:GPUImageVideoCamera?

    // MARK: - Variables
    var intensitys = 1.0


    @IBAction func SaturationSlider(sender: UISlider) {
        let test = sender.value

        //  saturationFilter?.saturation = CGFloat(sender.value)
        intensitys = Double(CGFloat(sender.value))
        filter.intensity = CGFloat(intensitys)

    }





//    let filter: GPUImageLookupFilter = {
//        let filter = GPUImageLookupFilter()
//        filter.intensity = intensitys
//        return filter
//    }()

    // MARK: - UI



    // MARK: - Life Cycle

    override func viewDidLoad() {
        super.viewDidLoad()



            videoCamera = GPUImageStillCamera(sessionPreset: AVCaptureSession.Preset.photo.rawValue, cameraPosition: .back)

            videoCamera!.outputImageOrientation = .portrait;
            videoCamera!.horizontallyMirrorFrontFacingCamera = true


      //  videoCamera?.addTarget(modifiedImageView)

        self.performLut()
        videoCamera?.startCapture()
        print("Tapped")


    }

  //  override func loadView() {
  //      super.loadView()

       // self.view.addSubview(modifiedImageView)
        //modifiedImageView.autoPinEdgesToSuperviewEdges()
  //  }

    // MARK: - Private
    let imagePicture: GPUImagePicture? = {
        if let imagePicture = GPUImagePicture(image: UIImage(named:"lookup_amatorka")) {
            return imagePicture
        } else {
            print("GPUImagePicture Nil")
            return nil
        }
    }()

    let filter = GPUImageLookupFilter()

    private func performLut() {
        if let videoCamera = videoCamera {

         //   var imagePicture = GPUImagePicture(image: UIImage(named:"lookup_amatorka"))

            //let filter = GPUImageLookupFilter()
            filter.intensity = CGFloat(intensitys)

            videoCamera.addTarget(filter)
            imagePicture?.addTarget(filter)
            imagePicture?.processImage()
            filter.addTarget(modifiedImageView)
          //  videoCamera.startCapture()



            /*
            if let imagePicture = imagePicture {
                videoCamera.addTarget(filter)
                imagePicture.addTarget(filter)
                imagePicture.processImage()
                filter.addTarget(modifiedImageView)
                videoCamera.startCapture()
            }
 */
        }
    }

}


Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした