tahoma2d/toonz/sources/stdfx/ino_blend_add.cpp

34 lines
1.3 KiB
C++
Raw Normal View History

2016-03-19 06:57:51 +13:00
//------------------------------------------------------------
#include "tfxparam.h"
#include "stdfx.h"
#include "ino_common.h"
#include "igs_color_blend.h"
2020-08-07 18:11:19 +12:00
//------------------------------------------------------------
// Regarding computation in linear color space mode is based on the "ComposeAdd"
// plugin fx by DWANGO Co., Ltd. The major difference from the original
// "ComposeAdd" is the "Source is premultiplied" option; the semi-transparent
// pixels are un-premultiplied before converting to linear color space. Also
// modified the transfer functions to use standard gamma correction.
//-------------
2020-08-07 18:11:19 +12:00
2016-03-19 06:57:51 +13:00
/* tnzbase --> Source Files --> tfx --> binaryFx.cppを参照 */
class ino_blend_add final : public TBlendForeBackRasterFx {
2016-06-15 18:43:10 +12:00
FX_PLUGIN_DECLARATION(ino_blend_add)
2020-08-07 18:11:19 +12:00
2016-03-19 06:57:51 +13:00
public:
ino_blend_add() : TBlendForeBackRasterFx(true) {
// expand the opacity range
2016-06-15 18:43:10 +12:00
this->m_opacity->setValueRange(0, 10.0 * ino::param_range());
}
~ino_blend_add() {}
2016-03-19 06:57:51 +13:00
void brendKernel(double& dnr, double& dng, double& dnb, double& dna,
const double upr, double upg, double upb, double upa,
const double up_opacity,
const bool alpha_rendering_sw = true) override {
igs::color::add(dnr, dng, dnb, dna, upr, upg, upb, upa, up_opacity);
2016-06-15 18:43:10 +12:00
}
2016-03-19 06:57:51 +13:00
};
FX_PLUGIN_IDENTIFIER(ino_blend_add, "inoAddFx");