Last active
August 29, 2015 14:06
-
-
Save rborn/a5fb42ff7cc7c0d4a123 to your computer and use it in GitHub Desktop.
blur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// backview is any view | |
blurred_view = utils.make_blur({ | |
to_blur:backview, | |
width:320, | |
opacity:0.6, //<-- | |
right:0, | |
zIndex:1, | |
blursize:1.2 //<-- | |
}); | |
// with this settings you get something like this: https://www.dropbox.com/s/0che5kmshepp2u2/Photo%20Sep%2011%2C%2010%2039%2037%20AM.png?dl=0 | |
var the_blur = utils.make_blur({ | |
to_blur:pic, | |
width:320, | |
height:320, | |
opacity:0, //<-- | |
top:-85 | |
}); | |
// this is the default blur https://www.dropbox.com/s/36gnrebc5fx8p5i/Photo%20Sep%2011%2C%2010%2039%2048%20AM.png?dl=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Download the module from https://github.com/rborn/TiGPUImageView/tree/master/iphone/dist | |
var GI = require('com.bongole.ti.gpuimage'); | |
exports.make_blur = function(params) { | |
if (params.to_blur) { | |
var the_blur = GI.createGPUImageView({ | |
image: params.to_blur.toImage(), | |
filter:{ | |
filtertype:GI.FASTBLUR_FILTER, | |
blursize:params.blursize || 1 | |
} | |
}); | |
the_blur.applyProperties(params); | |
return the_blur; | |
} | |
return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment