Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#ifndef MOTIONAWAREBASEFX_H
Toshihiro Shimizu 890ddd
#define MOTIONAWAREBASEFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tfxparam.h"
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
#include "tfxattributes.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum MotionObjectType {
Shinya Kitaoka 120a6e
  OBJTYPE_OWN = 0, /*-- 自分自身の動きでぼかす --*/
Shinya Kitaoka 120a6e
  OBJTYPE_COLUMN,
Shinya Kitaoka 120a6e
  OBJTYPE_PEGBAR,
Shinya Kitaoka 120a6e
  OBJTYPE_TABLE,
Shinya Kitaoka 120a6e
  OBJTYPE_CAMERA
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class MotionAwareBaseFx : public TStandardRasterFx {
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  TDoubleParamP
Shinya Kitaoka 120a6e
      m_shutterStart; /*-- 現時点より前のシャッター解放時間 (単位Frame) --*/
Shinya Kitaoka 120a6e
  TDoubleParamP
Shinya Kitaoka 120a6e
      m_shutterEnd; /*-- 現時点より後のシャッター解放時間 (単位Frame) --*/
Shinya Kitaoka 120a6e
  TIntParamP m_traceResolution;
Shinya Kitaoka 120a6e
  /*-- 他のカラム/Pegの動きを参照できるように --*/
Shinya Kitaoka 120a6e
  TIntEnumParamP m_motionObjectType;
Shinya Kitaoka 120a6e
  TIntParamP m_motionObjectIndex;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  MotionAwareBaseFx()
Shinya Kitaoka 120a6e
      : m_shutterStart(0.05)
Shinya Kitaoka 120a6e
      , m_shutterEnd(0.05)
Shinya Kitaoka 120a6e
      , m_traceResolution(4)
Shinya Kitaoka 120a6e
      , m_motionObjectType(new TIntEnumParam(OBJTYPE_OWN, "Own Motion"))
shun-iwasawa f422c9
      , m_motionObjectIndex(1) {
Shinya Kitaoka 120a6e
    m_shutterStart->setValueRange(0.0, 1.0);
Shinya Kitaoka 120a6e
    m_shutterEnd->setValueRange(0.0, 1.0);
Shinya Kitaoka 120a6e
    m_traceResolution->setValueRange(1, 20);
Shinya Kitaoka 120a6e
    m_motionObjectType->addItem(OBJTYPE_COLUMN, "Column");
Shinya Kitaoka 120a6e
    m_motionObjectType->addItem(OBJTYPE_PEGBAR, "Pegbar");
Shinya Kitaoka 120a6e
    m_motionObjectType->addItem(OBJTYPE_TABLE, "Table");
Shinya Kitaoka 120a6e
    m_motionObjectType->addItem(OBJTYPE_CAMERA, "Camera");
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    getAttributes()->setIsSpeedAware(true);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*-- 軌跡情報を得るのに必要なパラメータを取得させる --*/
Shinya Kitaoka 120a6e
  TDoubleParamP getShutterStart() { return m_shutterStart; }
Shinya Kitaoka 120a6e
  TDoubleParamP getShutterEnd() { return m_shutterEnd; }
Shinya Kitaoka 120a6e
  TIntParamP getTraceResolution() { return m_traceResolution; }
Shinya Kitaoka 120a6e
  MotionObjectType getMotionObjectType() {
Shinya Kitaoka 120a6e
    return (MotionObjectType)m_motionObjectType->getValue();
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  TIntParamP getMotionObjectIndex() { return m_motionObjectIndex; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
shun-iwasawa 13c4cf
// flow motion blurで使う
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
class MotionAwareAffineFx : public TStandardZeraryFx {
shun-iwasawa 13c4cf
protected:
shun-iwasawa 13c4cf
  TDoubleParamP m_shutterLength;  // 前後のシャッター解放時間
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  TIntEnumParamP m_motionObjectType;
shun-iwasawa 13c4cf
  TIntParamP m_motionObjectIndex;
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
public:
shun-iwasawa 13c4cf
  MotionAwareAffineFx()
shun-iwasawa 13c4cf
      : m_shutterLength(0.1)
shun-iwasawa 13c4cf
      , m_motionObjectType(new TIntEnumParam(OBJTYPE_OWN, "Own Motion"))
shun-iwasawa 13c4cf
      , m_motionObjectIndex(1) {
shun-iwasawa 13c4cf
    m_shutterLength->setValueRange(0.01, 1.0);
shun-iwasawa 13c4cf
    m_motionObjectType->addItem(OBJTYPE_COLUMN, "Column");
shun-iwasawa 13c4cf
    m_motionObjectType->addItem(OBJTYPE_PEGBAR, "Pegbar");
shun-iwasawa 13c4cf
    m_motionObjectType->addItem(OBJTYPE_TABLE, "Table");
shun-iwasawa 13c4cf
    m_motionObjectType->addItem(OBJTYPE_CAMERA, "Camera");
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
    getAttributes()->setIsSpeedAware(true);
shun-iwasawa 13c4cf
  }
shun-iwasawa 13c4cf
shun-iwasawa 13c4cf
  /*-- 軌跡情報を得るのに必要なパラメータを取得させる --*/
shun-iwasawa 13c4cf
  TDoubleParamP getShutterLength() { return m_shutterLength; }
shun-iwasawa 13c4cf
  MotionObjectType getMotionObjectType() {
shun-iwasawa 13c4cf
    return (MotionObjectType)m_motionObjectType->getValue();
shun-iwasawa 13c4cf
  }
shun-iwasawa 13c4cf
  TIntParamP getMotionObjectIndex() { return m_motionObjectIndex; }
shun-iwasawa 13c4cf
};
shun-iwasawa 13c4cf
Toshihiro Shimizu 890ddd
#endif