Author Topic: PCL: creating new pixels out of existing ones  (Read 12814 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
PCL: creating new pixels out of existing ones
« Reply #15 on: 2009 April 23 07:51:23 »
Hi,

I implemented the 4 different RGGB combinations and now I can choose GBRG to debayer a GRGB image loaded using the default FITS settings. After flipping the result it looks the same as when I first flip the raw image and then apply GRGB.

Once I make that setting persistent (it's unlikely to change for a user after all) and figure out how to prevent the Debayer process from being added to the source image's history it can be tried by other folks.

Thanks for the help! I'm glad I finally sat down to do this.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
PCL: creating new pixels out of existing ones
« Reply #16 on: 2009 April 27 01:10:33 »
Hi Sander,

Congratulations on your first PixInsight module! Now I hope this is just the beginning of a beautiful friendship between you and PCL :D

Quote
Once I make that setting persistent (it's unlikely to change for a user after all) and figure out how to prevent the Debayer process from being added to the source image's history it can be tried by other folks.


As for the settings, have a look at the pcl/Settings.h standard header. Everything you need to get persistent settings for your module is in the Settings class.

Your process doesn't change its target image. You should add, if you haven't done so already, the following declaration/definition to your instance class (which is a descendent of ProcessImplementation):

Code: [Select]
bool IsHistoryUpdater( const View& ) const
{
   return false;
}


In this way PI knows that your process doesn't modify a target view in its ExecuteOn() member function, and hence your process won't get added to the target view's processing history.

After adding the declaration above, your ExecuteOn() function should no longer lock views for read/write, since doing that can be interpreted as a hacking attempt. You must only lock views for writing:

Code: [Select]
view.LockForWrite();

instead of view.Lock(). Of course, you still have to call view.Unlock() to make sure that your routine will *never* leave a view locked.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
PCL: creating new pixels out of existing ones
« Reply #17 on: 2009 April 27 05:48:29 »
Great, thanks for those pointers Juan!
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
PCL: creating new pixels out of existing ones
« Reply #18 on: 2009 April 27 14:59:45 »
Actually I had settings working already as described when I published my module. The history modifier thing works great, thanks.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity