graphics

Android image filter libraries

筅森魡賤 提交于 2019-12-18 10:36:23
问题 Are there any image libraries available for Android as seen in http://www.jhlabs.com/ip/filters/index.html? Or have some one ported the same? Thanks in advance. 回答1: I didn't try the code yet. but I run the sample app. I think it is good to use, https://github.com/finebyte/android-jhlabs 回答2: I know this is an old topic, but in the absence of the AWT libraries I have started porting some image filters from the Marvin Image framework (found here) I have set it up as a googlecode project here

Find tunnel 'center line'?

牧云@^-^@ 提交于 2019-12-18 10:29:49
问题 I have some map files consisting of 'polylines' (each line is just a list of vertices) representing tunnels, and I want to try and find the tunnel 'center line' (shown, roughly, in red below). I've had some success in the past using Delaunay triangulation but I'd like to avoid that method as it does not (in general) allow for easy/frequent modification of my map data. Any ideas on how I might be able to do this? 回答1: An "algorithm" that works well with localized data changes. The critic's

How to recreate the math behind photoshop curves

橙三吉。 提交于 2019-12-18 10:20:32
问题 Basically, what I want to do is understand how to calculate the values along a 'curve' as represented here in the photoshop curves box: So, given N points with x between 0 and 1 and y between 0 and 1 - we'll create a curve that passes through all these points. Given this curve, I'd like to be able to calculate all values of the curve for any given X. In other words, I'd like to modify values of color just like the curves box does, but programmatically. I've read that these are "catmull-rom

When does the transition from clip space to screen coordinates happen?

霸气de小男生 提交于 2019-12-18 10:13:57
问题 I was studying the rendering pipeline and when I got to the clipping stage it was explained that from the view (eye or camera) space we have to pass to the clip space , also called normalized device space (NDC), that is a cubic space from -1 to 1. However, now I don't understand when the passage from this space to the screen coordinates space happens: Right after clipping and before rasterization? After rasterization and before scissor and z-test? At the end just before writing on the frame

Repaint leaves trail

北城余情 提交于 2019-12-18 08:57:30
问题 I know that this isn't the first time that this question has been asked, but the responses haven't helped me much, so I am helping I am finally going to get my answer I have made this little game where I have made a car drive around a track (using rectangles was mandatory). When I use the repaint() metod the rectangle representing the car repaints in the new location, but leaves a trail behind. I have this code: import java.awt.Color; import java.awt.Component; import java.awt.Dimension;

Android SurfaceView/Canvas flickering after trying to clear it

好久不见. 提交于 2019-12-18 08:48:08
问题 So I am trying to clear the Canvas using canvas.drawColor(Color.BLACK) but if I just call this once, the display flickers and displays the old drawing which should have been covered up by the drawColor. Here is the important bits of my code - // This method is called by a Thread public void update() { Canvas canvas = holder.lockCanvas(null); if (canvas != null) { onDraw(canvas); } holder.unlockCanvasAndPost(canvas); } @Override protected void onDraw(Canvas canvas) { if (toClear) { canvas

Draw parallel Line

陌路散爱 提交于 2019-12-18 07:25:39
问题 I have a set of points representing a line. It might be a closed shape or an open one. I need to draw a parallel line that goes besides the original one without any intersection. I have the following code to return the generated line. I have problems in the angles of the shape. Some point goes over the original line. My Code is: PointF[] GetParrarel(PointF[] lst, double width, float distance) { List<PointF> final = new List<PointF>(); width = width + distance; for (int i = 0; i < lst.Length-1

QuickFill/flood fill algorithm in C#/VB.NET

时光毁灭记忆、已成空白 提交于 2019-12-18 07:21:56
问题 I need a flood fill algorithm to fill existing raster shapes with various colors and fill patterns. From what I know, the QuickFill algorithm is the best way to do a flood fill. I've found a number of implementations, but they are all in C++ and use Windows SDK functions. The problem is that I need a .NET implementation. If worse comes to worse I can write a new implementation, but I would rather use an existing implementation (that hopefully doesn't have bugs). Is anyone aware of an existing

QuickFill/flood fill algorithm in C#/VB.NET

自闭症网瘾萝莉.ら 提交于 2019-12-18 07:19:00
问题 I need a flood fill algorithm to fill existing raster shapes with various colors and fill patterns. From what I know, the QuickFill algorithm is the best way to do a flood fill. I've found a number of implementations, but they are all in C++ and use Windows SDK functions. The problem is that I need a .NET implementation. If worse comes to worse I can write a new implementation, but I would rather use an existing implementation (that hopefully doesn't have bugs). Is anyone aware of an existing

How to copy one Graphics Object into another

微笑、不失礼 提交于 2019-12-18 06:56:33
问题 I am trying to copy the contents of one graphics object to another, but the only was I have been able to find is based on using GDI32.DLL , which i would rather avoid using if possible. Does anyone know how/if this is possible using managed code? I don't mind if answers are in C# or VB.Net. Here is what I currently have: Private Sub CopyGraphics() Dim srcPic As Graphics = pnl.CreateGraphics Dim srcBmp As New Bitmap(pnl.Width, pnl.Height, srcPic) Dim srcMem As Graphics = Graphics.FromImage