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
//
Shinya Kitaoka 120a6e
// BluredBrush
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//=======================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class BluredBrush {
Shinya Kitaoka 120a6e
  TRaster32P m_ras;
Shinya Kitaoka 120a6e
  QImage m_rasImage;
Shinya Kitaoka 120a6e
  int m_size;
Shinya Kitaoka 120a6e
  QRadialGradient m_gradient;
Shinya Kitaoka 120a6e
  TThickPoint m_lastPoint;
Shinya Kitaoka 120a6e
  double m_oldOpacity;
Shinya Kitaoka 120a6e
  bool m_enableDinamicOpacity;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  double getNextPadPosition(const TThickQuadratic &q, double t) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  BluredBrush(const TRaster32P &ras, int size, const QRadialGradient &gradient,
Shinya Kitaoka 120a6e
              bool doDinamicOpacity);
Shinya Kitaoka 120a6e
  ~BluredBrush();
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void addPoint(const TThickPoint &p, double opacity);
Shinya Kitaoka 120a6e
  void addArc(const TThickPoint &pa, const TThickPoint &pb,
Shinya Kitaoka 120a6e
              const TThickPoint &pc, double opacityA, double opacityC);
Shinya Kitaoka 120a6e
  TRect getBoundFromPoints(const std::vector<tthickpoint> &points) const;</tthickpoint>
Shinya Kitaoka 120a6e
  // colormapped
Shinya Kitaoka 120a6e
  void updateDrawing(const TRasterCM32P rasCM, const TRasterCM32P rasBackupCM,
Shinya Kitaoka 120a6e
                     const TRect &bbox, int styleId, bool selective) const;
Shinya Kitaoka 120a6e
  void eraseDrawing(const TRasterCM32P rasCM, const TRasterCM32P rasBackupCM,
Shinya Kitaoka 120a6e
                    const TRect &bbox, bool selective, int selectedStyleId,
Shinya Kitaoka 120a6e
                    const std::wstring &mode) const;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // fullcolor
Shinya Kitaoka 120a6e
  void updateDrawing(const TRasterP ras, const TRasterP rasBackup,
Shinya Kitaoka 120a6e
                     const TPixel32 &color, const TRect &bbox,
Shinya Kitaoka 120a6e
                     double opacity) const;
Shinya Kitaoka 120a6e
  void eraseDrawing(const TRasterP ras, const TRasterP rasBackup,
Shinya Kitaoka 120a6e
                    const TRect &bbox, double opacity) const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // T_BLUREDBRUSH