Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TFXDEF_INCLUDED
Toshihiro Shimizu 890ddd
#define TFXDEF_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "traster.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TNZCORE_DLL
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
//----------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TRasterFx;
Toshihiro Shimizu 890ddd
class TRasterFxPort;
Toshihiro Shimizu 890ddd
class ITFxNode;
Toshihiro Shimizu 890ddd
class TParam;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//----------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//  Fx Arguments
Toshihiro Shimizu 890ddd
//
Shinya Kitaoka 120a6e
class DVAPI ITFxArguments {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  ITFxArguments(){};
Shinya Kitaoka 120a6e
  virtual ~ITFxArguments(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual void add(TParam *)        = 0;
Shinya Kitaoka 120a6e
  virtual void add(TRasterFxPort *) = 0;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//----------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//  RasterPort
Toshihiro Shimizu 890ddd
//
Shinya Kitaoka 120a6e
class DVAPI TRasterFxPort {
Shinya Kitaoka 120a6e
  TRasterFx *m_fx;
Shinya Kitaoka 120a6e
  string m_name;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TRasterFxPort(ITFxArguments *args, string name) : m_name(name), m_fx(0) {
Shinya Kitaoka 120a6e
    args->add(this);
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  ~TRasterFxPort(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  string getName() const { return m_name; };
Shinya Kitaoka 120a6e
  TRasterFx *operator->() const {
Shinya Kitaoka 120a6e
    assert(m_fx != 0);
Shinya Kitaoka 120a6e
    return m_fx;
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  bool isConnected() const { return m_fx != 0; };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setRasterFx(TRasterFx *fx) { m_fx = fx; };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  // not implemented
Shinya Kitaoka 120a6e
  TRasterFxPort(const TRasterFxPort &);
Shinya Kitaoka 120a6e
  TRasterFxPort &operator=(const TRasterFxPort &);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//----------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
// RasterFx
Toshihiro Shimizu 890ddd
//
Shinya Kitaoka 120a6e
class DVAPI TRasterFx {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TRasterFx(){};
Shinya Kitaoka 120a6e
  virtual ~TRasterFx(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual bool getBBox(double frame,
Shinya Kitaoka 120a6e
                       TRectD &bBox,  // n.b Input/Output
Shinya Kitaoka 120a6e
                       TPixel32 &bgColor) = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual string getName() const = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual TRect getInvalidRect(const TRect &max) = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual void compute(double frame, const TTile &tile) = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual void allocateAndCompute(double frame, const TDimension size,
Shinya Kitaoka 120a6e
                                  const TPointD &pos, TTile &tile);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  TRasterFx(const TRasterFx &);
Shinya Kitaoka 120a6e
  TRasterFx &operator=(const TRasterFx &);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//----------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif