The New Filter architecture

Implementing a New-Style Filter

Tips

Porting Old-style Filters

  1. Code the new filter as a class derived from ptFilterBase.
  2. Create a new FUID entry in ptFilterUids.h. Order there is only for readability. Actually FUIDs for most of the filters are already there. In that case you only need to remove the “not yet ported” comment.
  3. Add the new filter to CreateAllFilters() in ptMain starting around line 300. Order there is only for readability.
  4. ptSettings
    • Remove old config lines from the lists in the constructor.
    • Remove the filter’s if branch(es) from ToolInfo().
    • Check ToolAlwaysVisible() for the old name and remove.
  5. ptFilterDM: Enter the new config item IDs to FillNameMap(). The old names are probably there already and are commented out.
  6. ptMain: Remove old callbacks (CB_old-config-name() functions) and dispatcher macros in CB_InputChanged().
  7. ptMainWindow: If the old filter has buttons look for and remove M_ConnectSomeButton macros and associated callbacks. Also check for other non-standard widgets and their backend code.
  8. ptMainWindow.ui
    • Find the old filter’s toolbox and delete all the widgets inside it (including the stretcher and top-level widget. Only the toolbox header must remain).
    • Change the toolbox caption (currentItemText) to the FUID and untick the translatable checkbox.
  9. ptProcessor::Run(): Change the call to the old filter to the new one, like this:
    hFilter = GFilterDM->GetFilterFromName(Fuid::NEWFILTERNAME);
    if (hFilter->isActive()) {
      m_ReportProgress(hFilter->caption());
      hFilter->runFilter(m_Image_AfterSOMETHING);
    }
    • Beware the Camera and Output tabs! Those are special cases.