Original implementation of Blur Image Filters

With Gaussian, fast Gaussian, Hashed and morphological (opening and closing) methods. Remembering shader code for other fast methods.
This commit is contained in:
Bruno Herbelin
2022-05-31 00:34:37 +02:00
parent 662d8bcfda
commit e3bb95b3dd
27 changed files with 628 additions and 155 deletions

View File

@@ -694,6 +694,22 @@ void SessionVisitor::visit (DelayFilter& f)
xmlCurrent_->SetAttribute("delay", f.delay());
}
void SessionVisitor::visit (BlurFilter& f)
{
xmlCurrent_->SetAttribute("method", (int) f.method());
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() );