Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef T_BLUREDBRUSH
Toshihiro Shimizu 890ddd
#define T_BLUREDBRUSH
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "traster.h"
Toshihiro Shimizu 890ddd
#include "trastercm.h"
Toshihiro Shimizu 890ddd
#include "tcurves.h"
Toshihiro Shimizu 890ddd
#include <qpainter></qpainter>
Toshihiro Shimizu 890ddd
#include <qimage></qimage>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=======================================================
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//BluredBrush
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//=======================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class BluredBrush
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TRaster32P m_ras;
Toshihiro Shimizu 890ddd
	QImage m_rasImage;
Toshihiro Shimizu 890ddd
	int m_size;
Toshihiro Shimizu 890ddd
	QRadialGradient m_gradient;
Toshihiro Shimizu 890ddd
	TThickPoint m_lastPoint;
Toshihiro Shimizu 890ddd
	double m_oldOpacity;
Toshihiro Shimizu 890ddd
	bool m_enableDinamicOpacity;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	double getNextPadPosition(const TThickQuadratic &q, double t) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	BluredBrush(const TRaster32P &ras, int size, const QRadialGradient &gradient, bool doDinamicOpacity);
Toshihiro Shimizu 890ddd
	~BluredBrush();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void addPoint(const TThickPoint &p, double opacity);
Toshihiro Shimizu 890ddd
	void addArc(const TThickPoint &pa, const TThickPoint &pb, const TThickPoint &pc, double opacityA, double opacityC);
Shinya Kitaoka 3bfa54
	TRect getBoundFromPoints(const std::vector<tthickpoint> &points) const;</tthickpoint>
Toshihiro Shimizu 890ddd
	//colormapped
Toshihiro Shimizu 890ddd
	void updateDrawing(const TRasterCM32P rasCM, const TRasterCM32P rasBackupCM, const TRect &bbox,
Toshihiro Shimizu 890ddd
					   int styleId, bool selective) const;
Toshihiro Shimizu 890ddd
	void eraseDrawing(const TRasterCM32P rasCM, const TRasterCM32P rasBackupCM, const TRect &bbox,
Shinya Kitaoka 3bfa54
					  bool selective, int selectedStyleId, const std::wstring &mode) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//fullcolor
Toshihiro Shimizu 890ddd
	void updateDrawing(const TRasterP ras, const TRasterP rasBackup, const TPixel32 &color,
Toshihiro Shimizu 890ddd
					   const TRect &bbox, double opacity) const;
Toshihiro Shimizu 890ddd
	void eraseDrawing(const TRasterP ras, const TRasterP rasBackup, const TRect &bbox, double opacity) const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif //T_BLUREDBRUSH