Original implementation of Alpha Image filters

Chromakey (to finish), lumakey and alpha fill.
This commit is contained in:
Bruno Herbelin
2022-06-06 23:33:36 +02:00
parent fec2fb7ce6
commit 1604eaa239
16 changed files with 246 additions and 8 deletions

View File

@@ -747,6 +747,22 @@ void SessionVisitor::visit (EdgeFilter& f)
}
}
void SessionVisitor::visit (AlphaFilter& f)
{
xmlCurrent_->SetAttribute("operation", (int) f.operation());
std::map< std::string, float > filter_params = f.program().parameters();
XMLElement *parameters = xmlDoc_->NewElement( "parameters" );
xmlCurrent_->InsertEndChild(parameters);
for (auto p = filter_params.begin(); p != filter_params.end(); ++p)
{
XMLElement *param = xmlDoc_->NewElement( "uniform" );
param->SetAttribute("name", p->first.c_str() );
param->SetAttribute("value", p->second );
parameters->InsertEndChild(param);
}
}
void SessionVisitor::visit (ImageFilter& f)
{
xmlCurrent_->SetAttribute("name", f.program().name().c_str() );