Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef PARTICLESENGINE_H
Toshihiro Shimizu 890ddd
#define PARTICLESENGINE_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tlevel.h"
Toshihiro Shimizu 890ddd
#include "particles.h"
Toshihiro Shimizu 890ddd
#include "particlesfx.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class Particle;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class Particles_Engine
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	ParticlesFx *m_parent;
Toshihiro Shimizu 890ddd
	double m_frame;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	Particles_Engine(ParticlesFx *parent, double frame);
Toshihiro Shimizu 890ddd
	~Particles_Engine(){};
Toshihiro Shimizu 890ddd
	//Destructor
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void scramble_particles(void);
Toshihiro Shimizu 890ddd
	void fill_range_struct(struct particles_values &values,
Toshihiro Shimizu 890ddd
						   struct particles_ranges &ranges);
Toshihiro Shimizu 890ddd
	void fill_value_struct(struct particles_values &value, double frame);
Toshihiro Shimizu 890ddd
	void roll_particles(TTile *tile, std::map<int, *="" ttile=""> porttiles, const TRenderSettings &ri, std::list<particle> &myParticles, struct particles_values &values,</particle></int,>
Toshihiro Shimizu 890ddd
						float cx, float cy, int frame, int curr_frame, int level_n, bool *random_level, float dpi, vector<int> lastframe, int &totalparticles);</int>
Toshihiro Shimizu 890ddd
	void normalize_values(struct particles_values &values, const TRenderSettings &ri);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void render_particles(
Toshihiro Shimizu 890ddd
		TFlash *flash, TTile *tile, std::vector<trasterfxport *=""> part_ports, const TRenderSettings &ri,</trasterfxport>
Toshihiro Shimizu 890ddd
		TDimension &p_size, TPointD &p_offset, std::map<int, *="" trasterfxport=""> ctrl_ports, vector<tlevelp> partLevel, float dpi,</tlevelp></int,>
Toshihiro Shimizu 890ddd
		int curr_frame, int shrink, double startx, double starty,
Toshihiro Shimizu 890ddd
		double endx, double endy, vector<int> lastframe, unsigned long fxId);</int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void do_render(
Toshihiro Shimizu 890ddd
		TFlash *flash, Particle *part, TTile *tile, std::vector<trasterfxport *=""> part_ports,</trasterfxport>
Toshihiro Shimizu 890ddd
		std::map<int, *="" ttile=""> porttiles, const TRenderSettings &ri,</int,>
Toshihiro Shimizu 890ddd
		TDimension &p_size, TPointD &p_offset, int lastframe, vector<tlevelp> partLevel,</tlevelp>
Toshihiro Shimizu 890ddd
		struct particles_values &values, double opacity_range, int curr_frame,
Toshihiro Shimizu 890ddd
		std::map<std::pair<int, int="">, double> &partScales);</std::pair<int,>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool port_is_used(int i, struct particles_values &values);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*- do_source_gradationがONのとき、入力画像のアルファ値に比例して発生濃度を変える。
Toshihiro Shimizu 890ddd
		入力画像のHistogramを格納しながら領域を登録する -*/
Toshihiro Shimizu 890ddd
	void fill_regions(int frame, vector<vector<tpointd>> &myregions, TTile *ctrl1, bool multi, int thres,</vector<tpointd>
Toshihiro Shimizu 890ddd
					  bool do_source_gradation,
Toshihiro Shimizu 890ddd
					  vector<vector<int>> &myHistogram);</vector<int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void fill_single_region(vector<vector<tpointd>> &myregions, TTile *ctrl1, int thres,</vector<tpointd>
Toshihiro Shimizu 890ddd
							bool do_source_gradation,
Toshihiro Shimizu 890ddd
							vector<vector<int>> &myHistogram);</vector<int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*-- Perspective DistributionがONのとき、Sizeに刺さったControlImageが粒子の発生分布を決める。
Toshihiro Shimizu 890ddd
		そのとき、SourceのControlが刺さっている場合は、マスクとして用いられる --*/
Toshihiro Shimizu 890ddd
	void fill_regions_with_size_map(vector<vector<tpointd>> &myregions,</vector<tpointd>
Toshihiro Shimizu 890ddd
									vector<vector<int>> &myHistogram,</vector<int>
Toshihiro Shimizu 890ddd
									TTile *sizeTile,
Toshihiro Shimizu 890ddd
									TTile *sourceTile,
Toshihiro Shimizu 890ddd
									int thres);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void fill_subregions(int cont_index, vector<vector<tpointd>> &myregions, TTile *ctrl1, int thres);</vector<tpointd>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void normalize_array(vector<vector<tpointd>> &myregions, TPointD pos, int lx, int ly, int regioncounter, vector<int> &myarray, vector<int> &lista, vector<int> &listb, vector<int> &final);</int></int></int></int></vector<tpointd>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void fill_array(TTile *ctrl1, int ®ioncount, vector<int> &myarray, vector<int> &lista, vector<int> &listb, int thres);</int></int></int>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif