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

Home » Public Forums » archive » Re: OVERLAYING IMAGES
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
Re: OVERLAYING IMAGES [message #24692] Tue, 17 April 2001 12:48
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
The point of my post was that you can't do it "directly" in direct graphics.
You have to either manipulate your data to fake a sort of transparency or
you have to use object graphics to display the output.

Your best bet is to look into David Fanning's example program "Image_Blend"
found near the bottom of this page:
http://www.dfanning.com/documents/programs.html

90% of the code you need would be in there. Then, with my pointers, you
should be able to quickly code the rest. His code is top notch. Easy to
read, and well commented.

Good Luck!

-Rick



"Mark Chan" <chanm@cadvision.com> wrote in message
news:9b7ksn$c9$1@news3.cadvision.com...
> Rick,
>
> I have been avoiding object graphic so far.
>
> I am interested in the real way, not the fake way.
>
> Will you, or know where I can find some direct graphic example code of
this
> nature?
>
> Thanks,
> Mark Chan
>
> "Rick Towler" <rtowler@u.washington.edu> wrote in message
> news:AQlB6.8137$%o2.664880@news1.sttls1.wa.home.com...
>> If you literally want to control the opacity of your plots (vs. doing
>> something with your data before contouring to fake it) you could try
>> something like this:
>>
>>
>> 1.plot your contour. This could be done in object graphics, or direct.
>>
>>
>> 2.draw the plot to a buffer, read the buffer and you'll get an image
> object.
>> If you plotted with direct graphics you'll read the device you plotted
to
> to
>> get the image data, then create an image object with that data.
>>
>>
>> 3.add a 4th (alpha) channel to the image object like so:
>>
>> image -> GetProperty, data = imagedata
>> imagedims = size(imagedata)
>> newimage=make_array(imagedims[1]+1,imagedims[2],imagedims[3] , $
>> /byte, /nozero)
>> newimage[0:2,*,*] = imagedata
>> newimage[3,*,*] = 255 (see note below)
>> image -> SetProperty, data = newimage
>>
>> the value you set the alpha channel to will determine the opacity.
Your
>> range is 0 (completely translucent) to 255 (opaque).
>>
>>
>> 4.repeat 1-3 for the second plot.
>>
>>
>> 5.create two idlgrpolygon objects, one on top of the other, and texture
> map
>> your images on them.
>>
>>
>> 6.by changing the alpha value of your image objects you can fade them in
> and
>> out.
>>
>>
>> If you are familiar with object graphics and have played around with the
>> polygon object and have done some texturing then this is fairly easy.
If
>> not, plan to spend some time with the documentation. Everything is
there,
>> you'll just have to experiment a little. Then encourage David to write
> this
>> Object Graphics book he has been threatening to write. Speaking of
David,
> I
>> think he has a program demonstrating this alpha channel stuff on his web
>> site. I would check that out. It may even be a drop in solution.
>>
>> -Rick Towler
>>
>>
>>
>> "Mark Chan" <chanm@cadvision.com> wrote in message
>> news:9b38m8$f0f$1@news3.cadvision.com...
>>> 1) plot some contour, using contour fill
>>>
>>> 2) oplot it with a different contour fill
>>>
>>> You get: only (2) appears (the other has been covered).
>>>
>>> Is there a way to make (2) translucent so that one can see both images
> at
>>> the same time?
>>>
>>> Thanks,
>>> Mark
>>>
>>>
>>
>>
>
>
Re: OVERLAYING IMAGES [message #24723 is a reply to message #24692] Fri, 13 April 2001 12:46 Go to previous message
Mark Chan is currently offline  Mark Chan
Messages: 24
Registered: November 2000
Junior Member
Rick,

I have been avoiding object graphic so far.

I am interested in the real way, not the fake way.

Will you, or know where I can find some direct graphic example code of this
nature?

Thanks,
Mark Chan

"Rick Towler" <rtowler@u.washington.edu> wrote in message
news:AQlB6.8137$%o2.664880@news1.sttls1.wa.home.com...
> If you literally want to control the opacity of your plots (vs. doing
> something with your data before contouring to fake it) you could try
> something like this:
>
>
> 1.plot your contour. This could be done in object graphics, or direct.
>
>
> 2.draw the plot to a buffer, read the buffer and you'll get an image
object.
> If you plotted with direct graphics you'll read the device you plotted to
to
> get the image data, then create an image object with that data.
>
>
> 3.add a 4th (alpha) channel to the image object like so:
>
> image -> GetProperty, data = imagedata
> imagedims = size(imagedata)
> newimage=make_array(imagedims[1]+1,imagedims[2],imagedims[3] , $
> /byte, /nozero)
> newimage[0:2,*,*] = imagedata
> newimage[3,*,*] = 255 (see note below)
> image -> SetProperty, data = newimage
>
> the value you set the alpha channel to will determine the opacity. Your
> range is 0 (completely translucent) to 255 (opaque).
>
>
> 4.repeat 1-3 for the second plot.
>
>
> 5.create two idlgrpolygon objects, one on top of the other, and texture
map
> your images on them.
>
>
> 6.by changing the alpha value of your image objects you can fade them in
and
> out.
>
>
> If you are familiar with object graphics and have played around with the
> polygon object and have done some texturing then this is fairly easy. If
> not, plan to spend some time with the documentation. Everything is there,
> you'll just have to experiment a little. Then encourage David to write
this
> Object Graphics book he has been threatening to write. Speaking of David,
I
> think he has a program demonstrating this alpha channel stuff on his web
> site. I would check that out. It may even be a drop in solution.
>
> -Rick Towler
>
>
>
> "Mark Chan" <chanm@cadvision.com> wrote in message
> news:9b38m8$f0f$1@news3.cadvision.com...
>> 1) plot some contour, using contour fill
>>
>> 2) oplot it with a different contour fill
>>
>> You get: only (2) appears (the other has been covered).
>>
>> Is there a way to make (2) translucent so that one can see both images
at
>> the same time?
>>
>> Thanks,
>> Mark
>>
>>
>
>
Re: OVERLAYING IMAGES [message #24749 is a reply to message #24723] Thu, 12 April 2001 10:45 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
If you literally want to control the opacity of your plots (vs. doing
something with your data before contouring to fake it) you could try
something like this:


1.plot your contour. This could be done in object graphics, or direct.


2.draw the plot to a buffer, read the buffer and you'll get an image object.
If you plotted with direct graphics you'll read the device you plotted to to
get the image data, then create an image object with that data.


3.add a 4th (alpha) channel to the image object like so:

image -> GetProperty, data = imagedata
imagedims = size(imagedata)
newimage=make_array(imagedims[1]+1,imagedims[2],imagedims[3] , $
/byte, /nozero)
newimage[0:2,*,*] = imagedata
newimage[3,*,*] = 255 (see note below)
image -> SetProperty, data = newimage

the value you set the alpha channel to will determine the opacity. Your
range is 0 (completely translucent) to 255 (opaque).


4.repeat 1-3 for the second plot.


5.create two idlgrpolygon objects, one on top of the other, and texture map
your images on them.


6.by changing the alpha value of your image objects you can fade them in and
out.


If you are familiar with object graphics and have played around with the
polygon object and have done some texturing then this is fairly easy. If
not, plan to spend some time with the documentation. Everything is there,
you'll just have to experiment a little. Then encourage David to write this
Object Graphics book he has been threatening to write. Speaking of David, I
think he has a program demonstrating this alpha channel stuff on his web
site. I would check that out. It may even be a drop in solution.

-Rick Towler



"Mark Chan" <chanm@cadvision.com> wrote in message
news:9b38m8$f0f$1@news3.cadvision.com...
> 1) plot some contour, using contour fill
>
> 2) oplot it with a different contour fill
>
> You get: only (2) appears (the other has been covered).
>
> Is there a way to make (2) translucent so that one can see both images at
> the same time?
>
> Thanks,
> Mark
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: search for linux programs
Next Topic: Re: something like perl's 'require 5.4'

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

Current Time: Thu Oct 09 10:07:43 PDT 2025

Total time taken to generate the page: 1.68163 seconds