Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First try at version 2. #20

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

First try at version 2. #20

wants to merge 15 commits into from

Conversation

ghost
Copy link

@ghost ghost commented May 20, 2014

Soooo. Consider this a work in progress, though this is as far as I've gotten with about a day's worth of work.

Animating blurRadius didn't yield as many benefits as I'd hoped. Part of the problem is that our blur kernel, which Accelerate takes in, accepts odd integers. So the scaling between various levels of blurring is not... smooth. It's chunky. Argh.

You can try working with blur radius and scale factor to get something to animate, but the results aren't pretty. I'm not really sure where to begin, for that matter, with animating scale factor because Core Animation custom parameters don't offer nearly the level of customization that I want.

Besides beating myself up over that, there's also now an option in the LFGlassLayer to offer custom frames, bounds, positioning (think like "center"), anchor points, and target layers, so that should resolve the LONG AWAITED PR #4.

That looks pretty good, and there's lots of helper code to help make that feature easy to use. I hope folks like it.

@evadne
Copy link
Owner

evadne commented May 20, 2014

Before reviewing the code — I have a hunch that instead of animating the blur kernel, it is better to cross-face two images with different blur radii.

@@ -0,0 +1,47 @@
//
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headers are not included in this project by default, so we need to either add this to all files or remove ones introduced.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what you mean. LFGlassView.h inherits from LFGlassLayer.h, though that could be moved to the implementation file and the header could see only a class definition for the LFGlassLayer instance.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the “Copyright” declaration block.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that's already been covered, as far as applying that copyright header to every interface and implementation file. Unless there are some additional files that I've missed.

@evadne
Copy link
Owner

evadne commented May 20, 2014

❤️

TBD: LiveFrost Sample + kernel slider + iPhone 4S

@ghost
Copy link
Author

ghost commented May 20, 2014

I think you're right about cross-fading two images with different blur radii and scale factors. My suspicion is that's what's happening on the lock screen in iOS 7.

I don't see a very clean way of adding that as an at run-time API right at this very instant. I'll probably pull out the current blurring bits in the meantime, as it's better to "not work" than "not work well".

@evadne
Copy link
Owner

evadne commented May 20, 2014

Regarding cross-fading that can be done as a CATransition with the fade subtype, removed when finished. Optionally, add a custom listener delegate that yells out to the layer to restart the display link and resume further dynamic blurring.

@ghost
Copy link
Author

ghost commented May 20, 2014

Have the view (or even the layer) spawn an extra layer and do the CATransition there?

That might work, probably should. Just copy, blur once, and use the copy as the "from" state while the "to" state (the current layer) lives on. I'll give that a shot after dentist.

@ghost
Copy link
Author

ghost commented May 20, 2014

That blur radius bit was even simpler than I imagined. Thanks for the suggestion, @evadne .

Nicholas Levin added 8 commits May 20, 2014 15:38
…GlassView. This keeps the defaults as they were, as before with the v2 changes, any change to blur radius would trigger an animation.
….0 tag has been made yet, and it may be a few days before that happens.)
- (void) addSubscribedViewsObject:(UIView<LFDisplayBridgeTriggering> *)object;
- (void) removeSubscribedViewsObject:(UIView<LFDisplayBridgeTriggering> *)object;
- (void) addSubscribedObject:(id<LFDisplayBridgeTriggering>)object;
- (void) removeSubscribedObject:(id<LFDisplayBridgeTriggering>)object;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question, KVO methods. 👍 ? 👎 ?

@aleclarson
Copy link

aleclarson commented Sep 26, 2016

Hey there, @evadne! I noticed this repo went dormant.

Do you still use this, or would you recommend another live blur library?

(posted in this issue because it looked interesting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants