Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TTONECURVEPARAM_H
Toshihiro Shimizu 890ddd
#define TTONECURVEPARAM_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
#include "tparamset.h"
Toshihiro Shimizu 890ddd
#include "tstroke.h"
Toshihiro Shimizu 890ddd
#include "tnotanimatableparam.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qlist></qlist>
Toshihiro Shimizu 890ddd
e280ae
#ifdef _MSC_VER
Toshihiro Shimizu 890ddd
#pragma warning(disable : 4251)
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TPARAM_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TToneCurveParam final : public TParam {
Shinya Kitaoka 120a6e
  PERSIST_DECLARATION(TToneCurveParam)
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TParamSetP m_rgbaParamSet;
Shinya Kitaoka 120a6e
  TParamSetP m_rgbParamSet;
Shinya Kitaoka 120a6e
  TParamSetP m_rParamSet;
Shinya Kitaoka 120a6e
  TParamSetP m_gParamSet;
Shinya Kitaoka 120a6e
  TParamSetP m_bParamSet;
Shinya Kitaoka 120a6e
  TParamSetP m_aParamSet;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TBoolParamP m_isLinear;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  enum ToneChannel { RGBA = 0, RGB, Red, Green, Blue, Alpha } m_toneChannel;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TToneCurveParam();
Shinya Kitaoka 120a6e
  TToneCurveParam(const TToneCurveParam &src);
Shinya Kitaoka 120a6e
  ~TToneCurveParam() {}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TParamSetP getParamSet(ToneChannel channel) const;
Shinya Kitaoka 120a6e
  TParamSetP getCurrentParamSet() const;
Shinya Kitaoka 120a6e
  TBoolParamP getIsLinearParam() const { return m_isLinear; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setCurrentChannel(ToneChannel channel);
Shinya Kitaoka 120a6e
  ToneChannel getCurrentChannel() const { return m_toneChannel; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  TParam *clone() const override { return new TToneCurveParam(*this); }
Shinya Kitaoka 473e70
  void copy(TParam *src) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void addObserver(TParamObserver *) override;
Shinya Kitaoka 473e70
  void removeObserver(TParamObserver *) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QList<tpointd> getValue(double frame) const;</tpointd>
Shinya Kitaoka 120a6e
  void setValue(double frame, const QList<tpointd> &value,</tpointd>
Shinya Kitaoka 120a6e
                bool undoing = false);
Shinya Kitaoka 120a6e
  void setDefaultValue(const QList<tpointd> &value);</tpointd>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool isLinear() const;
Shinya Kitaoka 120a6e
  void setIsLinear(bool isLinear);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void addValue(double frame, const QList<tpointd> &value, int index);</tpointd>
Shinya Kitaoka 120a6e
  void removeValue(double frame, int index);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  //  virtual void enableNotification(bool on) {}
Shinya Kitaoka 120a6e
  //  virtual bool isNotificationEnabled() const { return true;}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  std::string getValueAlias(double frame, int precision) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  bool isAnimatable() const override { return true; };
Shinya Kitaoka 473e70
  bool isKeyframe(double frame) const override;
Shinya Kitaoka 473e70
  void deleteKeyframe(double frame) override;
Shinya Kitaoka 473e70
  void clearKeyframes() override;
Shinya Kitaoka 120a6e
  void assignKeyframe(double frame, const TSmartPointerT<tparam> &src,</tparam>
Shinya Kitaoka 473e70
                      double srcFrame, bool changedOnly = false) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void getKeyframes(std::set<double> &frames) const override;</double>
Shinya Kitaoka 473e70
  bool hasKeyframes() const override;
Shinya Kitaoka 473e70
  int getNextKeyframe(double frame) const override;
Shinya Kitaoka 473e70
  int getPrevKeyframe(double frame) const override;
Shinya Kitaoka 473e70
  double keyframeIndexToFrame(int index) const override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void loadData(TIStream &is) override;
Shinya Kitaoka 473e70
  void saveData(TOStream &os) override;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
template class DVAPI TSmartPointerT<ttonecurveparam>;</ttonecurveparam>
Toshihiro Shimizu 890ddd
template class DVAPI TDerivedSmartPointerT<ttonecurveparam, tparam="">;</ttonecurveparam,>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TToneCurveParamP final
Shinya Kitaoka 120a6e
    : public TDerivedSmartPointerT<ttonecurveparam, tparam=""> {</ttonecurveparam,>
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TToneCurveParamP() {}
Shinya Kitaoka 120a6e
  TToneCurveParamP(TToneCurveParam *p)
Shinya Kitaoka 120a6e
      : TDerivedSmartPointerT<ttonecurveparam, tparam="">(p) {}</ttonecurveparam,>
Shinya Kitaoka 120a6e
  TToneCurveParamP(const TParamP &p)
Shinya Kitaoka 120a6e
      : TDerivedSmartPointerT<ttonecurveparam, tparam="">(p) {}</ttonecurveparam,>
Shinya Kitaoka 120a6e
  operator TParamP() const { return TParamP(m_pointer); }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif