Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)captureOutput:(AVCaptureOutput *)captureOutput
- didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
- fromConnection:(AVCaptureConnection *)connection
- -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
- fromConnection:(AVCaptureConnection *)connection{
- //Метод вызывается при записи данных с камеры в буфер
- UIImage *image = [self imageFromSampleBuffer:sampleBuffer];
- //Преобразовывать полученный буфер в картинку
- dispatch_sync(dispatch_get_main_queue(),
- ^{
- self.imageView.image = [self applyMonoChromeWithRedColor:image];
- //Применить какие-либо эффекты к изображению,
- // фильтр, к примеру, и добавить на экран
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement