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

Home » Public Forums » archive » repeated use of TVRD() gives different results
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
repeated use of TVRD() gives different results [message #93741] Tue, 11 October 2016 11:44 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
This is the sort of IDL quirk that I think drove David Fanning into retirement.

The following two lines repeatedly TVRD() the value of a screen pixel

IDL> window,0,xsize = 640,ysize=512 ;Create a window
IDL> for i=0,19 do print,tvrd(635,507,1,1,/true) ;Read one pixel

On my El Capitan Macbook running IDL V8.5.1 in decomposed mode, I get

0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
112 97 46
0 0 8
8 0 0
0 0 14
0 0 0
0 0 0
0 0 0
0 0 0
113 120 46
46 120 113
114 112 47
0 0 14
0 0 14

In other words, repeatedly reading the same pixel does not give the same results. (This does *not* happen on my Linux box but only on the Mac.) Coyote graphics reads a corner pixel to decide whether you are using a "traditional" IDL plot (black background), or modern graphics (white background). But after the first call, this test can randomly fail because the result of TVRD() is unpredictable.

(I am mostly weened off of direct graphics, but still need to maintain legacy code.) --Wayne

Current graphics device: X
Server: X11.0, The X.Org Foundation, Release 11704000
Display Depth, Size: 24 bits, (1440,878)
Visual Class: TrueColor (4)
Bits Per RGB: 8 (8/8/8)
Physical Color Map Entries (Emulated / Actual): 256 / 256
Colormap: Shared, 16777216 colors. Translation table: Bypassed
Graphics pixels: Decomposed, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.
Window Status: ---------------------
id typ( x, y, backing store) id typ( x, y, backing store)
0: Win( 640, 512, Req from Server)

IDL> !VERSION
{
"ARCH": "x86_64",
"OS": "darwin",
"OS_FAMILY": "unix",
"OS_NAME": "Mac OS X",
"RELEASE": "8.5.1",
"BUILD_DATE": "Nov 14 2015",
"MEMORY_BITS": 64,
"FILE_OFFSET_BITS": 64
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Technique to find maximum in 100x100 element moving box
Next Topic: array of structures -- error Conflicting data structures

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

Current Time: Wed Oct 08 15:59:27 PDT 2025

Total time taken to generate the page: 0.00192 seconds