|
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 |
120a6e |
class DVAPI TSpectrumParam : 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 |
120a6e |
TParam *clone() const { return new TSpectrumParam(*this); }
|
|
Shinya Kitaoka |
120a6e |
void copy(TParam *src);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void addObserver(TParamObserver *);
|
|
Shinya Kitaoka |
120a6e |
void removeObserver(TParamObserver *);
|
|
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 |
120a6e |
bool isAnimatable() const { return true; }
|
|
Shinya Kitaoka |
120a6e |
bool isKeyframe(double frame) const;
|
|
Shinya Kitaoka |
120a6e |
void deleteKeyframe(double frame);
|
|
Shinya Kitaoka |
120a6e |
void clearKeyframes();
|
|
Shinya Kitaoka |
120a6e |
void assignKeyframe(double frame, const TSmartPointerT<tparam> &src,</tparam>
|
|
Shinya Kitaoka |
120a6e |
double srcFrame, bool changedOnly = false);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void loadData(TIStream &is);
|
|
Shinya Kitaoka |
120a6e |
void saveData(TOStream &os);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void enableDragging(bool on);
|
|
Shinya Kitaoka |
120a6e |
void enableNotification(bool on);
|
|
Shinya Kitaoka |
120a6e |
bool isNotificationEnabled() const;
|
|
Shinya Kitaoka |
120a6e |
void enableMatte(bool on);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool isMatteEnabled() const;
|
|
Shinya Kitaoka |
120a6e |
std::string getValueAlias(double frame, int precision);
|
|
Shinya Kitaoka |
120a6e |
bool hasKeyframes() const;
|
|
Shinya Kitaoka |
120a6e |
void getKeyframes(std::set<double> &frames) const;</double>
|
|
Shinya Kitaoka |
120a6e |
int getNextKeyframe(double frame) const;
|
|
Shinya Kitaoka |
120a6e |
int getPrevKeyframe(double frame) const;
|
|
Shinya Kitaoka |
120a6e |
double keyframeIndexToFrame(int index) const;
|
|
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 |
120a6e |
class DVAPI TSpectrumParamP
|
|
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
|