comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDLgrImage drawing performance with IDLgrPalette
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDLgrImage drawing performance with IDLgrPalette [message #46224] Tue, 08 November 2005 11:05
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
I stumbled upon this curiosity today and was wondering if I'm doing
something wrong or if this is an "IDL thing" I have found that IDL is
very slow at drawing indexed color images that use palettes to an RGB
device. Or at least it is very slow using my approach. I generally use
true color images so maybe I am missing something... Consider the
following:

pro test_palette

; read some image data, along with palette
imgData = READ_PNG(FILEPATH('africavlc.png', $
SUBDIRECTORY=['examples', 'data']), r, g, b)
imgDims = SIZE(imgData, /DIMENSIONS)

; create the image object w/o a palette and add to a model
oImg = OBJ_NEW('IDLgrImage', imgData)
oMod = OBJ_NEW('IDLgrModel')
oMod -> Add, oImg

; create a view and window
oView = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[0,0,imgDims[0], $
imgDims[1]])
oView -> Add, oMod
oWin = OBJ_NEW('IDLgrWindow', DIMENSIONS=imgDims)

; time drawing this image
t0 = SYSTIME(/SECONDS)
for n=0, 5 do oWin -> Draw, oView
print, SYSTIME(/SECONDS) - t0

; Add a palette to the image object
oPalette = OBJ_NEW('IDLgrPalette', r, g, b)
oImg -> SetProperty, PALETTE=oPalette

; time drawing image with palette
t0 = SYSTIME(/SECONDS)
for n=0, 5 do oWin -> Draw, oView
print, SYSTIME(/SECONDS) - t0

OBJ_DESTROY, [oWin, oView, oMod, oPalette]

end

And the output:
IDL> test_palette
0.00000000
27.626000


I had to cut the iterations down to 5 because I didn't have the patience
to sit thru the second test.

What am I missing?


IDL> print, !version
{ x86 Win32 Windows Microsoft Windows 6.1.1 Oct 11 2004 32 64}


-Rick
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: writing ascii-file with separator
Next Topic: Re: IDLgrImage drawing performance with IDLgrPalette

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:32:26 PDT 2025

Total time taken to generate the page: 0.72041 seconds