Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
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 {
Shinya Kitaoka 120a6e
  float x, y, z, w;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class Iwa_AdjustExposureFx : public TStandardRasterFx {
Shinya Kitaoka 120a6e
  FX_PLUGIN_DECLARATION(Iwa_AdjustExposureFx)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  TRasterFxPort m_source;
Shinya Kitaoka 120a6e
  TDoubleParamP m_hardness; /*- フィルムのガンマ値 -*/
Shinya Kitaoka 120a6e
  TDoubleParamP m_scale;    /*- 明るさのスケール値 -*/
Shinya Kitaoka 120a6e
  TDoubleParamP m_offset;   /*- 明るさのオフセット値 -*/
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*- タイルの画像を0〜1に正規化してホストメモリに読み込む -*/
Shinya Kitaoka 120a6e
  template <typename pixel="" raster,="" typename=""></typename>
Shinya Kitaoka 120a6e
  void setSourceRaster(const RASTER srcRas, float4 *dstMem, TDimensionI dim);
Shinya Kitaoka 120a6e
  /*- 出力結果をChannel値に変換して格納 -*/
Shinya Kitaoka 120a6e
  template <typename pixel="" raster,="" typename=""></typename>
Shinya Kitaoka 120a6e
  void setOutputRaster(float4 *srcMem, const RASTER dstRas, TDimensionI dim);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  Iwa_AdjustExposureFx();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void doCompute(TTile &tile, double frame, const TRenderSettings &settings) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void doCompute_CPU(TTile &tile, double frame, const TRenderSettings &settings,
Shinya Kitaoka 120a6e
                     TDimensionI &dim, float4 *tile_host);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  bool canHandle(const TRenderSettings &info, double frame) override;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif