Code Monkey home page Code Monkey logo

ployfun's People

Contributors

hugeterry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ployfun's Issues

Error: No containing Triangle.

Hello,
Firstly, I am a huge fan of your work. It's just amazing and the best part about it is that its faster than other methods and that it can run on android without native. A huge thank you, for your effort.
I am implementing your method in my app to generate lowpoly wallpapers. It works absolutely fine when I use a bitmap which is scaled to 1440x1080 but the problem in that is the images (which are of different sizes) come out with a bad aspect ratio. So in order to scale them properly, I use two methods -
public int getScreenWidth() { int densityDpi = (int) Math.floor((double) width * (double) getScreenHeight() / (double) height); return densityDpi; }

and
public int getScreenHeight() { DisplayMetrics metrics = getResources().getDisplayMetrics(); int densityDpi = (int) (metrics.heightPixels * 1.2); return densityDpi; }

After that, I scale the bitmap to getScreenWidth()xgetScreenHeight(). But the problem in this case is that it gives me java.lang.IllegalArgumentException: No containing triangle

Here is the full stack trace-
** java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:318)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.IllegalArgumentException: No containing triangle
at LowPoly.core.DelaunayTriangulation.Triangulation.delaunayPlace(Triangulation.java:192)
at zebrostudio.wallr100.DetailActivity$12$2.doInBackground(DetailActivity.java:521)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
at java.lang.Thread.run(Thread.java:761) **

Now the line at which the app crashes is - dt.delaunayPlace(new Pnt(width - 1, 1));

*What I have tried - *
For different devices with different display sizes and different wallpapers with varying dimensions, the app cashes at one of the following lines -
dt.delaunayPlace(new Pnt(1, 1)); dt.delaunayPlace(new Pnt(1, height - 1)); dt.delaunayPlace(new Pnt(width - 1, 1)); dt.delaunayPlace(new Pnt(width - 1, height - 1));

Please note -
I cannot extract the image from a imageView, because the wallpaper would be of small dimension then and will get pixelated on setting it as wallpaper.

Thank you.

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.