tahoma2d/toonz/sources/stdfx/premultiplyfx.cpp

41 lines
1.1 KiB
C++
Raw Normal View History

2016-03-19 06:57:51 +13:00
#include "stdfx.h"
//#include "tfxparam.h"
#include "trop.h"
//===================================================================
2016-06-15 18:43:10 +12:00
class PremultiplyFx : public TStandardRasterFx {
FX_PLUGIN_DECLARATION(PremultiplyFx)
TRasterFxPort m_input;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
PremultiplyFx() { addInputPort("Source", m_input); }
~PremultiplyFx(){};
bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info) {
if (m_input.isConnected())
return m_input->doGetBBox(frame, bBox, info);
else {
bBox = TRectD();
return false;
}
}
void doCompute(TTile &tile, double frame, const TRenderSettings &ri);
bool canHandle(const TRenderSettings &info, double frame) { return true; }
2016-03-19 06:57:51 +13:00
};
//------------------------------------------------------------------------------
void PremultiplyFx::doCompute(TTile &tile, double frame,
2016-06-15 18:43:10 +12:00
const TRenderSettings &ri) {
if (!m_input.isConnected()) return;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_input->compute(tile, frame, ri);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TRop::premultiply(tile.getRaster());
2016-03-19 06:57:51 +13:00
}
FX_PLUGIN_IDENTIFIER(PremultiplyFx, "premultiplyFx");