Jeremy Bullock 3f9880
#include "texception.h"
Jeremy Bullock 3f9880
#include "tfxparam.h"
Jeremy Bullock 3f9880
#include "trop.h"
Jeremy Bullock 3f9880
#include "stdfx.h"
Jeremy Bullock 3f9880
#include "trasterfx.h"
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
//-------------------------------------------------------------------
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
class NothingFx final : public TStandardRasterFx {
Jeremy Bullock 3f9880
  FX_PLUGIN_DECLARATION(NothingFx)
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  TRasterFxPort m_input;
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
public:
Jeremy Bullock 3f9880
  NothingFx() {
Jeremy Bullock 3f9880
    addInputPort("Source", m_input);
Jeremy Bullock 3f9880
  }
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  ~NothingFx(){};
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  bool doGetBBox(double frame, TRectD &bBox,
Jeremy Bullock 3f9880
                 const TRenderSettings &info) override {
Jeremy Bullock 3f9880
    if (m_input.isConnected()) {
Jeremy Bullock 3f9880
      bool ret = m_input->doGetBBox(frame, bBox, info);
Jeremy Bullock 3f9880
      return ret;
Jeremy Bullock 3f9880
    } else {
Jeremy Bullock 3f9880
      bBox = TRectD();
Jeremy Bullock 3f9880
      return false;
Jeremy Bullock 3f9880
    }
Jeremy Bullock 3f9880
  }
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  void transform(double frame, int port, const TRectD &rectOnOutput,
Jeremy Bullock 3f9880
                 const TRenderSettings &infoOnOutput, TRectD &rectOnInput,
Jeremy Bullock 3f9880
                 TRenderSettings &infoOnInput) override;
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  void doCompute(TTile &tile, double frame, const TRenderSettings &) override;
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  int getMemoryRequirement(const TRectD &rect, double frame,
Jeremy Bullock 3f9880
                           const TRenderSettings &info) override;
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
  bool canHandle(const TRenderSettings &info, double frame) override {
Jeremy Bullock 3f9880
	  return true;
Jeremy Bullock 3f9880
  }
Jeremy Bullock 3f9880
};
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
FX_PLUGIN_IDENTIFIER(NothingFx, "nothingFx")
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
//-------------------------------------------------------------------
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
void NothingFx::transform(double frame, int port, const TRectD &rectOnOutput,
Jeremy Bullock 3f9880
                       const TRenderSettings &infoOnOutput, TRectD &rectOnInput,
Jeremy Bullock 3f9880
                       TRenderSettings &infoOnInput) {
Jeremy Bullock 3f9880
  infoOnInput = infoOnOutput;
Jeremy Bullock 3f9880
  rectOnInput = rectOnOutput;
Jeremy Bullock 3f9880
  return;
Jeremy Bullock 3f9880
}
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
//-------------------------------------------------------------------
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
int NothingFx::getMemoryRequirement(const TRectD &rect, double frame,
Jeremy Bullock 3f9880
                                 const TRenderSettings &info) {
Jeremy Bullock 3f9880
	return 0;
Jeremy Bullock 3f9880
}
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
//-------------------------------------------------------------------
Jeremy Bullock 3f9880
Jeremy Bullock 3f9880
void NothingFx::doCompute(TTile &tile, double frame,
Jeremy Bullock 3f9880
                       const TRenderSettings &renderSettings) {
Jeremy Bullock 3f9880
  if (!m_input.isConnected()) return;
Jeremy Bullock 3f9880
  m_input->compute(tile, frame, renderSettings);
Jeremy Bullock 3f9880
}