Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#ifndef ino_common_h
Toshihiro Shimizu 890ddd
#define ino_common_h
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "trop.h"
Toshihiro Shimizu 890ddd
#include "trasterfx.h"
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace ino {
Toshihiro Shimizu 890ddd
/* 一時バッファとの変換機能 */
Shinya Kitaoka 120a6e
void ras_to_arr(const TRasterP in_ras, const int channels,
Shinya Kitaoka 120a6e
                unsigned char *out_arr);
Shinya Kitaoka 120a6e
void arr_to_ras(const unsigned char *in_arr, const int channels,
Shinya Kitaoka 120a6e
                TRasterP out_ras, const int margin);
Shinya Kitaoka 120a6e
void ras_to_vec(const TRasterP ras, const int channels,
Shinya Kitaoka 120a6e
                std::vector<unsigned char=""> &vec);</unsigned>
Shinya Kitaoka 120a6e
void vec_to_ras(std::vector<unsigned char=""> &vec, const int channels,</unsigned>
Shinya Kitaoka 120a6e
                TRasterP ras, const int margin = 0);
Toshihiro Shimizu 890ddd
// void Lx_to_wrap( TRasterP ras );
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/* logのserverアクセスON/OFF,install時設定をするための機能 */
Toshihiro Shimizu 890ddd
/* TEnv::getConfigDir() + "fx_ino_no_log.setup"
Shinya Kitaoka 120a6e
        が存在するとtrueを返す */
Toshihiro Shimizu 890ddd
bool log_enable_sw(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/* toonz6.0.x専用の固定値を返すinline(埋め込み)関数 */
Shinya Kitaoka 120a6e
inline double param_range(void) { return 1.0; }  // 1 or 100%
Shinya Kitaoka 120a6e
inline int channels(void) { return 4; }          // RGBM is 4 channels
Shinya Kitaoka 120a6e
inline int bits(const TRasterP ras) {
Shinya Kitaoka 120a6e
  return ((TRaster64P)ras) ? (std::numeric_limits<unsigned short="">::digits)</unsigned>
Shinya Kitaoka 120a6e
                           : (std::numeric_limits<unsigned char="">::digits);</unsigned>
Toshihiro Shimizu 890ddd
}
Shinya Kitaoka 120a6e
inline int pixel_bits(const TRasterP ras) {
Shinya Kitaoka 120a6e
  return ino::channels() * ino::bits(ras);
Toshihiro Shimizu 890ddd
}
Shinya Kitaoka 120a6e
// inline double pixel_per_mm(void) { return 640. / 12. / 25.4; }
Toshihiro Shimizu 890ddd
inline double pixel_per_mm(void) { return 1.; }
Toshihiro Shimizu 890ddd
// inline double pixel_per_inch(void) { return 640. / 12.; }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class TBlendForeBackRasterFx : public TRasterFx {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  /* FX nodeが無効のときの、表示port番号 */
Shinya Kitaoka 473e70
  int getPreferredInputPort() override { return 1; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  std::string getPluginId() const override { return PLUGIN_PREFIX; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif /* !ino_common_h */