142 lines
3.9 KiB
C
142 lines
3.9 KiB
C
|
#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;
|
|||
|
bool alphaRendering;
|
|||
|
};
|
|||
|
|
|||
|
protected:
|
|||
|
// Fractal Type <20>t<EFBFBD><74><EFBFBD>N<EFBFBD>^<5E><><EFBFBD>̎<EFBFBD><CC8E><EFBFBD>
|
|||
|
TIntEnumParamP m_fractalType;
|
|||
|
// Noise Type <20>m<EFBFBD>C<EFBFBD>Y<EFBFBD>̎<EFBFBD><CC8E><EFBFBD>
|
|||
|
TIntEnumParamP m_noiseType;
|
|||
|
// Invert <20><><EFBFBD>]
|
|||
|
TBoolParamP m_invert;
|
|||
|
/// Contrast <20>R<EFBFBD><52><EFBFBD>g<EFBFBD><67><EFBFBD>X<EFBFBD>g
|
|||
|
/// Brightness <20><><EFBFBD>邳
|
|||
|
/// Overflow <20>I<EFBFBD>[<5B>o<EFBFBD>[<5B>t<EFBFBD><74><EFBFBD>[
|
|||
|
|
|||
|
//- - - Transform <20>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD>t<EFBFBD>H<EFBFBD>[<5B><> - - -
|
|||
|
// Rotation <20><><EFBFBD>]
|
|||
|
TDoubleParamP m_rotation;
|
|||
|
// Uniform Scaling<6E>@<40>c<EFBFBD><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Œ<EFBFBD>
|
|||
|
TBoolParamP m_uniformScaling;
|
|||
|
// Scale <20>X<EFBFBD>P<EFBFBD>[<5B><>
|
|||
|
TDoubleParamP m_scale;
|
|||
|
// Scale Width <20>X<EFBFBD>P<EFBFBD>[<5B><><EFBFBD>̕<EFBFBD>
|
|||
|
TDoubleParamP m_scaleW;
|
|||
|
// Scale Height <20>X<EFBFBD>P<EFBFBD>[<5B><><EFBFBD>̍<EFBFBD><CC8D><EFBFBD>
|
|||
|
TDoubleParamP m_scaleH;
|
|||
|
// Offset Turbulence <20><><EFBFBD>C<EFBFBD><43><EFBFBD>̃I<CC83>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g
|
|||
|
TPointParamP m_offsetTurbulence;
|
|||
|
// Perspective Offset <20><><EFBFBD>߃I<DF83>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g
|
|||
|
TBoolParamP m_perspectiveOffset;
|
|||
|
|
|||
|
// Complexity <20><><EFBFBD>G<EFBFBD>x
|
|||
|
TDoubleParamP m_complexity;
|
|||
|
|
|||
|
//- - - Sub Settings <20>T<EFBFBD>u<EFBFBD>ݒ<EFBFBD> - - -
|
|||
|
// Sub Influence <20>T<EFBFBD>u<EFBFBD>e<EFBFBD><65><EFBFBD>i<EFBFBD><69><EFBFBD>j
|
|||
|
TDoubleParamP m_subInfluence;
|
|||
|
// Sub Scaling<6E>@<40>T<EFBFBD>u<EFBFBD>X<EFBFBD>P<EFBFBD>[<5B><>
|
|||
|
TDoubleParamP m_subScaling;
|
|||
|
// Sub Rotation <20>T<EFBFBD>u<EFBFBD><75><EFBFBD>]
|
|||
|
TDoubleParamP m_subRotation;
|
|||
|
// Sub Offset <20>T<EFBFBD>u<EFBFBD>̃I<CC83>t<EFBFBD>Z<EFBFBD>b<EFBFBD>g
|
|||
|
TPointParamP m_subOffset;
|
|||
|
// Center Subscale <20>T<EFBFBD>u<EFBFBD>X<EFBFBD>P<EFBFBD>[<5B><><EFBFBD>𒆐S
|
|||
|
/// TBoolParamP m_centerSubscale;
|
|||
|
|
|||
|
// Evolution <20>W<EFBFBD>J
|
|||
|
TDoubleParamP m_evolution;
|
|||
|
|
|||
|
//- - - Evolution Options <20>W<EFBFBD>J<EFBFBD>̃I<CC83>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD> - - -
|
|||
|
// Cycle Evolution <20>T<EFBFBD>C<EFBFBD>N<EFBFBD><4E><EFBFBD>W<EFBFBD>J
|
|||
|
TBoolParamP m_cycleEvolution;
|
|||
|
// Cycle (in Evolution) <20>T<EFBFBD>C<EFBFBD>N<EFBFBD><4E><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD>j
|
|||
|
TDoubleParamP m_cycleEvolutionRange;
|
|||
|
/// Random Seed <20><><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD>V<EFBFBD>[<5B>h
|
|||
|
/// Opacity <20>s<EFBFBD><73><EFBFBD><EFBFBD><EFBFBD>x
|
|||
|
/// Blending Mode <20>`<60>惂<EFBFBD>[<5B>h
|
|||
|
|
|||
|
// <20>_<EFBFBD>C<EFBFBD>i<EFBFBD>~<7E>b<EFBFBD>N<EFBFBD>̓x<CC93><78><EFBFBD><EFBFBD>
|
|||
|
TDoubleParamP m_dynamicIntensity;
|
|||
|
|
|||
|
// - - - 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
|
|||
|
TPointD getSamplePos(int x, int y, const TDimension outDim,
|
|||
|
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);
|
|||
|
// finalize pattern (coverting the color space)
|
|||
|
void finalize(double *out, const FNParam ¶m);
|
|||
|
};
|
|||
|
|
|||
|
#endif
|