Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef BRIGHTCONTFX_H
Toshihiro Shimizu 890ddd
#define BRIGHTCONTFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class Bright_ContFx : public TStandardRasterFx, public TDoubleParamObserver
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	FX_PLUGIN_DECLARATION(Bright_ContFx)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRasterFxPort m_input;
Toshihiro Shimizu 890ddd
	TDoubleParamP m_bright;
Toshihiro Shimizu 890ddd
	TDoubleParamP m_contrast;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	Bright_ContFx()
Toshihiro Shimizu 890ddd
		: m_bright(127.5), m_contrast(50.0)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		addParam("brightness", m_bright);
Toshihiro Shimizu 890ddd
		addParam("contrast", m_contrast);
Toshihiro Shimizu 890ddd
		m_bright->setValueRange(0, 255);
Toshihiro Shimizu 890ddd
		m_contrast->setValueRange(0, 100);
Toshihiro Shimizu 890ddd
		addPort("Source", m_input);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	~Bright_ContFx(){};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//TParamObserver method
Toshihiro Shimizu 890ddd
	void onChange(const TParamChange &change)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		notify(TFxParamChange(change));
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool getBBox(double frame, TRectD &bBox, TPixel32 &bgColor)
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		return m_input->getBBox(frame, bBox, bgColor);
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void compute(TTile &tile, double frame, const TRasterFxRenderInfo *);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRect getInvalidRect(const TRect &max);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
#endif