hugeterry / ployfun Goto Github PK
View Code? Open in Web Editor NEWLowPoly image processing./导入图片生成Low Poly风格图片的app
License: GNU General Public License v3.0
LowPoly image processing./导入图片生成Low Poly风格图片的app
License: GNU General Public License v3.0
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.
直接崩溃了,老哥~我下载的Apk
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.