tahoma2d/toonz/sources/stdfx/ino_common.h

51 lines
1.7 KiB
C
Raw Normal View History

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