Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef CHANGECOLORFX_H
Toshihiro Shimizu 890ddd
#define CHANGECOLORFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class ChangeColorFx : public TStandardRasterFx {
Shinya Kitaoka 120a6e
  FX_PLUGIN_DECLARATION(ChangeColorFx)
Shinya Kitaoka 120a6e
  TRasterFxPort m_input;
Shinya Kitaoka 120a6e
  TPixelParamP m_from_color;
Shinya Kitaoka 120a6e
  TPixelParamP m_to_color;
Shinya Kitaoka 120a6e
  TDoubleParamP m_range;
Shinya Kitaoka 120a6e
  TDoubleParamP m_falloff;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  ChangeColorFx()
Shinya Kitaoka 120a6e
      : m_from_color(TPixel32::Red)
Shinya Kitaoka 120a6e
      , m_to_color(TPixel32::Blue)
Shinya Kitaoka 120a6e
      , m_range(0.0)
Shinya Kitaoka 120a6e
      , m_falloff(0.0) {
Shinya Kitaoka 120a6e
    addPort("Source", m_input);
Shinya Kitaoka 120a6e
    addParam("range", m_range);
Shinya Kitaoka 120a6e
    addParam("falloff", m_falloff);
Shinya Kitaoka 120a6e
    addParam("from_color", m_from_color);
Shinya Kitaoka 120a6e
    addParam("to_color", m_to_color);
Shinya Kitaoka 120a6e
    m_range->setValueRange(0, 1);
Shinya Kitaoka 120a6e
    m_falloff->setValueRange(0, 1);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  ~ChangeColorFx(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool getBBox(double frame, TRectD &bBox, TPixel32 &bgColor) {
Shinya Kitaoka 120a6e
    return m_input->getBBox(frame, bBox, bgColor);
Shinya Kitaoka 120a6e
  };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void compute(TTile &tile, double frame, const TRasterFxRenderInfo *ri);
Shinya Kitaoka 120a6e
  TRect getInvalidRect(const TRect &max);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
#endif