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

Home » Public Forums » archive » TVRD, Decomposed = ? and 24bit display
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: TVRD [message #35362 is a reply to message #35251] Thu, 05 June 2003 12:39 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Here is another example which shows the problem.


PRO my_color
DEVICE,decomposed=0
WINDOW,1,xs=300,ys=300,xpos=0,ypos=300,title='MASTER'

z=DIST(300)

r0=MAKE_ARRAY(256,/index,/BYTE)
g0=MAKE_ARRAY(256,/index,/BYTE)-128b
b0=128b-MAKE_ARRAY(256,/index,/BYTE)

TVLCT,r0,g0,b0

TV,z

TVLCT,r,g,b,/get

PRINT,'Difference between set and get'
print,'max diff.:','min diff.:'
PRINT,'red:',MAX(r0-r,MIN=m),m
PRINT,'green',MAX(g0-g,MIN=m),m
PRINT,'blue',MAX(b0-b,MIN=m),m

col_def=BYTE(STRING(r,format='(i3)')+$
STRING(g,format='(i3)')+$
STRING(b,format='(i3)'))
ix=WHERE(col_def EQ 32b)
col_def[ix]=BYTE('0')
col_def=STRING(col_def)
img=TVRD(true=1)
WINDOW,2,xs=300,ys=300,xpos=300,ypos=300,title='COPY'
TV,img,/true
col_img=BYTE(STRING(img[0,*,*],format='(I3)')+$
STRING(img[1,*,*],format='(I3)')+$
STRING(img[2,*,*],format='(I3)'))
ix=WHERE(col_img EQ 32b)
col_img[ix]=BYTE('0')
col_img=STRING(col_img)

new_img=MAKE_ARRAY(300,300,/BYTE)
n_col_img=SIZE(col_img,/N_ELEMENTS)
FOR i=0L,n_col_img-1 DO BEGIN
ix=WHERE(col_def EQ col_img[i],count_ix)
IF count_ix GT 0 THEN BEGIN
new_img[i]=ix[0]
ENDIF
ENDFOR
re=col_img[uniq(col_img,SORT(col_img))]
HELP,re
WINDOW,3,xs=300,ys=300,xpos=600,ypos=300,title='RESULT'
TV,new_img

PRINT,'my defined color tripled'
PRINT,TRANSPOSE(col_def[sort(col_def)])
PRINT,'============================'
PRINT,'true color color tripled'
PRINT,TRANSPOSE(re)
PRINT,'============================'
PRINT,'many colors aren''t defined, but still there!!'
PRINT,'result shows only colors which are defined'


END


--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: vfw for idl
Next Topic: transparent background

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

Current Time: Fri Oct 10 17:17:24 PDT 2025

Total time taken to generate the page: 1.83898 seconds