Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TTZPIMAGEFX_H
Toshihiro Shimizu 890ddd
#define TTZPIMAGEFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzCore includes
Toshihiro Shimizu 890ddd
#include "tpalette.h"
Toshihiro Shimizu 890ddd
#include "trastercm.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzBase includes
Toshihiro Shimizu 890ddd
#include "trasterfxrenderdata.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzExt includes
Toshihiro Shimizu 890ddd
#include "ext/plasticskeletondeformation.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// STD includes
Toshihiro Shimizu 890ddd
#include <vector></vector>
Toshihiro Shimizu 890ddd
#include <set></set>
Toshihiro Shimizu 890ddd
#include <string></string>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TFX_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
//    ExternalPaletteFxRenderData  declaration
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI ExternalPaletteFxRenderData : public TRasterFxRenderData
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TPaletteP m_palette;
Toshihiro Shimizu 890ddd
	std::string m_name;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 3bfa54
	ExternalPaletteFxRenderData(TPaletteP palette, const std::string &name);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	float typeIndex() const { return 0.0f; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool operator==(const TRasterFxRenderData &data) const;
Toshihiro Shimizu 890ddd
	std::string toString() const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
//    PaletteFilterFxRenderData  declaration
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum FilterType { eApplyToInksAndPaints = 0,
Toshihiro Shimizu 890ddd
				  eApplyToInksKeepingAllPaints,
Toshihiro Shimizu 890ddd
				  eApplyToPaintsKeepingAllInks,
Toshihiro Shimizu 890ddd
				  eApplyToInksAndPaints_NoGap,
Toshihiro Shimizu 890ddd
				  eApplyToInksDeletingAllPaints,
Toshihiro Shimizu 890ddd
				  eApplyToPaintsDeletingAllInks };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI PaletteFilterFxRenderData : public TRasterFxRenderData
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	bool m_keep;
Toshihiro Shimizu 890ddd
	FilterType m_type;
Toshihiro Shimizu 890ddd
	std::set<int> m_colors;</int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	PaletteFilterFxRenderData();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	float typeIndex() const { return (m_type == eApplyToInksAndPaints) ? 0.5f : 1.0f; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool operator==(const TRasterFxRenderData &data) const;
Toshihiro Shimizu 890ddd
	std::string toString() const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
void DVAPI insertIndexes(std::vector<std::string> items, PaletteFilterFxRenderData *t);</std::string>
Shinya Kitaoka 3bfa54
void DVAPI parseIndexes(std::string indexes, std::vector<std::string> &items);</std::string>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
//    SandorFxRenderData  (possible) parameters
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum Type { BlendTz,
Toshihiro Shimizu 890ddd
			Calligraphic,
Toshihiro Shimizu 890ddd
			ArtAtContour,
Toshihiro Shimizu 890ddd
			OutBorder };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI BlendTzParams
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	std::wstring m_colorIndex;
Toshihiro Shimizu 890ddd
	bool m_noBlending;
Toshihiro Shimizu 890ddd
	double m_amount;
Toshihiro Shimizu 890ddd
	double m_smoothness;
Toshihiro Shimizu 890ddd
	int m_superSampling;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	BlendTzParams()
Toshihiro Shimizu 890ddd
		: m_colorIndex(L""), m_noBlending(false), m_amount(0.0), m_smoothness(0.0), m_superSampling(0) {}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI CalligraphicParams
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	std::wstring m_colorIndex;
Toshihiro Shimizu 890ddd
	double m_thickness;
Toshihiro Shimizu 890ddd
	double m_horizontal;
Toshihiro Shimizu 890ddd
	double m_vertical;
Toshihiro Shimizu 890ddd
	double m_upWDiagonal;
Toshihiro Shimizu 890ddd
	double m_doWDiagonal;
Toshihiro Shimizu 890ddd
	double m_accuracy;
Toshihiro Shimizu 890ddd
	double m_noise;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	CalligraphicParams()
Toshihiro Shimizu 890ddd
		: m_thickness(0.0), m_horizontal(0.0), m_vertical(0.0), m_upWDiagonal(0.0), m_doWDiagonal(0.0), m_accuracy(0.0), m_noise(0.0), m_colorIndex(L"") {}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI ArtAtContourParams
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	double m_maxSize;
Toshihiro Shimizu 890ddd
	double m_minSize;
Toshihiro Shimizu 890ddd
	double m_maxOrientation;
Toshihiro Shimizu 890ddd
	double m_minOrientation;
Toshihiro Shimizu 890ddd
	bool m_randomness;
Toshihiro Shimizu 890ddd
	double m_maxDistance;
Toshihiro Shimizu 890ddd
	double m_minDistance;
Toshihiro Shimizu 890ddd
	double m_density;
Toshihiro Shimizu 890ddd
	bool m_keepLine;
Toshihiro Shimizu 890ddd
	bool m_keepColor;
Toshihiro Shimizu 890ddd
	bool m_includeAlpha;
Toshihiro Shimizu 890ddd
	std::wstring m_colorIndex;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	ArtAtContourParams()
Toshihiro Shimizu 890ddd
		: m_maxSize(0.0), m_minSize(0.0), m_maxOrientation(0.0), m_minOrientation(0.0), m_randomness(false), m_maxDistance(0.0), m_minDistance(0.0), m_density(0.0), m_keepLine(false), m_keepColor(false), m_includeAlpha(true), m_colorIndex(L"") {}
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
//    SandorFxRenderData  declaration
Toshihiro Shimizu 890ddd
//**********************************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI SandorFxRenderData : public TRasterFxRenderData
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	Type m_type;
Toshihiro Shimizu 890ddd
	BlendTzParams m_blendParams;
Toshihiro Shimizu 890ddd
	CalligraphicParams m_callParams;
Toshihiro Shimizu 890ddd
	ArtAtContourParams m_contourParams;
Toshihiro Shimizu 890ddd
	int m_border, m_shrink;
Toshihiro Shimizu 890ddd
	int m_argc;
Toshihiro Shimizu 890ddd
	const char *m_argv[12];
Toshihiro Shimizu 890ddd
	TRectD m_controllerBBox;
Toshihiro Shimizu 890ddd
	TRasterP m_controller;
Toshihiro Shimizu 890ddd
	std::string m_controllerAlias;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	SandorFxRenderData(Type type, int argc, const char *argv[], int border, int shrink,
Toshihiro Shimizu 890ddd
					   const TRectD &controllerBBox = TRectD(), const TRasterP &controller = TRasterP());
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	float typeIndex() const { return (m_type == BlendTz) ? 2.0f : 3.0f; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool operator==(const TRasterFxRenderData &data) const;
Toshihiro Shimizu 890ddd
	std::string toString() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TRectD getBBoxEnlargement(const TRectD &bbox);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif