Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#if !defined(TOONZ_PLUGIN_UTILITIES_HPP__)
Toshihiro Shimizu 890ddd
#define TOONZ_PLUGIN_UTILITIES_HPP__
Toshihiro Shimizu 890ddd
#include "toonz_hostif.h"
Toshihiro Shimizu 890ddd
#include <tgeometry.h></tgeometry.h>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
namespace plugin
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
namespace utils
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
inline bool copy_rect(toonz_rect_t *dst, const TRectD &src)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	dst->x0 = src.x0;
Toshihiro Shimizu 890ddd
	dst->y0 = src.y0;
Toshihiro Shimizu 890ddd
	dst->x1 = src.x1;
Toshihiro Shimizu 890ddd
	dst->y1 = src.y1;
Toshihiro Shimizu 890ddd
	return true;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
inline TRectD restore_rect(const toonz_rect_t *src)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	return TRectD(src->x0, src->y0, src->x1, src->y1);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
inline bool copy_affine(toonz_affine_t *dst, const TAffine &src)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	dst->a11 = src.a11;
Toshihiro Shimizu 890ddd
	dst->a12 = src.a12;
Toshihiro Shimizu 890ddd
	dst->a13 = src.a13;
Toshihiro Shimizu 890ddd
	dst->a21 = src.a21;
Toshihiro Shimizu 890ddd
	dst->a22 = src.a22;
Toshihiro Shimizu 890ddd
	dst->a23 = src.a23;
Toshihiro Shimizu 890ddd
	return true;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
inline TAffine restore_affine(const toonz_affine_t *src)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	return TAffine(src->a11, src->a12, src->a13, src->a21, src->a22, src->a23);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
#endif