Manually modifing same as TPaletteEditor

I was wondering if it is possible to - easly - modify TASImage display from the script/command line as with the TPaletteEditor. I know I can modify palette itself, but it would be much more convenient to invoke specific TPaletteEditor functions, like setting palette histogram boundaries, changing number of ramps, changing palette to logarithmic, etc. Are there any functions that I can call to do that?

If not, perhaps they could be added? It seems like everything is there, only need to provide a public function of some sort :slight_smile:

I think this class was meant to be more like an application. The methods you are talking about are protected. See:

Yes, I understand. But perhaps it would be good to add such methods public to TPalette?

Do you install ROOT from the sources ?
In that case can you tried to make them public in your own version of root and see if that does help you ?

Yes, I did install from sources. I’ll try to do that.

It works nice, and amazingly it works in PyRoot out of the box. However, for release it would require some additional public method.

Except making protected methods public, I had to make TASPaletteEditor::fPalette public, for I cannot see any other way to invoke same behaviour as Apply button (no method to call Apply) than to call TASImage::SetPalette(TASPaletteEditor:fPalette). Also, I have not yet figured how to set histogram “blue” lines of the editor.

Would it be possible for you to simply make TASPaletteEditor methods public and add method to either call Apply or GetPalette() returning fPalette? This would make a first, huge step towards easy palette editing and it seems like 5 minutes of work :slight_smile:

Later, it would be nice not to have to really open TASPaletteEditor window on the screen to operate on it and to have some methods to move the blue lines…

Anyhow, thanks very much for the idea and solution.

As you have almost done the work can you provide me the patch doing that ?

OK, I’ll try to add those methods I mentioned and make rest public and provide you with the patch after the weekend.

Thanks ! That way we will be sure it’ll meet your need.