alexdrone / ios-realtimeblur Goto Github PK
View Code? Open in Web Editor NEWMultipurpose real-time blur view for iOS6+
License: MIT License
Multipurpose real-time blur view for iOS6+
License: MIT License
What is the license for this code?
I'm new so I can't really offer much more than that. Does this still work?
Hi, thank you for your work here. It really looks very good!
I'm having a small problem. I want to set realtimeblur as background of a view that contains a scrollview inside. When I scroll, everything in the blur is getting recalculated or somethings which leds my app cpu usage to 100% and the scroll became very very slow.
Is possible just to render view on bottom of realtimeblur?
Thank you,
Mário
I received the following error. Thought I should warn you. Great library by the way. :)
CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
I tried everything nothing works on iOS 7 tintColor, backgroundColor you cannot change it it's always white, my app has a dark theme and the blurred view needs to match the app, but you cannot change it
Looks like this doesn't work correct. Trying to build something like the control center in iOS7. So if I try to present a blur view modally from the bottom of the window, the blur view isn't real time. Just statically contains its background and doesn't change as it's animated.
Any ideas how to implement this?
I dont quite understand why to set the intermediate buffer in UIImage+BoxBlur to process with the origin image use vImageBoxConvolve_ARGB8888, dose it more efficiency to process it once?
Did you want to create the pull request/issue on CocoaPods/Specs to add this to the list? Or would you like me to go ahead with it?
The performance of this library could be greatly improved, below is a list of recommendations to take to increase the performance:
Both of the above recommendations can be found here: https://gist.github.com/robertjpayne/6775157. I didn't create a pull request because the code is not heavily tested.
In the simple testing I did it resulted in a speedup of about 2-3x.
even with less frames <10 if this is applied on a view which contains a tableview everything is extremely jerky.
Good try though. thank you for your work.
Is there any way to change how strong the blur is? Thanks!
The bug is in
// the following will always return nil outside of drawRect
CGContextRef context = UIGraphicsGetCurrentContext();
// as seemingly the only reason for obtaining the context is to pass it to
// [layer renderInContext:context];
simply remove the following lines of code
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, -visibleRect.origin.x, -visibleRect.origin.y);
and replace
[layer renderInContext:context];
with
[layer renderInContext:UIGraphicsGetCurrentContext()];
I was evaluating the project and ran into what I think is an issue, unless it is intended behavior. The image that is captured, blurred and presented in the blur view is not actually the region under the blur view.
Easy to demonstrate. Change the creation of the blurView in the sample project by setting the blurRadius to zero where the blurView is created in viewDidLoad in the sample project.
//Creates a live blur view
self.blurView = [[DRNRealTimeBlurView alloc] initWithFrame:CGRectMake(60, 110, 200, 200)];
self.blurView.blurRadius = 0; // <=== ADD THIS LINE
[self.view addSubview:self.blurView];
You will note that the no longer blurred text shown in the blurView is from the (0,0) position in the superView, not the area directly under the blurView, as you can see the orange text in the blurView which is not under the blurView but in the upper left of the superView.
Screenshot below.
The code for the box blur category appears to be taken from this StackOverflow post:
http://stackoverflow.com/a/17138341/143151
The SO license states that attribution is required, and the license in this project should be changed from "All Right Reserved" to an open license similar to the SO license.
This is the text of the SO license:
When i change frame size after initializing the view, it renders a black background and no blur effect
I have a moving transparent view on top of the blurred view and I can see it in the blurred view.
These lines made me say WTF
NSData *imageData = UIImageJPEGRepresentation(image, kDRNRealTimeBlurViewScreenshotCompression);
image = [[UIImage imageWithData:imageData] drn_boxblurImageWithBlur:kDRNRealTimeBlurViewBlurRadius];
There is a comment that claims higher JPEG compression would lead to better performance, but that seems incredibly unlikely to me. The time and memory required to perform the compression almost certainly outweigh any benefit. Does the blur algorithm even depend on the content of the image? I presume it is just about the size of the buffer. These two lines more than double the memory required, for no good reason.
Since you need access to the raw pixel data, you should probably create a CGBitmapContext up front, using a buffer you allocate, and then render directly into that. Then you can proceed directly to the blur without making copies of anything.
Hello,
I've used your library to implement a blur on a UIImageView (awesome work). The thing is that when I go back to the previous view, this error shows up:
"CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update."
I think it's a problem within the function renderLayerWithView because the context is not present anymore.
I'll try to fixit myself. Just letting you know! thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.