|
Toshihiro Shimizu |
890ddd |
#include <sstream> /* std::ostringstream */</sstream>
|
|
Toshihiro Shimizu |
890ddd |
#include "tfxparam.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "stdfx.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tparamset.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "ino_common.h"
|
|
Toshihiro Shimizu |
890ddd |
//------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
class ino_level_rgba : public TStandardRasterFx
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
FX_PLUGIN_DECLARATION(ino_level_rgba)
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxPort m_input;
|
|
Toshihiro Shimizu |
890ddd |
TRasterFxPort m_refer;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_red_in;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_red_out;
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamP m_red_gamma;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_gre_in;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_gre_out;
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamP m_gre_gamma;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_blu_in;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_blu_out;
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamP m_blu_gamma;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_alp_in;
|
|
Toshihiro Shimizu |
890ddd |
TRangeParamP m_alp_out;
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamP m_alp_gamma;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TBoolParamP m_anti_alias;
|
|
Toshihiro Shimizu |
890ddd |
TIntEnumParamP m_ref_mode;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
ino_level_rgba()
|
|
Toshihiro Shimizu |
890ddd |
: m_red_in(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_red_out(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_red_gamma(1.0 * ino::param_range()), m_gre_in(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_gre_out(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_gre_gamma(1.0 * ino::param_range()), m_blu_in(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_blu_out(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_blu_gamma(1.0 * ino::param_range()), m_alp_in(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_alp_out(DoublePair(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range())),
|
|
Toshihiro Shimizu |
890ddd |
m_alp_gamma(1.0 * ino::param_range())
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
m_anti_alias(true), m_ref_mode(new TIntEnumParam(0, "Red"))
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
addInputPort("Source", this->m_input);
|
|
Toshihiro Shimizu |
890ddd |
addInputPort("Reference", this->m_refer);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "red_in", this->m_red_in);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "red_out", this->m_red_out);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "red_gamma", this->m_red_gamma);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "gre_in", this->m_gre_in);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "gre_out", this->m_gre_out);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "gre_gamma", this->m_gre_gamma);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "blu_in", this->m_blu_in);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "blu_out", this->m_blu_out);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "blu_gamma", this->m_blu_gamma);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "alp_in", this->m_alp_in);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "alp_out", this->m_alp_out);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "alp_gamma", this->m_alp_gamma);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "anti_alias", this->m_anti_alias);
|
|
Toshihiro Shimizu |
890ddd |
bindParam(this, "reference", this->m_ref_mode);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
this->m_red_in->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_red_in->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_red_out->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_red_out->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_red_gamma->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.1 * ino::param_range(), 10.0 * ino::param_range()); /* red_gamma値 */
|
|
Toshihiro Shimizu |
890ddd |
this->m_gre_in->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_gre_in->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_gre_out->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_gre_out->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_gre_gamma->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.1 * ino::param_range(), 10.0 * ino::param_range()); /* gre_gamma値 */
|
|
Toshihiro Shimizu |
890ddd |
this->m_blu_in->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_blu_in->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_blu_out->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_blu_out->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_blu_gamma->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.1 * ino::param_range(), 10.0 * ino::param_range()); /* blu_gamma値 */
|
|
Toshihiro Shimizu |
890ddd |
this->m_alp_in->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_alp_in->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_alp_out->getMin()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_alp_out->getMax()->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.0 * ino::param_range(), 1.0 * ino::param_range());
|
|
Toshihiro Shimizu |
890ddd |
this->m_alp_gamma->setValueRange(
|
|
Toshihiro Shimizu |
890ddd |
0.1 * ino::param_range(), 10.0 * ino::param_range()); /* alp_gamma値 */
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
this->m_ref_mode->addItem(1, "Green");
|
|
Toshihiro Shimizu |
890ddd |
this->m_ref_mode->addItem(2, "Blue");
|
|
Toshihiro Shimizu |
890ddd |
this->m_ref_mode->addItem(3, "Alpha");
|
|
Toshihiro Shimizu |
890ddd |
this->m_ref_mode->addItem(4, "Luminance");
|
|
Toshihiro Shimizu |
890ddd |
this->m_ref_mode->addItem(-1, "Nothing");
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
if (this->m_input.isConnected()) {
|
|
Toshihiro Shimizu |
890ddd |
return this->m_input->doGetBBox(frame, bBox, info);
|
|
Toshihiro Shimizu |
890ddd |
} else {
|
|
Toshihiro Shimizu |
890ddd |
bBox = TRectD();
|
|
Toshihiro Shimizu |
890ddd |
return false;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
bool canHandle(const TRenderSettings &info, double frame)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
return true;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
void doCompute(
|
|
Toshihiro Shimizu |
890ddd |
TTile &tile, double frame, const TRenderSettings &rend_sets);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
FX_PLUGIN_IDENTIFIER(ino_level_rgba, "inoLevelrgbaFx");
|
|
Toshihiro Shimizu |
890ddd |
//------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
#include "igs_levels.h"
|
|
Toshihiro Shimizu |
890ddd |
void ino_level_rgba::doCompute(
|
|
Toshihiro Shimizu |
890ddd |
TTile &tile, double frame, const TRenderSettings &rend_sets)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
/* ------ 接続していなければ処理しない -------------------- */
|
|
Toshihiro Shimizu |
890ddd |
if (!this->m_input.isConnected()) {
|
|
Toshihiro Shimizu |
890ddd |
tile.getRaster()->clear(); /* 塗りつぶしクリア */
|
|
Toshihiro Shimizu |
890ddd |
return;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/* ------ サポートしていないPixelタイプはエラーを投げる --- */
|
|
Toshihiro Shimizu |
890ddd |
if (!((TRaster32P)tile.getRaster()) &&
|
|
Toshihiro Shimizu |
890ddd |
!((TRaster64P)tile.getRaster())) {
|
|
Toshihiro Shimizu |
890ddd |
throw TRopException("unsupported input pixel type");
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/* ------ 動作パラメータを得る ---------------------------- */
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_red_in = this->m_red_in->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_red_out = this->m_red_out->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
double red_gamma = this->m_red_gamma->getValue(frame) /
|
|
Toshihiro Shimizu |
890ddd |
ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_red_in.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_red_in.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_red_out.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_red_out.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_gre_in = this->m_gre_in->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_gre_out = this->m_gre_out->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
double gre_gamma = this->m_gre_gamma->getValue(frame) /
|
|
Toshihiro Shimizu |
890ddd |
ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_gre_in.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_gre_in.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_gre_out.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_gre_out.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_blu_in = this->m_blu_in->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_blu_out = this->m_blu_out->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
double blu_gamma = this->m_blu_gamma->getValue(frame) /
|
|
Toshihiro Shimizu |
890ddd |
ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_blu_in.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_blu_in.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_blu_out.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_blu_out.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_alp_in = this->m_alp_in->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
DoublePair v_alp_out = this->m_alp_out->getValue(frame);
|
|
Toshihiro Shimizu |
890ddd |
double alp_gamma = this->m_alp_gamma->getValue(frame) /
|
|
Toshihiro Shimizu |
890ddd |
ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_alp_in.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_alp_in.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_alp_out.first /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
v_alp_out.second /= ino::param_range();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
const bool anti_alias_sw = this->m_anti_alias->getValue();
|
|
Toshihiro Shimizu |
890ddd |
const int ref_mode = this->m_ref_mode->getValue();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/* ------ 画像生成 ---------------------------------------- */
|
|
Toshihiro Shimizu |
890ddd |
this->m_input->compute(tile, frame, rend_sets);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*------ 参照画像生成 --------------------------------------*/
|
|
Toshihiro Shimizu |
890ddd |
TTile reference_tile;
|
|
Toshihiro Shimizu |
890ddd |
bool reference_sw = false;
|
|
Toshihiro Shimizu |
890ddd |
if (this->m_refer.isConnected()) {
|
|
Toshihiro Shimizu |
890ddd |
reference_sw = true;
|
|
Toshihiro Shimizu |
890ddd |
this->m_refer->allocateAndCompute(
|
|
Toshihiro Shimizu |
890ddd |
reference_tile, tile.m_pos, TDimensionI(/* Pixel単位 */
|
|
Toshihiro Shimizu |
890ddd |
tile.getRaster()->getLx(), tile.getRaster()->getLy()),
|
|
Toshihiro Shimizu |
890ddd |
tile.getRaster(), frame, rend_sets);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/* ------ (app_begin)log記憶 ------------------------------ */
|
|
Toshihiro Shimizu |
890ddd |
const bool log_sw = ino::log_enable_sw();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
if (log_sw) {
|
|
Toshihiro Shimizu |
890ddd |
std::ostringstream os;
|
|
Toshihiro Shimizu |
890ddd |
os << "params"
|
|
Toshihiro Shimizu |
890ddd |
<< " red_in_min " << v_red_in.first
|
|
Toshihiro Shimizu |
890ddd |
<< " red_in_max " << v_red_in.second
|
|
Toshihiro Shimizu |
890ddd |
<< " red_out_min " << v_red_out.first
|
|
Toshihiro Shimizu |
890ddd |
<< " red_out_max " << v_red_out.second
|
|
Toshihiro Shimizu |
890ddd |
<< " red_gamma " << red_gamma
|
|
Toshihiro Shimizu |
890ddd |
<< " gre_in_min " << v_gre_in.first
|
|
Toshihiro Shimizu |
890ddd |
<< " gre_in_max " << v_gre_in.second
|
|
Toshihiro Shimizu |
890ddd |
<< " gre_out_min " << v_gre_out.first
|
|
Toshihiro Shimizu |
890ddd |
<< " gre_out_max " << v_gre_out.second
|
|
Toshihiro Shimizu |
890ddd |
<< " gre_gamma " << gre_gamma
|
|
Toshihiro Shimizu |
890ddd |
<< " blu_in_min " << v_blu_in.first
|
|
Toshihiro Shimizu |
890ddd |
<< " blu_in_max " << v_blu_in.second
|
|
Toshihiro Shimizu |
890ddd |
<< " blu_out_min " << v_blu_out.first
|
|
Toshihiro Shimizu |
890ddd |
<< " blu_out_max " << v_blu_out.second
|
|
Toshihiro Shimizu |
890ddd |
<< " blu_gamma " << blu_gamma
|
|
Toshihiro Shimizu |
890ddd |
<< " alp_in_min " << v_alp_in.first
|
|
Toshihiro Shimizu |
890ddd |
<< " alp_in_max " << v_alp_in.second
|
|
Toshihiro Shimizu |
890ddd |
<< " alp_out_min " << v_alp_out.first
|
|
Toshihiro Shimizu |
890ddd |
<< " alp_out_max " << v_alp_out.second
|
|
Toshihiro Shimizu |
890ddd |
<< " alp_gamma " << alp_gamma
|
|
Toshihiro Shimizu |
890ddd |
<< " anti_alias " << anti_alias_sw
|
|
Toshihiro Shimizu |
890ddd |
<< " reference " << ref_mode
|
|
Toshihiro Shimizu |
890ddd |
<< " tile w " << tile.getRaster()->getLx()
|
|
Toshihiro Shimizu |
890ddd |
<< " h " << tile.getRaster()->getLy()
|
|
Toshihiro Shimizu |
890ddd |
<< " pixbits " << ino::pixel_bits(tile.getRaster())
|
|
Toshihiro Shimizu |
890ddd |
<< " frame " << frame;
|
|
Toshihiro Shimizu |
890ddd |
if (reference_sw) {
|
|
Toshihiro Shimizu |
890ddd |
os
|
|
Toshihiro Shimizu |
890ddd |
<< " reference_tile.m_pos " << reference_tile.m_pos
|
|
Toshihiro Shimizu |
890ddd |
<< " reference_tile_getLx " << reference_tile.getRaster()->getLx()
|
|
Toshihiro Shimizu |
890ddd |
<< " y " << reference_tile.getRaster()->getLy();
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
/* ------ fx処理 ------------------------------------------ */
|
|
Toshihiro Shimizu |
890ddd |
try {
|
|
Toshihiro Shimizu |
890ddd |
TRasterP in_ras = tile.getRaster();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
in_ras->lock();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TRasterGR8P in_gr8(
|
|
Toshihiro Shimizu |
890ddd |
in_ras->getLy(), in_ras->getLx() * ino::channels() *
|
|
Toshihiro Shimizu |
890ddd |
((TRaster64P)in_ras ? sizeof(unsigned short) : sizeof(unsigned char)));
|
|
Toshihiro Shimizu |
890ddd |
in_gr8->lock();
|
|
Toshihiro Shimizu |
890ddd |
ino::ras_to_arr(in_ras, ino::channels(), in_gr8->getRawData());
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
const TRasterP refer_ras = (reference_sw ? reference_tile.getRaster() : nullptr);
|
|
Toshihiro Shimizu |
890ddd |
igs::levels::change(
|
|
Toshihiro Shimizu |
890ddd |
in_gr8->getRawData()
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
in_ras->getLy(), in_ras->getLx() // Not use in_ras->getWrap()
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
ino::channels(), ino::bits(in_ras)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
(((0 <= ref_mode) && refer_ras) ? refer_ras->getRawData() : 0) // BGRA
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
(((0 <= ref_mode) && refer_ras) ? ino::bits(refer_ras) : 0), ref_mode
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
v_red_in.first, v_red_in.second, v_gre_in.first, v_gre_in.second, v_blu_in.first, v_blu_in.second, v_alp_in.first, v_alp_in.second, red_gamma, gre_gamma, blu_gamma, alp_gamma, v_red_out.first, v_red_out.second, v_gre_out.first, v_gre_out.second, v_blu_out.first, v_blu_out.second, v_alp_out.first, v_alp_out.second
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
true // clamp_sw
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
true // alpha_rendering_sw
|
|
Toshihiro Shimizu |
890ddd |
,
|
|
Toshihiro Shimizu |
890ddd |
anti_alias_sw // --> add_blend_sw, default is true
|
|
Toshihiro Shimizu |
890ddd |
);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
|
Toshihiro Shimizu |
890ddd |
in_gr8->unlock();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
in_ras->unlock();
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
/* ------ error処理 --------------------------------------- */
|
|
Toshihiro Shimizu |
890ddd |
catch (std::bad_alloc &e) {
|
|
Toshihiro Shimizu |
890ddd |
tile.getRaster()->unlock();
|
|
Toshihiro Shimizu |
890ddd |
if (log_sw) {
|
|
Toshihiro Shimizu |
890ddd |
std::string str("std::bad_alloc <");
|
|
Toshihiro Shimizu |
890ddd |
str += e.what();
|
|
Toshihiro Shimizu |
890ddd |
str += '>';
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
throw;
|
|
Toshihiro Shimizu |
890ddd |
} catch (std::exception &e) {
|
|
Toshihiro Shimizu |
890ddd |
tile.getRaster()->unlock();
|
|
Toshihiro Shimizu |
890ddd |
if (log_sw) {
|
|
Toshihiro Shimizu |
890ddd |
std::string str("exception <");
|
|
Toshihiro Shimizu |
890ddd |
str += e.what();
|
|
Toshihiro Shimizu |
890ddd |
str += '>';
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
throw;
|
|
Toshihiro Shimizu |
890ddd |
} catch (...) {
|
|
Toshihiro Shimizu |
890ddd |
tile.getRaster()->unlock();
|
|
Toshihiro Shimizu |
890ddd |
if (log_sw) {
|
|
Toshihiro Shimizu |
890ddd |
std::string str("other exception");
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
throw;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|