2020-08-18 07:38:24 +12:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
//******************************************************************
|
|
|
|
|
// Iwa FractalNoise Fx
|
|
|
|
|
// An Fx emulating Fractal Noise effect in Adobe AfterEffect
|
|
|
|
|
//******************************************************************
|
|
|
|
|
|
|
|
|
|
#ifndef IWA_FRACTALNOISEFX_H
|
|
|
|
|
#define IWA_FRACTALNOISEFX_H
|
|
|
|
|
|
|
|
|
|
#include "tfxparam.h"
|
|
|
|
|
#include "tparamset.h"
|
|
|
|
|
#include "stdfx.h"
|
|
|
|
|
|
|
|
|
|
class Iwa_FractalNoiseFx final : public TStandardZeraryFx {
|
|
|
|
|
FX_PLUGIN_DECLARATION(Iwa_FractalNoiseFx)
|
|
|
|
|
|
|
|
|
|
enum FractalType {
|
|
|
|
|
Basic = 0,
|
|
|
|
|
TurbulentSmooth,
|
|
|
|
|
TurbulentBasic,
|
|
|
|
|
TurbulentSharp,
|
|
|
|
|
Dynamic,
|
|
|
|
|
DynamicTwist,
|
|
|
|
|
Max,
|
|
|
|
|
Rocky,
|
|
|
|
|
FractalTypeCount
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum NoiseType { Block = 0, Smooth, NoiseTypeCount };
|
|
|
|
|
|
|
|
|
|
struct FNParam {
|
|
|
|
|
FractalType fractalType;
|
|
|
|
|
NoiseType noiseType;
|
|
|
|
|
bool invert;
|
|
|
|
|
double rotation;
|
|
|
|
|
TDimensionD scale;
|
|
|
|
|
TPointD offsetTurbulence;
|
|
|
|
|
bool perspectiveOffset;
|
|
|
|
|
double complexity;
|
|
|
|
|
double subInfluence;
|
|
|
|
|
double subScaling;
|
|
|
|
|
double subRotation;
|
|
|
|
|
TPointD subOffset;
|
|
|
|
|
double evolution;
|
|
|
|
|
bool cycleEvolution;
|
|
|
|
|
double cycleEvolutionRange;
|
|
|
|
|
double dynamicIntensity;
|
2022-01-06 15:05:24 +13:00
|
|
|
|
|
|
|
|
|
bool doConical;
|
|
|
|
|
double conicalEvolution;
|
|
|
|
|
double conicalAngle;
|
|
|
|
|
double cameraFov;
|
|
|
|
|
double zScale;
|
|
|
|
|
|
2020-08-18 07:38:24 +12:00
|
|
|
|
bool alphaRendering;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected:
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Fractal Type フラクタルの種類
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TIntEnumParamP m_fractalType;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Noise Type ノイズの種類
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TIntEnumParamP m_noiseType;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Invert 反転
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TBoolParamP m_invert;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
/// Contrast コントラスト
|
|
|
|
|
/// Brightness 明るさ
|
|
|
|
|
/// Overflow オーバーフロー
|
2020-08-18 07:38:24 +12:00
|
|
|
|
|
2021-12-28 09:13:27 +13:00
|
|
|
|
//- - - Transform トランスフォーム - - -
|
|
|
|
|
// Rotation 回転
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_rotation;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Uniform Scaling 縦横比を固定
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TBoolParamP m_uniformScaling;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Scale スケール
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_scale;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Scale Width スケールの幅
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_scaleW;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Scale Height スケールの高さ
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_scaleH;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Offset Turbulence 乱気流のオフセット
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TPointParamP m_offsetTurbulence;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Perspective Offset 遠近オフセット
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TBoolParamP m_perspectiveOffset;
|
|
|
|
|
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Complexity 複雑度
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_complexity;
|
|
|
|
|
|
2021-12-28 09:13:27 +13:00
|
|
|
|
//- - - Sub Settings サブ設定 - - -
|
|
|
|
|
// Sub Influence サブ影響(%)
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_subInfluence;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Sub Scaling サブスケール
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_subScaling;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Sub Rotation サブ回転
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_subRotation;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Sub Offset サブのオフセット
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TPointParamP m_subOffset;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Center Subscale サブスケールを中心
|
2020-08-18 07:38:24 +12:00
|
|
|
|
/// TBoolParamP m_centerSubscale;
|
|
|
|
|
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Evolution 展開
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_evolution;
|
|
|
|
|
|
2021-12-28 09:13:27 +13:00
|
|
|
|
//- - - Evolution Options 展開のオプション - - -
|
|
|
|
|
// Cycle Evolution サイクル展開
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TBoolParamP m_cycleEvolution;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// Cycle (in Evolution) サイクル(周期)
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_cycleEvolutionRange;
|
2021-12-28 09:13:27 +13:00
|
|
|
|
/// Random Seed ランダムシード
|
|
|
|
|
/// Opacity 不透明度
|
|
|
|
|
/// Blending Mode 描画モード
|
2020-08-18 07:38:24 +12:00
|
|
|
|
|
2021-12-28 09:13:27 +13:00
|
|
|
|
// ダイナミックの度合い
|
2020-08-18 07:38:24 +12:00
|
|
|
|
TDoubleParamP m_dynamicIntensity;
|
|
|
|
|
|
2022-01-06 15:05:24 +13:00
|
|
|
|
//- - - Conical Noise - - -
|
|
|
|
|
TBoolParamP m_doConical;
|
|
|
|
|
TDoubleParamP m_conicalEvolution;
|
|
|
|
|
TDoubleParamP m_conicalAngle;
|
|
|
|
|
TDoubleParamP m_cameraFov;
|
|
|
|
|
TDoubleParamP m_zScale;
|
|
|
|
|
|
2020-08-18 07:38:24 +12:00
|
|
|
|
// - - - additional parameters - - -
|
|
|
|
|
TBoolParamP m_alphaRendering;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Iwa_FractalNoiseFx();
|
|
|
|
|
bool canHandle(const TRenderSettings &info, double frame) override {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
bool doGetBBox(double frame, TRectD &bBox,
|
|
|
|
|
const TRenderSettings &ri) override;
|
|
|
|
|
void doCompute(TTile &tile, double frame, const TRenderSettings &ri) override;
|
|
|
|
|
|
|
|
|
|
void obtainParams(FNParam ¶m, const double frame, const TAffine &aff);
|
|
|
|
|
|
|
|
|
|
template <typename RASTER, typename PIXEL>
|
|
|
|
|
void outputRaster(const RASTER outRas, double *out_buf, const FNParam ¶m);
|
|
|
|
|
|
|
|
|
|
void getParamUIs(TParamUIConcept *&concepts, int &length) override;
|
|
|
|
|
|
|
|
|
|
// For Dynamic and Dynamic Twist patterns, the position offsets using gradient
|
|
|
|
|
// / rotation of the parent pattern
|
2022-01-06 15:05:24 +13:00
|
|
|
|
TPointD getSamplePos(double x, double y, const TDimension outDim,
|
2020-08-18 07:38:24 +12:00
|
|
|
|
const double *out_buf, const int gen, const double scale,
|
|
|
|
|
const FNParam ¶m);
|
|
|
|
|
// convert the noise
|
|
|
|
|
void convert(double *buf, const FNParam ¶m);
|
|
|
|
|
// composite the base noise pattern
|
|
|
|
|
void composite(double *out, double *buf, const double influence,
|
|
|
|
|
const FNParam ¶m);
|
Fix various typos
Found via `codespell -q 3 -S *.ts,thirdparty, -L appy,ba,chunck,datas,forse,inbetween,inly,inout,pevent,possibile,upto`
2021-11-22 08:54:40 +13:00
|
|
|
|
// finalize pattern (converting the color space)
|
2020-08-18 07:38:24 +12:00
|
|
|
|
void finalize(double *out, const FNParam ¶m);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|