Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TOONZIMAGE_DATA_H
Toshihiro Shimizu 890ddd
#define TOONZIMAGE_DATA_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
#include "toonz/ttileset.h"
Toshihiro Shimizu 890ddd
#include "tpalette.h"
Toshihiro Shimizu 890ddd
#include "tstroke.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/dvmimedata.h"
Toshihiro Shimizu 890ddd
#include "ttoonzimage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <set></set>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TOONZQT_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
class TTileSetCM32;
Toshihiro Shimizu 890ddd
class StrokesData;
Toshihiro Shimizu 890ddd
class ToonzScene;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//===================================================================
Toshihiro Shimizu 890ddd
// RasterImageData
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class RasterImageData : public DvMimeData
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
protected:
Toshihiro Shimizu 890ddd
	double m_dpiX, m_dpiY;
Shinya Kitaoka 3bfa54
	std::vector<trectd> m_rects;</trectd>
Shinya Kitaoka 3bfa54
	std::vector<tstroke> m_strokes;</tstroke>
Shinya Kitaoka 3bfa54
	std::vector<tstroke> m_originalStrokes;</tstroke>
Toshihiro Shimizu 890ddd
	TAffine m_transformation;
Toshihiro Shimizu 890ddd
	TDimension m_dim;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	RasterImageData();
Toshihiro Shimizu 890ddd
	~RasterImageData();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual void setData(const TRasterP &copiedRaster, const TPaletteP &palette, double dpiX, double dpiY, const TDimension &dim,
Shinya Kitaoka 3bfa54
						 const std::vector<trectd> &rects, const std::vector<tstroke> &strokes, const std::vector<tstroke> &originalStrokes,</tstroke></tstroke></trectd>
Toshihiro Shimizu 890ddd
						 const TAffine &transformation) = 0;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual void getData(TRasterP &copiedRaster, double &dpiX, double &dpiY,
Shinya Kitaoka 3bfa54
						 std::vector<trectd> &rects, std::vector<tstroke> &strokes, std::vector<tstroke> &originalStrokes,</tstroke></tstroke></trectd>
Toshihiro Shimizu 890ddd
						 TAffine &transformation, TPalette *targetPalette) const = 0;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	virtual StrokesData *toStrokesData(ToonzScene *scene) const = 0;
Toshihiro Shimizu 890ddd
	virtual TPointD getDpi() const = 0;
Toshihiro Shimizu 890ddd
	TDimension getDim() const { return m_dim; }
Toshihiro Shimizu 890ddd
	virtual RasterImageData *clone() const = 0;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//Necessary for undo purpose!!!!
Toshihiro Shimizu 890ddd
	virtual int getMemorySize() const = 0;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//===================================================================
Toshihiro Shimizu 890ddd
// ToonzImageData
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
/*-- SelectionToolで選択した画像のデータ --*/
Toshihiro Shimizu 890ddd
class DVAPI ToonzImageData : public RasterImageData
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TRasterCM32P m_copiedRaster;
Toshihiro Shimizu 890ddd
	TPaletteP m_palette;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	std::set<int> m_usedStyles;</int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	ToonzImageData();
Toshihiro Shimizu 890ddd
	ToonzImageData(const ToonzImageData &);
Toshihiro Shimizu 890ddd
	~ToonzImageData();
Toshihiro Shimizu 890ddd
	// data <- floating ti;
Toshihiro Shimizu 890ddd
	void setData(const TRasterP &copiedRaster, const TPaletteP &palette, double dpiX, double dpiY, const TDimension &dim,
Shinya Kitaoka 3bfa54
				 const std::vector<trectd> &rects, const std::vector<tstroke> &strokes, const std::vector<tstroke> &originalStrokes,</tstroke></tstroke></trectd>
Toshihiro Shimizu 890ddd
				 const TAffine &transformation);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// floating ti <- data;
Toshihiro Shimizu 890ddd
	void getData(TRasterP &copiedRaster, double &dpiX, double &dpiY,
Shinya Kitaoka 3bfa54
				 std::vector<trectd> &rects, std::vector<tstroke> &strokes, std::vector<tstroke> &originalStrokes,</tstroke></tstroke></trectd>
Toshihiro Shimizu 890ddd
				 TAffine &transformation, TPalette *targetPalette) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	StrokesData *toStrokesData(ToonzScene *scene) const;
Toshihiro Shimizu 890ddd
	TPointD getDpi() const { return TPointD(m_dpiX, m_dpiY); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	ToonzImageData *clone() const { return new ToonzImageData(*this); }
Toshihiro Shimizu 890ddd
	int getMemorySize() const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//===================================================================
Toshihiro Shimizu 890ddd
// FullColorImageData
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI FullColorImageData : public RasterImageData
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TRasterP m_copiedRaster;
Toshihiro Shimizu 890ddd
	TPaletteP m_palette;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	FullColorImageData();
Toshihiro Shimizu 890ddd
	FullColorImageData(const FullColorImageData &);
Toshihiro Shimizu 890ddd
	~FullColorImageData();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// data <- floating ti;
Toshihiro Shimizu 890ddd
	void setData(const TRasterP &copiedRaster, const TPaletteP &palette, double dpiX, double dpiY, const TDimension &dim,
Shinya Kitaoka 3bfa54
				 const std::vector<trectd> &rects, const std::vector<tstroke> &strokes, const std::vector<tstroke> &originalStrokes,</tstroke></tstroke></trectd>
Toshihiro Shimizu 890ddd
				 const TAffine &transformation);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// floating ti <- data;
Toshihiro Shimizu 890ddd
	void getData(TRasterP &copiedRaster, double &dpiX, double &dpiY,
Shinya Kitaoka 3bfa54
				 std::vector<trectd> &rects, std::vector<tstroke> &strokes, std::vector<tstroke> &originalStrokes,</tstroke></tstroke></trectd>
Toshihiro Shimizu 890ddd
				 TAffine &transformation, TPalette *targetPalette) const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	StrokesData *toStrokesData(ToonzScene *scene) const;
Toshihiro Shimizu 890ddd
	TPointD getDpi() const { return TPointD(m_dpiX, m_dpiY); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	FullColorImageData *clone() const { return new FullColorImageData(*this); }
Toshihiro Shimizu 890ddd
	int getMemorySize() const;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif