Code Monkey home page Code Monkey logo

icamera's Introduction

iCamera

Live camera filter with CIFilter in Objective-C

Platform: iOS 10+ Language: ObjC License: MIT


Installation

Add KTCamera.h and KTCamera.m in your project.


Usage


Setup & Running camera session

-(void)setupCamera {
    self.camera = [KTCamera new];
    self.camera.delegate = self;
    self.camera.flashMode = AVCaptureFlashModeOff;
    [self.camera setupSessionWithCompletionHandler:^(NSError * _Nonnull error) {
        if (error != nil) {
            NSLog(@"Setup camera error: %@", error.localizedDescription);
            return;
        }
        
        [self.camera startRunning];
    }];
}

Add camera filter

self.camera.filter = [CIFilter filterWithName:@"CIComicEffect"];

Capture photo

[self.camera capturePhoto];

Delegate handle

-(void)camera:(KTCamera *)camera didOutputSampleImage:(CIImage *)ciImage {
    dispatch_async(dispatch_get_main_queue(), ^{
        //Using ciImage for preview
    });
}

-(void)camera:(KTCamera *)camera didCaptureImage:(UIImage *)image {
	//Handle capture photo (filtered image)
}

Contributing

As the creators, and maintainers of this project, we're glad to invite contributors to help us stay up to date.

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License

KTCamera is available under the MIT license. See the LICENSE file for more info.

icamera's People

Contributors

quockhai avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.