|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Shinya Kitaoka |
810553 |
|
|
Toshihiro Shimizu |
890ddd |
/*------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
Iwa_DirectionalBlurFx
|
|
Toshihiro Shimizu |
890ddd |
ボケ足の伸ばし方を選択でき、参照画像を追加した DirectionalBlur
|
|
Toshihiro Shimizu |
890ddd |
//------------------------------------*/
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef IWA_DIRECTIONAL_BLUR_H
|
|
Toshihiro Shimizu |
890ddd |
#define IWA_DIRECTIONAL_BLUR_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tfxparam.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "stdfx.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
struct float2 {
|
|
Shinya Kitaoka |
120a6e |
float x, y;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
struct float4 {
|
|
Shinya Kitaoka |
120a6e |
float x, y, z, w;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
struct int2 {
|
|
Shinya Kitaoka |
120a6e |
int x, y;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class Iwa_DirectionalBlurFx final : public TStandardRasterFx {
|
|
Shinya Kitaoka |
120a6e |
FX_PLUGIN_DECLARATION(Iwa_DirectionalBlurFx)
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TRasterFxPort m_input;
|
|
Shinya Kitaoka |
120a6e |
TRasterFxPort m_reference;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TDoubleParamP m_angle;
|
|
Shinya Kitaoka |
120a6e |
TDoubleParamP m_intensity;
|
|
Shinya Kitaoka |
120a6e |
TBoolParamP m_bidirectional;
|
|
Shinya Kitaoka |
120a6e |
/*- リニア/ガウシアン/平均化 -*/
|
|
Shinya Kitaoka |
120a6e |
TIntEnumParamP m_filterType;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*- 参照画像の輝度を0〜1に正規化してホストメモリに読み込む -*/
|
|
Shinya Kitaoka |
120a6e |
template <typename pixel="" raster,="" typename=""></typename>
|
|
Shinya Kitaoka |
120a6e |
void setReferenceRaster(const RASTER srcRas, float *dstMem, TDimensionI dim);
|
|
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 |
|
|
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,
|
|
Shinya Kitaoka |
120a6e |
int2 margin);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void doCompute_CPU(TTile &tile, double frame, const TRenderSettings &settings,
|
|
Shinya Kitaoka |
120a6e |
TPointD &blur, bool bidirectional, int marginLeft,
|
|
Shinya Kitaoka |
120a6e |
int marginRight, int marginTop, int marginBottom,
|
|
Shinya Kitaoka |
120a6e |
TDimensionI &enlargedDimIn, TTile &enlarge_tile,
|
|
Shinya Kitaoka |
120a6e |
TDimensionI &dimOut, TDimensionI &filterDim,
|
|
Shinya Kitaoka |
120a6e |
float *reference_host);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void makeDirectionalBlurFilter_CPU(float *filter, TPointD &blur,
|
|
Shinya Kitaoka |
120a6e |
bool bidirectional, int marginLeft,
|
|
Shinya Kitaoka |
120a6e |
int marginRight, int marginTop,
|
|
Shinya Kitaoka |
120a6e |
int marginBottom, TDimensionI &filterDim);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
Iwa_DirectionalBlurFx();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
38fd86 |
void doCompute(TTile &tile, double frame,
|
|
Shinya Kitaoka |
38fd86 |
const TRenderSettings &settings) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
38fd86 |
bool doGetBBox(double frame, TRectD &bBox,
|
|
Shinya Kitaoka |
38fd86 |
const TRenderSettings &info) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
bool canHandle(const TRenderSettings &info, double frame) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
void getParamUIs(TParamUIConcept *&concepts, int &length) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|