Are these 1-pixel wide arcs or wider?

Currently we have 2 different paths for drawArc. If we determine that the stroke size is "less than or equal to a pixel" then we trace along the arc and use a bresenham-like algorithm to touch the pixels. If it is wider then we invoke a "line widening" algorithm which takes the original arc path and computes a path which surrounds the pixels touched for stroking it. This widening algorithm can take comparatively much longer to run than a simple single pixel arc or a filled arc.

If you want to get a fast "ring" to draw, it would be better to create a path which can be filled to draw it. You would draw CW for the outer part of the ring, then draw a line towards the center, then draw another arc CCW for th inner part of the ring and close the path. Calculating and filling that path would go much faster than "draw"ing an arc with a wide stroke.

The Arc2D class can generate bezier paths for arcs of arbitrary size, but it always generates them in the same direction so it would be hard to use it to do the above. Alternatively you can google for the math to create bezier curves to draw an arc - the math is pretty simple - and create your own GeneralPath manually.

Hope that helps...

                ...jim

[EMAIL PROTECTED] wrote:
Well, this seems really hard to optimize ... tons of
very small primitives.

i've calculated that when i'm dealing with a full set of data, thats after 250 
frames, i need to do 90,000 draw-Arc calls.


The only advice I can give you is to grab the Raster
of a INT_RGB buffered image:
byte[]
data=((DataBufferByte)tex.getRaster().getDataBuffer())
.getData()  (in your case its an int[] of course),
and write code that does the drawing on the
pixel-array itself.

It should be really fast to colour those few pixels
if you don't have to walk through a general
framework, but instead do exactly what you need and
that optimized.
The downside of course is quite a lot of hand-written
low-level code.

lg Clemens
[Message sent by forum member 'ser207' (ser207)]

http://forums.java.net/jive/thread.jspa?messageID=301129

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to