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