Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#ifndef TSPECTRUMPARAM_H
Toshihiro Shimizu 890ddd
#define TSPECTRUMPARAM_H
Toshihiro Shimizu 890ddd
Shinya Kitaoka 262a92
#include <memory></memory>
Shinya Kitaoka 262a92
Toshihiro Shimizu 890ddd
#include "tspectrum.h"
Toshihiro Shimizu 890ddd
#include "tparamset.h"
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
Toshihiro Shimizu 890ddd
//    Forward declaration
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TParamSet;
Toshihiro Shimizu 890ddd
class TSpectrumParamImp;
Toshihiro Shimizu 890ddd
class TPixelParamP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
class TSpectrumParam;
Toshihiro Shimizu 890ddd
template class DVAPI TPersistDeclarationT<tspectrumparam>;</tspectrumparam>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TSpectrumParam final : public TParam {
Shinya Kitaoka 120a6e
  PERSIST_DECLARATION(TSpectrumParam)
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  std::unique_ptr<tspectrumparamimp> m_imp;</tspectrumparamimp>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSpectrumParam();
Shinya Kitaoka 120a6e
  TSpectrumParam(int keyCount, TSpectrum::ColorKey keys[]);
Shinya Kitaoka 120a6e
  TSpectrumParam(const TSpectrumParam &);
Shinya Kitaoka 120a6e
  ~TSpectrumParam();
Shinya Kitaoka 120a6e
Shinya Kitaoka 473e70
  TParam *clone() const override { return new TSpectrumParam(*this); }
Shinya Kitaoka 473e70
  void copy(TParam *src) override;
Shinya Kitaoka 120a6e
Shinya Kitaoka 473e70
  void addObserver(TParamObserver *) override;
Shinya Kitaoka 473e70
  void removeObserver(TParamObserver *) override;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TSpectrum getValue(double frame) const;
Shinya Kitaoka 120a6e
  TSpectrum64 getValue64(double frame) const;
Shinya Kitaoka 120a6e
  void setValue(double frame, const TSpectrum &value, bool undoing = false);
Shinya Kitaoka 120a6e
  void setDefaultValue(const TSpectrum &value);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  int getKeyCount() const;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TDoubleParamP getPosition(int index) const;
Shinya Kitaoka 120a6e
  TPixelParamP getColor(int index) const;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void setValue(double frame, int index, double s, const TPixel32 &color,
Shinya Kitaoka 120a6e
                bool undoing = false);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void insertKey(int index, double s, const TPixel32 &color);
Shinya Kitaoka 120a6e
  void addKey(double s, const TPixel32 &color);
Shinya Kitaoka 120a6e
  void removeKey(int index);
Shinya Kitaoka 120a6e
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;
Shinya Kitaoka 120a6e
Shinya Kitaoka 473e70
  void loadData(TIStream &is) override;
Shinya Kitaoka 473e70
  void saveData(TOStream &os) override;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void enableDragging(bool on);
Shinya Kitaoka 473e70
  void enableNotification(bool on) override;
Shinya Kitaoka 473e70
  bool isNotificationEnabled() const override;
Shinya Kitaoka 120a6e
  void enableMatte(bool on);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  bool isMatteEnabled() const;
Shinya Kitaoka 473e70
  std::string getValueAlias(double frame, int precision) override;
Shinya Kitaoka 473e70
  bool hasKeyframes() const override;
Shinya Kitaoka 473e70
  void getKeyframes(std::set<double> &frames) const override;</double>
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
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
template class DVAPI TSmartPointerT<tspectrumparam>;</tspectrumparam>
Toshihiro Shimizu 890ddd
template class DVAPI TDerivedSmartPointerT<tspectrumparam, tparam="">;</tspectrumparam,>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TSpectrumParamP final
Shinya Kitaoka 120a6e
    : public TDerivedSmartPointerT<tspectrumparam, tparam=""> {</tspectrumparam,>
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSpectrumParamP() {}
Shinya Kitaoka 120a6e
  TSpectrumParamP(int keyCount, TSpectrum::ColorKey keys[])
Shinya Kitaoka 120a6e
      : TDerivedSmartPointerT<tspectrumparam, tparam="">(</tspectrumparam,>
Shinya Kitaoka 120a6e
            new TSpectrumParam(keyCount, keys)) {}
Shinya Kitaoka 120a6e
  TSpectrumParamP(TSpectrumParam *p)
Shinya Kitaoka 120a6e
      : TDerivedSmartPointerT<tspectrumparam, tparam="">(p) {}</tspectrumparam,>
Shinya Kitaoka 120a6e
  TSpectrumParamP(const TParamP &p)
Shinya Kitaoka 120a6e
      : TDerivedSmartPointerT<tspectrumparam, tparam="">(p) {}</tspectrumparam,>
Shinya Kitaoka 120a6e
  operator TParamP() const { return TParamP(m_pointer); }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI TIStream &operator>>(TIStream &in, TSpectrumParamP &p);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif