Toshihiro Shimizu 890ddd
/*------------------------------------------------
Toshihiro Shimizu 890ddd
  Iwa_AdjustExposureFx
Toshihiro Shimizu 890ddd
  明るさを露光値で調整するエフェクト
Toshihiro Shimizu 890ddd
------------------------------------------------*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef ADJUST_EXPOSURE_H
Toshihiro Shimizu 890ddd
#define ADJUST_EXPOSURE_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
#include "tfxparam.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
struct float4 {
Toshihiro Shimizu 890ddd
	float x, y, z, w;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class Iwa_AdjustExposureFx : public TStandardRasterFx
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	FX_PLUGIN_DECLARATION(Iwa_AdjustExposureFx)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	TRasterFxPort m_source;
Toshihiro Shimizu 890ddd
	TDoubleParamP m_hardness; /*- フィルムのガンマ値 -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP m_scale;	/*- 明るさのスケール値 -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP m_offset;   /*- 明るさのオフセット値 -*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*- タイルの画像を0〜1に正規化してホストメモリに読み込む -*/
Toshihiro Shimizu 890ddd
	template <typename pixel="" raster,="" typename=""></typename>
Toshihiro Shimizu 890ddd
	void setSourceRaster(const RASTER srcRas,
Toshihiro Shimizu 890ddd
						 float4 *dstMem,
Toshihiro Shimizu 890ddd
						 TDimensionI dim);
Toshihiro Shimizu 890ddd
	/*- 出力結果をChannel値に変換して格納 -*/
Toshihiro Shimizu 890ddd
	template <typename pixel="" raster,="" typename=""></typename>
Toshihiro Shimizu 890ddd
	void setOutputRaster(float4 *srcMem,
Toshihiro Shimizu 890ddd
						 const RASTER dstRas,
Toshihiro Shimizu 890ddd
						 TDimensionI dim);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	Iwa_AdjustExposureFx();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void doCompute(TTile &tile,
Toshihiro Shimizu 890ddd
				   double frame,
Toshihiro Shimizu 890ddd
				   const TRenderSettings &settings);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void doCompute_CPU(TTile &tile,
Toshihiro Shimizu 890ddd
					   double frame,
Toshihiro Shimizu 890ddd
					   const TRenderSettings &settings,
Toshihiro Shimizu 890ddd
					   TDimensionI &dim,
Toshihiro Shimizu 890ddd
					   float4 *tile_host);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool doGetBBox(double frame,
Toshihiro Shimizu 890ddd
				   TRectD &bBox,
Toshihiro Shimizu 890ddd
				   const TRenderSettings &info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool canHandle(const TRenderSettings &info,
Toshihiro Shimizu 890ddd
				   double frame);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif