Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TEXTERNFX_H
Toshihiro Shimizu 890ddd
#define TEXTERNFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tbasefx.h"
Toshihiro Shimizu 890ddd
#include "trasterfx.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TFX_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
class DVAPI TExternFx : public TBaseRasterFx
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TExternFx()
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		setName(L"ExternFx");
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	static TExternFx *create(string name);
Toshihiro Shimizu 890ddd
	void getNames(vector<string> &names);</string>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//---------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TExternalProgramFx : public TExternFx
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	FX_DECLARATION(TExternalProgramFx)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	class Port
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
	public:
Toshihiro Shimizu 890ddd
		string m_name;
Toshihiro Shimizu 890ddd
		TRasterFxPort *m_port; // n.b. la porta di output ha m_port=0
Toshihiro Shimizu 890ddd
		string m_ext;		   // estensione del file in cui si legge/scrive l'immagine
Toshihiro Shimizu 890ddd
		Port()
Toshihiro Shimizu 890ddd
			: m_name(), m_port(0), m_ext() {}
Toshihiro Shimizu 890ddd
		Port(string name, string ext, TRasterFxPort *port)
Toshihiro Shimizu 890ddd
			: m_name(name), m_port(port), m_ext(ext) {}
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	std::map<string, port=""> m_ports;</string,>
Toshihiro Shimizu 890ddd
	// std::map<string, tparamp=""> m_params;</string,>
Toshihiro Shimizu 890ddd
	std::vector<tparamp> m_params;</tparamp>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TFilePath m_executablePath;
Toshihiro Shimizu 890ddd
	string m_args;
Toshihiro Shimizu 890ddd
	string m_externFxName;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TExternalProgramFx(string name);
Toshihiro Shimizu 890ddd
	TExternalProgramFx();
Toshihiro Shimizu 890ddd
	~TExternalProgramFx();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void initialize(string name);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual TFx *clone(bool recursive = true) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info);
Toshihiro Shimizu 890ddd
	void doCompute(TTile &tile, double frame, const TRenderSettings &ri);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool canHandle(const TRenderSettings &info, double frame) { return false; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setExecutable(TFilePath fp, string args)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		m_executablePath = fp;
Toshihiro Shimizu 890ddd
		m_args = args;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void addPort(string portName, string ext, bool isInput);
Toshihiro Shimizu 890ddd
	// void addParam(string paramName, const TParamP ¶m);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TIStream &is);
Toshihiro Shimizu 890ddd
	void saveData(TOStream &os);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setExternFxName(string name) { m_externFxName = name; }
Toshihiro Shimizu 890ddd
	string getExternFxName() const { return m_externFxName; };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	// not implemented
Toshihiro Shimizu 890ddd
	TExternalProgramFx(const TExternalProgramFx &);
Toshihiro Shimizu 890ddd
	TExternalProgramFx &operator=(const TExternalProgramFx &);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif