GithubHelp home page GithubHelp logo

jaunesarmiento / ios-realtimeblur Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexdrone/ios-realtimeblur

0.0 2.0 1.0 394 KB

Real-time blur view, like in iOS 7

License: MIT License

Objective-C 95.41% Ruby 4.59%

ios-realtimeblur's Introduction

ios-realtimeblur

Real-time blur view, like in iOS 7. (deployable on iOS5, 6 and 7)

IMAGE ALT TEXT HERE

Usage

• • • Make sure you link to the Accelerate.framework • • •

Instantiate it and use it as any other view :)

//Creates a live blur view
DRNRealTimeBlurView *blurView = [[DRNRealTimeBlurView alloc] initWithFrame:CGRectMake(60, 110, 200, 200)];
[self.view addSubview:blurView];

You can add all the subviews you want to it...

UIImageView *speakerImage = [[UIImageView alloc] initWithFrame:CGRectMake(50, 50, 100, 100)];
speakerImage.image = [UIImage imageNamed:@"speaker"];
[blurView addSubview:speakerImage];

If you want to have a static rendering (useful if your view is presented modally) just set

blurView.renderStatic = YES;

You can set the tint color of the view via the tint property (still TODO: use iOS7 tintColor ;)) - The default one is clearColor

In DRNRealTimeBlurView.h there are some constants that you can tweak to improve the smoothness/performances of the view or to define some default values.

//the blur radius
static const CGFloat kDRNRealTimeBlurViewBlurRadius = 1.f;

//the default corner radius for all the DRNRealTimeBlurViews
static const CGFloat kDRNRealTimeBlurViewDefaultCornerRadius = 20.f;

//the view is rendered every kDRNRealTimeBlurViewRenderPeriod seconds
//tweak this value to have a smoother or a more perfomant rendering
static const CGFloat kDRNRealTimeBlurViewRenderFps = 30.f;

//the alpha component of the tint color
static const CGFloat kDNRRealTimeBlurTintColorAlpha = 0.1f;

TODO

  • Improve it ;)

Credits

If you use this component in your app, please add some credits :) The box blur algorithm is from this beautiful blog post: http://indieambitions.com/idevblogaday/perform-blur-vimage-accelerate-framework-tutorial

ios-realtimeblur's People

Contributors

alexdrone avatar a-zak avatar dmiedema avatar troyharris avatar macmannes avatar cbess avatar nicklockwood avatar jaunesarmiento avatar

Watchers

James Cloos avatar  avatar

Forkers

alexguoq

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.