Author Topic: PCL: STF in RTP  (Read 4472 times)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
PCL: STF in RTP
« on: 2012 February 18 02:27:47 »
Hi,
For example: I want show in RTP inverted image. Of course, I must show inverted image with Inverted STF.

I can Invert STF and then apply it to parent View via the code :
Code: [Select]
// note: static String viewId = RTP view.FullId() set in RequiresRealTimePreviewUpdate
View view = View::ViewById( viewId );
View::stf_container stf;
view.GetScreenTransferFunctions( stf );
for ( int c = 0; c < 4; ++c )
{
float c0 = stf[c]->ShadowsClipping();
float c1 = stf[c]->HighlightsClipping();
float m = stf[c]->MidtonesBalance();

stf[c]->SetClipping( 1 - c1 , 1 - c0 );
stf[c]->SetMidtonesBalance( 1 - m );
}
view.SetScreenTransferFunctions( stf );
That code change parent View STF and RTP STF together.

Question: How to apply STF only to RTP view? Is it possible?

Best regards,
Nikolay.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PCL: STF in RTP
« Reply #1 on: 2012 February 19 03:10:06 »
Hi Nikolay,

Your code is correct. Indeed, histogram transformations are fully invertible in PixInsight (and this is one of it's strong points BTW).

No, there's no way to set RTP's STF independently. RTP always follows the image it is representing. One possible solution would be to duplicate the image and force RTP to use it temporarily, but this is probably too expensive. You solution works fine and I see no actual problems with it.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: PCL: STF in RTP
« Reply #2 on: 2012 February 19 06:54:14 »
No, there's no way to set RTP's STF independently. RTP always follows the image it is representing.
Yes, RTP always follows the image it is representing and its mechanism to see result of before applying them to ImageView. So, I don't see problem if allow to see preview all properties of ImageView. Including such properties as STF.

Maybe in future PixInsight version ?