Hi Stephen,
I think you could make this faster by creating an array of lists. Each
array index should correspond to a y value in your output and the list
should contain all the x values on that row. Then your drawing loop
becomes really simple: you just look up the list for the current row and
iterate over that.
On 12/03/11 14:54, Stephen Newbold wrote:
My second question concerns the actual generation of my curve points
to start with. As I mention I am currently using a single locked
thread to do this within the draw_engine() but is there a better place
to be doing this? Would it not be more efficient to process this
somewhere before the call to draw_engine() so I can limit the output
to only the X values I'm going to need as defined by looking at the
values within my vector of points?
Yes, there are better places. Have a look at the NDK docs: at the bottom
of the page called "Writing 2D operators" there's a section titled "Call
Order Overview" which describes what your options are. I would suggest
you calculate the bounding box for the curve in your _validate method
and the _open method would be the right place to rasterise the curve.
Hope that helps,
Vil.
--
Vilya Harvey
The Foundry, 6th Floor, Communications Building
48 Leicester Square, London, WC2H 7LT, UK
Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906
Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd. Registered in England and Wales No: 4642027
_______________________________________________
Nuke-dev mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev