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

Home » Public Forums » archive » TVRD
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
TVRD [message #35254] Thu, 22 May 2003 11:50
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
I'm finding TVRD doesn't return the expected result on my TRUECOLOR,
16-bit X-Windows device (with decomposed=0, retain=2):

IDL> window,1
IDL> loadct,0
IDL> tv,bindgen(16,16)
IDL> print,tvrd(0,0,16,16)
0 0 0 0 4 4 4 4 8 8 8 8 12 12 12 12
16 16 16 16 20 20 20 20 24 24 24 24 28 28 28 28
32 32 32 32 36 36 36 36 40 40 40 40 44 44 44 44
48 48 48 48 52 52 52 52 56 56 56 56 60 60 60 60
64 64 64 64 68 68 68 68 72 72 72 72 76 76 76 76
80 80 80 80 84 84 84 84 88 88 88 88 92 92 92 92
96 96 96 96 100 100 100 100 104 104 104 104 108 108 108 108
112 112 112 112 116 116 116 116 120 120 120 120 124 124 124 124
128 128 128 128 132 132 132 132 136 136 136 136 140 140 140 140
144 144 144 144 148 148 148 148 152 152 152 152 156 156 156 156
160 160 160 160 164 164 164 164 168 168 168 168 172 172 172 172
176 176 176 176 180 180 180 180 184 184 184 184 188 188 188 188
192 192 192 192 196 196 196 196 200 200 200 200 204 204 204 204
208 208 208 208 212 212 212 212 216 216 216 216 220 220 220 220
224 224 224 224 228 228 228 228 232 232 232 232 236 236 236 236
240 240 240 240 244 244 244 244 248 248 248 248 252 252 252 252

IDL> print,!D.TABLE_SIZE
256
IDL> tvlct,r,g,b,/GET
IDL> print,r
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
247 248 249 250 251 252 253 254 255

Why does it report display values rounded down to the nears multiple
of four? Is it really cheating to display these? The color map is
complete and contains 256 entries, in a linear ramp 0-255 for all
three color vectors. It doesn't matter what color map you use though,
it always rounds down to the nearest multiple of 4. It also seems to
be independent of RETAIN setting. What do others find TVRD returns in
this case?

Also try this test:

IDL> tvlct,[255b,0b,0b,255b],[0b,255b,0b,255b],[0b,0b,255b,0b]
IDL> tv,make_array(/BYTE,VALUE=3,100,100)
IDL> tv,tvrd(0,0,100,100)

Hmmm... not good. It gives you the value of the green color vector,
spread over the smaller dynamic range of the 6-bit hardware range.

My theory is that only either 5 or 6 bits are actually stored for each
color with 16-bit truecolor, so, while tvlct is using all values 0-255
for each color, in reality only 0-31 or 0-63 are valid (depending on
color... most use 6 bits for green and 5 bits for red and blue).
Sadly, IDL doesn't seem to understand this mapping, and can't map
backwards from the visual through the software colormap. To be fair,
two colors which differ only by 1/255 are the same color in a 16-bit
map. If my theory is right, this test should succeed for 8-bit and
24-bit setups.

Thanks,

JD
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: file_search windows problem
Next Topic: Help with HDF Format

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

Current Time: Sat Nov 29 05:13:23 PST 2025

Total time taken to generate the page: 0.00890 seconds