tahoma2d/toonz/sources/stdfx/iwa_fractalnoisefx.h

142 lines
3.9 KiB
C
Raw Normal View History

Update with Current OpenToonz changes as of 8-12-20 (#119) * add multi arc mockup * implement mutli arc * add join and smooth option * reset multiarc and arc when deactivated * create self loop if the last point is the same as the first * make join option in multiarc consistent with tape tool * fix a bug where thickness don't affect mutliarc in vector level * remove join option in geometric tool * stop mutliarc after closing shape * double click can also end multi arc * fix a bug where multiArc will produce buggy stroke * fix a bug where geometric tools is not deactivated * add multiArc shortcut * rewrite multiArc * revert changes to tvectorimage * add undo data for multiArc * Paste as Copy Command for XSheet * Remove unneeded code * Bug fix * prevent guide lines from jumping around in MultiArc * make stroke color consistent in MultiArc * remove color in MultiArc's undo data * make color consistent in MultiArc with previous version * Fix single image raster levels * fix compilation error * fix a bug where multiArc might generate bugged stroke * Remove ICONV dep (#3304) * fix crash on saving studio palette * Move to Paste Special Menu * Don't Set Fixed Width if Docking a Floating Panel * Update how_to_build_win.md New draft of pr for requested changes to windows build instructions. * fix geometric tool multiarc smooth option * fix level saving failure * fix wrong warning after saving palette * fix a bug where moving a control point while holding alt has unintended result * fix travis-install (#3389) * Fix assert debug crash in flipconsole.cpp Fix crash when using the viewer controls in the console (debug) * Redraw Audio Waveform Fills the waveform rather than outlines it. * fix undo data when drawing arc and mutliarc * fix overwriting raster drawing palette (#3387) * mode sensitive fx settings * Create New Style Command Button (#3394) * Create New Style Command Button This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz. Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com> * Update paletteviewergui.cpp Made changes to the PR per request by Shun. * Fixed a space within the code that wasn't suppose to be there. Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> * tahoma license (#3396) * new style button optional * fix loading pegbars (removing updateKeyframes) * periodic random expression * add fx in linear color space this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd. in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories. * fractal noise iwa fx * skip unnecessary icon invalidation * fix frame range fill with tablet * stop function editor to open by dbl clicking key * Expanding the radius of the rotation handle. This just changes when the cursor transforms into the rotation tool. (cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39) Co-authored-by: pojienie <pojienie@gmail.com> Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp> Co-authored-by: Rodney <rodney.baker@gmail.com> Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com> Co-authored-by: Kite <konero@users.noreply.github.com> Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
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;
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 &param, const double frame, const TAffine &aff);
template <typename RASTER, typename PIXEL>
void outputRaster(const RASTER outRas, double *out_buf, const FNParam &param);
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 &param);
// convert the noise
void convert(double *buf, const FNParam &param);
// composite the base noise pattern
void composite(double *out, double *buf, const double influence,
const FNParam &param);
// finalize pattern (coverting the color space)
void finalize(double *out, const FNParam &param);
};
#endif