[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: optimization question: a faster way to PIXMAP?



A suggestion: don't use graphics functions.  You could use
POLYFILLV (see the example code in the online help) or the
IDLanROI::ComputeMask() function (IDL 5.3) to do this without
using graphics at all (note: I have not actually timed these
alternatives, so your milage may vary).

FWIW.

"Dennis J. Boccippio" wrote:
> 
> A question for the IDL gurus:
> 
> - I have data in the form of irregular polygons, each polygon has
>   an associated value (let's call it an amplitude).  I want a
>   composite image of the sum of all these polygons' amplitudes.
> 
> - My current approach is to :
> 
>    (1) create a (large) WINDOW,../PIXMAP,
>    (2) render each polygon using POLYFILL
>    (3) TVRD() the pixmap window
>    (4) add this to an accumulation array
> 
>    ... iterate (1)-(4) until all polygons have been rendered
> 
> This works, but is painfully slow.  Profiling the code shows that
>   by far the most significant logjam is the TVRD() of the pixmap.
> 
> So: does anyone know of more efficient ways to do this?  Is the Z
>   device an option - it seems like it can be used for internal frame
>   storage, but would still have to be probed by TVRD()...?
> 
> Thanks,
> 
> Dennis
> 
> --
>   _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>   _/ Dennis J. Boccippio                                        _/
>   _/ http://fly.hiwaay.net/~djboccip/Dennis.html                _/
>   _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

-- 
rjf.
Randy Frank                            | ASCI Visualization
Lawrence Livermore National Laboratory | rjfrank@llnl.gov
B451 Room 2039  L-561                  | Voice: (925) 423-9399
Livermore, CA 94550                    | Fax:   (925) 423-8704