|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef _TRASTERFX_
|
|
Toshihiro Shimizu |
890ddd |
#define _TRASTERFX_
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzCore includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tnotanimatableparam.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzBase includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tfx.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "trasterfxrenderdata.h"
|
|
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 |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(disable : 4251)
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Forward declarations
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TFlash;
|
|
Toshihiro Shimizu |
890ddd |
class TPalette;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TRenderSettings declaration
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*!
|
|
Toshihiro Shimizu |
890ddd |
\brief Data class containing the relevant additional informations needed in
|
|
Toshihiro Shimizu |
890ddd |
a render process.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
\details This class stores most of the data required by Toonz and single fxs to
|
|
Toshihiro Shimizu |
890ddd |
perform a render. While a good part of this data group is used internally
|
|
Toshihiro Shimizu |
890ddd |
by Toonz to deal with global aspects of a rendering process, another part
|
|
Toshihiro Shimizu |
890ddd |
must be actively referenced when rendering an fx.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
The most important member of this class is \p m_affine, which specifies
|
|
Toshihiro Shimizu |
890ddd |
the affine transform that must be applied by an fx if it were to render
|
|
Toshihiro Shimizu |
890ddd |
on the default reference.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
\sa TRasterFx::compute() for further informations.
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TRenderSettings
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
//! Specifies the filter quality applied on affine transforms.
|
|
Toshihiro Shimizu |
890ddd |
enum ResampleQuality {
|
|
Toshihiro Shimizu |
890ddd |
HighResampleQuality = 1, //!< Use TRop::Hammin3 filter - pixel blur factor: 3.
|
|
Toshihiro Shimizu |
890ddd |
ImprovedResampleQuality = 2, //!< Use TRop::Hann2 filter - pixel blur factor: 2.
|
|
Toshihiro Shimizu |
890ddd |
StandardResampleQuality = 3, //!< Use TRop::Triangle filter - pixel blur factor: 1.
|
|
Toshihiro Shimizu |
890ddd |
Triangle_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Mitchell_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Cubic5_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Cubic75_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Cubic1_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Hann2_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Hann3_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Hamming2_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Hamming3_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Lanczos2_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Lanczos3_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Gauss_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
ClosestPixel_FilterResampleQuality,
|
|
Toshihiro Shimizu |
890ddd |
Bilinear_FilterResampleQuality
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Specifies the field prevalence of a rendering request.
|
|
Toshihiro Shimizu |
890ddd |
enum FieldPrevalence {
|
|
Toshihiro Shimizu |
890ddd |
NoField, //!< Common rendering.
|
|
Toshihiro Shimizu |
890ddd |
EvenField, //!< Field rendering, even frame.
|
|
Toshihiro Shimizu |
890ddd |
OddField //!< Field rendering, odd frame.
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
// Note - fields are sorted by decreasing size. This ensures minimal padding.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TAffine m_affine; //!< Affine that \a should be applied \a after the fx has been rendered.
|
|
Toshihiro Shimizu |
890ddd |
//! \sa TRasterFx::compute().
|
|
Toshihiro Shimizu |
890ddd |
std::vector<trasterfxrenderdatap> m_data; //!< Fx-specific data inserted by upstream fxs.</trasterfxrenderdatap>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TRasterP m_mark; //!< Raster image that is overed on rendered frames in
|
|
Toshihiro Shimizu |
890ddd |
//! demo versions of Toonz
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
double m_gamma; //!< Gamma modifier for the output frame. \note Should be moved to TOutputProperties.
|
|
Toshihiro Shimizu |
890ddd |
double m_timeStretchFrom, //!< Fps source stretch variable. \note Should be moved to TOutputProperties.
|
|
Toshihiro Shimizu |
890ddd |
m_timeStretchTo; //!< Fps destination stretch variable. \note Should be moved to TOutputProperties.
|
|
Toshihiro Shimizu |
890ddd |
double m_stereoscopicShift; //!< X-axis camera shift for stereoscopy, in inches. \sa m_stereoscopic. \note Should be moved to TOutputProperties.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int m_bpp; //!< Bits-per-pixel required in the output frame. \remark This data
|
|
Toshihiro Shimizu |
890ddd |
//! must be accompanied by a tile of the suitable type. \sa TRasterFx::compute().
|
|
Toshihiro Shimizu |
890ddd |
int m_maxTileSize; //!< Maximum size (in MegaBytes) of a tile cachable during a render process.
|
|
Toshihiro Shimizu |
890ddd |
//! Used by the predictive cache manager to subdivide an fx calculation into tiles. \sa TRasterFx::compute().
|
|
Toshihiro Shimizu |
890ddd |
int m_shrinkX, //!< Required horizontal shrink. \warning Obsolete, do not use. \todo Must be removed.
|
|
Toshihiro Shimizu |
890ddd |
m_shrinkY; //!< Required vertical shrink. \warning Obsolete, do not use. \todo Must be removed.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
ResampleQuality m_quality; //!< Filter quality used on affine transforms.
|
|
Toshihiro Shimizu |
890ddd |
FieldPrevalence m_fieldPrevalence; //!< Field prevalence of the required frame.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool m_stereoscopic; //!< Whether stereoscopic render (3D effect) is in use. \note Should be moved to TOutputProperties.
|
|
Toshihiro Shimizu |
890ddd |
bool m_isSwatch; //!< Whether this render instance comes from a swatch viewer.
|
|
Toshihiro Shimizu |
890ddd |
//! This info could be used by computationally intensive fxs to
|
|
Toshihiro Shimizu |
890ddd |
//! implement a simplified render during user interactions.
|
|
Toshihiro Shimizu |
890ddd |
bool m_userCachable; //!< Whether the user can manually cache this render request. \sa TRasterFx::compute()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Toonz-relevant data (used by Toonz, fx writers should *IGNORE* them while rendering a single fx)
|
|
Toshihiro Shimizu |
890ddd |
// NOTE: The signed options should to be moved in TOutputProperties class.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool m_applyShrinkToViewer; //!< Whether shrink must be considered. \note Should be moved to TOutputProperties.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*-- カメラサイズ --*/
|
|
Toshihiro Shimizu |
890ddd |
TRectD m_cameraBox;
|
|
Toshihiro Shimizu |
890ddd |
/*-- 途中でPreview計算がキャンセルされたときのフラグ --*/
|
|
Toshihiro Shimizu |
890ddd |
int *m_isCanceled;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TRenderSettings();
|
|
Toshihiro Shimizu |
890ddd |
~TRenderSettings();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool operator==(const TRenderSettings &rhs) const;
|
|
Toshihiro Shimizu |
890ddd |
bool operator!=(const TRenderSettings &rhs) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Returns a textual description of all data that can affect the result of a frame computation.
|
|
Toshihiro Shimizu |
890ddd |
std::string toString() const;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TRasterFx declaration
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! TRasterFx is the base class for any \a renderable Toonz Fx.
|
|
Toshihiro Shimizu |
890ddd |
/*!
|
|
Toshihiro Shimizu |
890ddd |
A standard Toonz Fx is roughly composed of 2 parts: one providing the necessary
|
|
Toshihiro Shimizu |
890ddd |
interface for access by a GUI interface (covered by the TFx class, which this class
|
|
Toshihiro Shimizu |
890ddd |
inherits), the other for the actual computation of the fx - which is the focus
|
|
Toshihiro Shimizu |
890ddd |
of the TRasterFx interface.
|
|
Toshihiro Shimizu |
890ddd |
\n\n
|
|
Toshihiro Shimizu |
890ddd |
So, the essential part of this class lies in the compute() and doCompute() methods that
|
|
Toshihiro Shimizu |
890ddd |
are invoked to perform an fx computation. The former method is the publicly accessed one, while
|
|
Toshihiro Shimizu |
890ddd |
the latter is the one that fx writers must reimplement to supply their rendering code.
|
|
Toshihiro Shimizu |
890ddd |
\n
|
|
Toshihiro Shimizu |
890ddd |
The allocateAndCompute() method can be used to automatically allocate the tile to be rendered
|
|
Toshihiro Shimizu |
890ddd |
right before invoking compute().
|
|
Toshihiro Shimizu |
890ddd |
\n\n
|
|
Toshihiro Shimizu |
890ddd |
The dryCompute() / doDryCompute() methods are required by Toonz to perform predictive caching
|
|
Toshihiro Shimizu |
890ddd |
in order to minimize needless recomputations of the same fx. Fx writers must reimplement
|
|
Toshihiro Shimizu |
890ddd |
doDryCompute() to mimic the behaviour of doCompute() in terms of compute() invocations for children
|
|
Toshihiro Shimizu |
890ddd |
fx nodes. Those compute() invocations must be replaced with dryCompute().
|
|
Toshihiro Shimizu |
890ddd |
\n\n
|
|
Toshihiro Shimizu |
890ddd |
The getBBox() / doGetBBox() methods are used to obtain the geometry of the maximal output that an
|
|
Toshihiro Shimizu |
890ddd |
fx can produce with similar inputs to compute(). Again, doCompute() is the method to reimplement
|
|
Toshihiro Shimizu |
890ddd |
by subclasses. Observe that, unlike doCompute() and doDryCompute(), in this case the affine supplied
|
|
Toshihiro Shimizu |
890ddd |
with the render settings must be \b ignored (see the method itself for further details).
|
|
Toshihiro Shimizu |
890ddd |
\n\n
|
|
Toshihiro Shimizu |
890ddd |
The canHandle() / handledAffine() methods are used by the compute() function to separate the part of
|
|
Toshihiro Shimizu |
890ddd |
an affine that the doCompute() can apply to the result on its own from the rest (which is automatically
|
|
Toshihiro Shimizu |
890ddd |
applied on the fx result using TRasterFx::applyAffine() ).
|
|
Toshihiro Shimizu |
890ddd |
Note that every Toonz fx should be able to handle at least the scale part of an affine (applying
|
|
Toshihiro Shimizu |
890ddd |
TRasterFx::applyAffine() on image enlargements typically hampers image quality).
|
|
Toshihiro Shimizu |
890ddd |
\n\n
|
|
Toshihiro Shimizu |
890ddd |
Further methods whose reimplementation depends on the fx itself are getAlias(), which must return
|
|
Toshihiro Shimizu |
890ddd |
a string uniquely descripting a rendered object, and getMemoryRequirement() to declare the amount of
|
|
Toshihiro Shimizu |
890ddd |
memory that will be used by the fx.
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TRasterFx : public TFx
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TRasterFxImp;
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxImp *m_rasFxImp;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
virtual void doCompute(TTile &tile,
|
|
Toshihiro Shimizu |
890ddd |
double frame,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &settings) = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void doDryCompute(TRectD &rect,
|
|
Toshihiro Shimizu |
890ddd |
double frame,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TRasterFx();
|
|
Toshihiro Shimizu |
890ddd |
~TRasterFx();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void compute(
|
|
Toshihiro Shimizu |
890ddd |
TTile &tile,
|
|
Toshihiro Shimizu |
890ddd |
double frame,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void compute(TFlash &flash, int frame);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void allocateAndCompute(
|
|
Toshihiro Shimizu |
890ddd |
TTile &tile,
|
|
Toshihiro Shimizu |
890ddd |
const TPointD &pos, const TDimension &size,
|
|
Toshihiro Shimizu |
890ddd |
TRasterP templateRas, double frame,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool doGetBBox(
|
|
Toshihiro Shimizu |
890ddd |
double frame,
|
|
Toshihiro Shimizu |
890ddd |
TRectD &bBox,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &info) = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool getBBox(double frame, TRectD &bBox, const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isCachable() const { return true; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void transform(double frame,
|
|
Toshihiro Shimizu |
890ddd |
int port,
|
|
Toshihiro Shimizu |
890ddd |
const TRectD &rectOnOutput,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &infoOnOutput,
|
|
Toshihiro Shimizu |
890ddd |
TRectD &rectOnInput,
|
|
Toshihiro Shimizu |
890ddd |
TRenderSettings &infoOnInput);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool canHandle(const TRenderSettings &info, double frame) = 0;
|
|
Toshihiro Shimizu |
890ddd |
virtual TAffine handledAffine(const TRenderSettings &info, double frame);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
static TRasterP applyAffine(
|
|
Toshihiro Shimizu |
890ddd |
TTile &tileOut,
|
|
Toshihiro Shimizu |
890ddd |
const TTile &tileIn,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// cache interna all'effetto
|
|
Toshihiro Shimizu |
890ddd |
void enableCache(bool on);
|
|
Toshihiro Shimizu |
890ddd |
bool isCacheEnabled() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// resituisce una stringa che identifica univocamente il sottoalbero
|
|
Toshihiro Shimizu |
890ddd |
// avente come radice l'effetto
|
|
Shinya Kitaoka |
3bfa54 |
virtual std::string getAlias(double frame, const TRenderSettings &info) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual void dryCompute(TRectD &rect,
|
|
Toshihiro Shimizu |
890ddd |
double frame,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual int getMemoryRequirement(const TRectD &rect, double frame, const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Returns the size (MB) of a tile with passed specs. It can be used to supply the
|
|
Toshihiro Shimizu |
890ddd |
//! TRasterFx::getMemoryRequirement info. If rect is empty, returns 0.
|
|
Toshihiro Shimizu |
890ddd |
static int memorySize(const TRectD &rect, int bpp);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool allowUserCacheOnPort(int port) { return true; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isPlugin() const { return false; };
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
friend class FxResourceBuilder;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TZeraryColumnFx;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TPluginInterface
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isPlugin() const { return false; };
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isPluginZerary() const { return false; };
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TSmartPointerT<trasterfx>;</trasterfx>
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TDerivedSmartPointerT<trasterfx, tfx="">;</trasterfx,>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TRasterFxP : public TDerivedSmartPointerT<trasterfx, tfx=""></trasterfx,>
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxP() {}
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxP(TRasterFx *fx) : DerivedSmartPointer(fx) {}
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxP(TFx *fx) : DerivedSmartPointer(TFxP(fx)) {}
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxP(TFxP fx) : DerivedSmartPointer(fx) {}
|
|
Toshihiro Shimizu |
890ddd |
operator TFxP() { return TFxP(m_pointer); }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TFxPortT<trasterfx>;</trasterfx>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
typedef TFxPortT<trasterfx> TRasterFxPort;</trasterfx>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TGeometryFx declaration
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TGeometryFx : public TRasterFx
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFx();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual TAffine getPlacement(double frame) = 0;
|
|
Toshihiro Shimizu |
890ddd |
virtual TAffine getParentPlacement(double frame) = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void doCompute(TTile &tile, double frame, const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
virtual void compute(TFlash &flash, int frame);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool doGetBBox(double frame, TRectD &bbox, const TRenderSettings &info);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool checkTimeRegion() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
3bfa54 |
std::string getAlias(double frame, const TRenderSettings &info) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void transform(double frame,
|
|
Toshihiro Shimizu |
890ddd |
int port,
|
|
Toshihiro Shimizu |
890ddd |
const TRectD &rectOnOutput,
|
|
Toshihiro Shimizu |
890ddd |
const TRenderSettings &infoOnOutput,
|
|
Toshihiro Shimizu |
890ddd |
TRectD &rectOnInput,
|
|
Toshihiro Shimizu |
890ddd |
TRenderSettings &infoOnInput);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TSmartPointerT<tgeometryfx>;</tgeometryfx>
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TDerivedSmartPointerT<tgeometryfx, tfx="">;</tgeometryfx,>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TGeometryFxP : public TDerivedSmartPointerT<tgeometryfx, tfx=""></tgeometryfx,>
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFxP() {}
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFxP(TGeometryFx *fx) : DerivedSmartPointer(fx) {}
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFxP(TFx *fx) : DerivedSmartPointer(fx) {}
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFxP(TFxP fx) : DerivedSmartPointer(fx) {}
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFxP(TRasterFx *fx) : DerivedSmartPointer(TRasterFxP(fx)) {}
|
|
Toshihiro Shimizu |
890ddd |
TGeometryFxP(TRasterFxP fx) : DerivedSmartPointer(fx) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
operator TRasterFxP() { return TRasterFxP(m_pointer); }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TFxPortT<tgeometryfx>;</tgeometryfx>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TGeometryPort : public TFxPortT<tgeometryfx></tgeometryfx>
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TGeometryPort() : TFxPortT<tgeometryfx>(true) {}</tgeometryfx>
|
|
Toshihiro Shimizu |
890ddd |
TAffine getPlacement(double frame)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
return m_fx->getPlacement(frame);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// NaAffineFx declaration
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI NaAffineFx : public TGeometryFx
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
FX_DECLARATION(NaAffineFx)
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
~NaAffineFx() {}
|
|
Toshihiro Shimizu |
890ddd |
NaAffineFx(bool isDpiAffine = false);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TFx *clone(bool recursive) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool canHandle(const TRenderSettings &info, double frame)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
return true;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void compute(TFlash &flash, int frame);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TAffine getPlacement(double frame) { return m_aff; }
|
|
Toshihiro Shimizu |
890ddd |
TAffine getParentPlacement(double frame) { return TAffine(); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void setAffine(const TAffine &aff)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
assert(aff != TAffine());
|
|
Toshihiro Shimizu |
890ddd |
m_aff = aff;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
bool isDpiAffine() const { return m_isDpiAffine; }
|
|
Shinya Kitaoka |
3bfa54 |
std::string getPluginId() const { return std::string(); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxPort m_port;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
TAffine m_aff;
|
|
Toshihiro Shimizu |
890ddd |
bool m_isDpiAffine;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// not implemented
|
|
Toshihiro Shimizu |
890ddd |
NaAffineFx(const NaAffineFx &);
|
|
Toshihiro Shimizu |
890ddd |
NaAffineFx &operator=(const NaAffineFx &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// Global functions
|
|
Toshihiro Shimizu |
890ddd |
//******************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void DVAPI addRenderCache(const std::string &alias, TImageP image);
|
|
Toshihiro Shimizu |
890ddd |
void DVAPI removeRenderCache(const std::string &alias);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(push)
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(disable : 4251)
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(pop)
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|