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

Home » Public Forums » archive » Alpha blending with object graphics - different color palettes do not work
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
Alpha blending with object graphics - different color palettes do not work [message #75790] Wed, 04 May 2011 04:11
LNpellen is currently offline  LNpellen
Messages: 37
Registered: November 2009
Member
Hi,

I'm trying to move from direct to object graphics and I have the
following problem:

I want to display a CT image in greyscale overlayed with a colored
dosemap.

The CT is an indexed image. The display seems fine: greyscale.
The dose map is also originally indexed, but I've converted it to a
[2,n,m] bytarr to add the alpha channel.
The blending seems fine, but the palette is greyscale, not rainbow as
I hoped for.

I have the RETAIN=2 defined in widget_draw
I have the DEVICE, RETAIN=2, DECOMPOSED=0 just after the XMANAGER part
in the GUI file

I'm setting the pallette both the CT image and the dose image
oPaletteCT->LoadCT, 0
oImageCT = OBJ_NEW('IDLgrImage', temp, PALETTE=oPaletteCT)
oPaletteDose->LoadCT, 13
oImageDose = OBJ_NEW('IDLgrImage', alphaDose , BLEND_FUNCTION = [3,
4], $
ALPHA_CHANNEL=0.50, PALETTE=oPaletteDose)

This is how I create the alphaDose:
alphaDose = BYTARR(2, size[0], size[1], /NOZERO)
alphaDose[0,*,*]=dose
alphaDose[1,*,*]=255*alpha ; where alpha is a factor between 0 and 1

Why isn't the rainbow (LoadCT, 13) working for me?

Best regards,
LNpellen
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Before I dive in. Anyone have a yaml parser?
Next Topic: Re: serial port (x86_64 vs x86)

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

Current Time: Fri Oct 10 12:22:12 PDT 2025

Total time taken to generate the page: 0.88120 seconds