When Lukas Morawietz​ posted the first version of his “Blur script” without the picture.

When Lukas Morawietz​ posted the first version of his “Blur script” without the picture. I thought he made something like this.

This is just a little PoC too. Scaling this thing is harder then I imagined.

]]>

26 Commentsto When Lukas Morawietz​ posted the first version of his “Blur script” without the picture.

  1. Anonymous says:

    < ![CDATA[

    /* Test PoC


    */



    LL.bindClass(“android.graphics.Bitmap”);


    LL.bindClass(“android.graphics.Canvas”);


    LL.bindClass(“android.renderscript.RenderScript”);


    LL.bindClass(“android.renderscript.Allocation”);


    LL.bindClass(“android.renderscript.ScriptIntrinsicBlur”);




    var img = null;


    var bmp = null;


    var pnt = null;



    var d = LL.getCurrentDesktop();


    var bb = d.getBoundingBox();



    var bmp = d.getItemByName(“BG”).getBoxBackground(“n”).getBitmap();



    var evt = LL.getEvent();


    //var itm = evt.getItem();


    var itm = d.getItemByName(“blur”);



    var rs=RenderScript.create(LL.getContext());


    var a=Allocation.createFromBitmap(rs,bmp);


    var blur=ScriptIntrinsicBlur.create(rs,a.getElement());


    blur.setInput(a);


    blur.setRadius(14);


    blur.forEach(a);


    a.copyTo(bmp);



    var itmW = itm.getWidth();


    var itmH = itm.getHeight();


        if (itm.getProperties().getBoolean(“i.onGrid”))


         {


                var itmL = (itm.getCell().getLeft() * itm.getParent().getCellWidth() ) ; //- bb.getLeft();


                var itmT = (itm.getCell().getTop()  * itm.getParent().getCellHeight()) ; //- bb.getTop() ;


        }else{


                var itmL = itm.getPositionX() + bb.getLeft();


                var itmT = itm.getPositionY() + bb.getTop() ;


        }


    pnt = new Paint(Paint.ANTI_ALIAS_FLAG);


    img = LL.createImage(itmW, itmH);


    img.draw().drawBitmap(bmp, -itmL, -itmT, pnt);


    img.save();


    itm.setBoxBackground(img, “ns”, true);



    img = null;


    bmp = null;


    pnt = null;

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Needs:


    a pinned item with name “BG”.


    a panel with name “blur”.


    I did set the tab-event of “BG” to run the script.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Nice blur effect 😊

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Nice work

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Cool! What’s the name of the brightness slider widget you put on your settings screecn? I’ve been looking for something like that for years.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Glenn Thomson​ that’s from my custom rom. I cannot remember any custom rom without this feature.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Thanks, Jappie Toutenhoofd​. I haven’t gotten around to rooting my phone yet. I’ll have to give it a try

    ]]>

  8. Anonymous says:

    < ![CDATA[

    I’m trying to use this script, and it’s not throwing any errors, but it’s not doing anything visually. I have the BG object acting as a wallpaper, stretched to the full size of my desktop, amd sent to the back layer. The image I’ve put on it I did so by setting as the normal, selected, and focused background images. I’ve tried opening the folder, then tapping the BG object (I assigned the script to tap), and it isn’t doing anything.



    Does it maybe not work with folders?



    Is there something else I need to do?

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Detaching the item (just the panel, or both) from the grid, then running the script, leave a panel with a completely transparent background.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    So your first pic shows the PoC still works with a panel.


    It also shows what i ment with: “Scaling it right is hard”.


    I think it can be done to set it to a folder but I will have to fidle with it, to find out how.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    If you pause my video on the moment with the blur effect, you can see it is actually way off too.


    And trust me, I tried many our to set it right. On the thread from Lucas, Pierre explains that you can not exactly predict the scaling.


    The many ’empty’ results probably come from the black parts of your background.

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Here’s an album of it all.


    https://imgur.com/a/7X6PI

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Here’s an album of it all.


    https://imgur.com/a/7X6PI

    ]]>

  14. Anonymous says:

    < ![CDATA[

    Now i see….and remember..


    Detach from grid.


    Tap once = resize panel


    Tap again = scaling it.


    Try fiddle with that.

    ]]>

  15. Anonymous says:

    < ![CDATA[

    When the panel is detached from grid, tapping the BG object at all appears to just erase the panel background. Would it make a difference if the BG object is pinned?

    ]]>

  16. Anonymous says:

    < ![CDATA[

    It does a different calculation if the “bur’-item is detached from grid.

    ]]>

  17. Anonymous says:

    < ![CDATA[

    I’ve figured it out. It lines up correctly for me now if the background image is exactly the size of my screen.

    ]]>

  18. Anonymous says:

    < ![CDATA[

    Photo to proof 😉

    ]]>

  19. Anonymous says:

    < ![CDATA[

    Nice job!


    One question : when you say:exactly the screensize. That is the screenresolution like 800×480 or do you correct for top bottom bar?

    ]]>

  20. Anonymous says:

    < ![CDATA[

    Playing with the “14” in the script will give you more or less blur!

    ]]>

  21. Anonymous says:

    < ![CDATA[

    The image file that I’ve got set as the background for the BG object is the same dimensions as my screen resolution (1560×2440)



    The bottom bar down there is just icons I’ve put. I have tactile back, square, and home buttons.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *