shun-iwasawa 13c4cf
#pragma once
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
#ifndef IWA_MOTION_FLOW_FX_H
shun-iwasawa 13c4cf
#define IWA_MOTION_FLOW_FX_H
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
#include "tfxparam.h"
shun-iwasawa 13c4cf
#include "stdfx.h"
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
#include "motionawarebasefx.h"
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
struct double3 {
shun-iwasawa 13c4cf
  double x, y, z;
shun-iwasawa 13c4cf
};
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
class Iwa_MotionFlowFx final : public MotionAwareAffineFx {
shun-iwasawa 13c4cf
  FX_PLUGIN_DECLARATION(Iwa_MotionFlowFx)
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  TIntEnumParamP m_normalizeType;
shun-iwasawa 13c4cf
  TDoubleParamP m_normalizeRange;
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  enum NormalizeType { NORMALIZE_AUTO = 0, NORMALIZE_MANUAL };
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
public:
shun-iwasawa 13c4cf
  Iwa_MotionFlowFx();
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  void doCompute(TTile& tile, double frame,
shun-iwasawa 13c4cf
                 const TRenderSettings& settings) override;
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  template <typename pixel="" raster,="" typename=""></typename>
shun-iwasawa 13c4cf
  void setOutRas(RASTER ras, double3* outBuf, double norm_range);
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  bool doGetBBox(double frame, TRectD& bBox,
shun-iwasawa 13c4cf
                 const TRenderSettings& info) override;
shun-iwasawa 13c4cf
  bool canHandle(const TRenderSettings& info, double frame) override;
shun-iwasawa 13c4cf
  // Since there is a possibility that the reference object is moving,
shun-iwasawa 13c4cf
  // Change the alias every frame
shun-iwasawa 13c4cf
  std::string getAlias(double frame,
shun-iwasawa 13c4cf
                       const TRenderSettings& info) const override;
shun-iwasawa 13c4cf
};
shun-iwasawa 13c4cf
#endif