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

Home » Public Forums » archive » Re: Question about using palettes with images and shader in object graphics
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: Question about using palettes with images and shader in object graphics [message #83272] Tue, 12 February 2013 12:13
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
M. Katz writes:

>
> Here I'll answer my own question definitively from the IDL Help on IDLgrImage (See the last line):
>
> PALETTE
> An object reference to a palette object (an instance of the IDLgrPalette object class) that specifies the red, green, and blue values of the color lookup table to be associated with the image if it is an indexed color image. This property is ignored if the image is a greyscale or RGB image.
>
> Note: This table is only used when the destination is an RGB model device. The Indexed color model writes the indices directly to the device. In order to ensure that these colors are used when the image is displayed, this palette must be copied to the graphics destination’s palette for any graphics destination that uses the Indexed color model.
>
> Note: If a SHADER is associated with the image object, the palette is ignored.

This seems to conflict with this statement, in the same documentation:

Note: If a PALETTE has been set, the palette lookup is done before the
fragment shader is executed. Therefore, when the fragment shader reads
from the image texture it will be passed 8-bit per channel RGB data
(read from the palette), not the original 1-channel image data.

Go figure. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Question about using palettes with images and shader in object graphics [message #83273 is a reply to message #83272] Tue, 12 February 2013 12:05 Go to previous message
M. Katz is currently offline  M. Katz
Messages: 69
Registered: May 2005
Member
Here I'll answer my own question definitively from the IDL Help on IDLgrImage (See the last line):

PALETTE
An object reference to a palette object (an instance of the IDLgrPalette object class) that specifies the red, green, and blue values of the color lookup table to be associated with the image if it is an indexed color image. This property is ignored if the image is a greyscale or RGB image.

Note: This table is only used when the destination is an RGB model device. The Indexed color model writes the indices directly to the device. In order to ensure that these colors are used when the image is displayed, this palette must be copied to the graphics destination’s palette for any graphics destination that uses the Indexed color model.

Note: If a SHADER is associated with the image object, the palette is ignored.
Re: Question about using palettes with images and shader in object graphics [message #83277 is a reply to message #83273] Tue, 12 February 2013 10:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
M. Katz writes:

> When displaying an IDLgrImage with an associated IDLgrShader, is the IDLgrPalette functionality disabled?
>
> Without the shader, you can use oImage.SetProperty, PALETTE=oPalette to change the display's color scheme in an instant.
>
> But with IDLgrShader, I'm fearing that it's a much more difficult task that will require writing code in shader language, which I've never attempted before.
>
> Any thoughts?

Never done it, but just reading the documentation, I would expect you to
also have to replace the shader object after changing the palette, to
get the shader to use the palette.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL sites
Next Topic: IDL sites on WWW

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

Current Time: Wed Oct 08 17:11:33 PDT 2025

Total time taken to generate the page: 0.00549 seconds