1 #pragma once
2 
3 #ifndef ino_common_h
4 #define ino_common_h
5 
6 #include "trop.h"
7 #include "trasterfx.h"
8 #include "stdfx.h"
9 
10 namespace ino {
11 /* 一時バッファとの変換機能 */
12 void ras_to_arr(const TRasterP in_ras, const int channels,
13                 unsigned char *out_arr);
14 void arr_to_ras(const unsigned char *in_arr, const int channels,
15                 TRasterP out_ras, const int margin);
16 void ras_to_vec(const TRasterP ras, const int channels,
17                 std::vector<unsigned char> &vec);
18 void vec_to_ras(std::vector<unsigned char> &vec, const int channels,
19                 TRasterP ras, const int margin = 0);
20 // void Lx_to_wrap( TRasterP ras );
21 
22 /* logのserverアクセスON/OFF,install時設定をするための機能 */
23 /* TEnv::getConfigDir() + "fx_ino_no_log.setup"
24         が存在するとtrueを返す */
25 bool log_enable_sw(void);
26 
27 /* toonz6.0.x専用の固定値を返すinline(埋め込み)関数 */
param_range(void)28 inline double param_range(void) { return 1.0; }  // 1 or 100%
channels(void)29 inline int channels(void) { return 4; }          // RGBM is 4 channels
bits(const TRasterP ras)30 inline int bits(const TRasterP ras) {
31   return ((TRaster64P)ras) ? (std::numeric_limits<unsigned short>::digits)
32                            : (std::numeric_limits<unsigned char>::digits);
33 }
pixel_bits(const TRasterP ras)34 inline int pixel_bits(const TRasterP ras) {
35   return ino::channels() * ino::bits(ras);
36 }
37 // inline double pixel_per_mm(void) { return 640. / 12. / 25.4; }
pixel_per_mm(void)38 inline double pixel_per_mm(void) { return 1.; }
39 // inline double pixel_per_inch(void) { return 640. / 12.; }
40 }
41 
42 class TBlendForeBackRasterFx : public TRasterFx {
43 public:
44   /* FX nodeが無効のときの、表示port番号 */
getPreferredInputPort()45   int getPreferredInputPort() override { return 1; }
46 
getPluginId()47   std::string getPluginId() const override { return PLUGIN_PREFIX; }
48 };
49 
50 #endif /* !ino_common_h */
51