_factor = (factor/100.0)*5.0;
}
+void Convolution::setOn(bool on)
+{
+ _on = on;
+}
+
void Convolution::Run()
{
- double kernel[] = {0.0,1.0,0.0,1.0,-_factor,1.0,0.0,1.0,0.0};
- _convolve->SetKernel3x3(kernel);
- _convolve->Update();
- _cast->SetInput(_convolve->GetOutput());
- _cast->SetOutputScalarTypeToDouble();
+ if(_on)
+ {
+ double kernel[] = {0.0,1.0,0.0,1.0,-_factor,1.0,0.0,1.0,0.0};
+ _convolve->SetKernel3x3(kernel);
+ _convolve->Update();
+ _cast->SetInput(_convolve->GetOutput());
+ //_cast->SetOutputScalarTypeToDouble();
+ _cast->Update();
+ }
+ else
+ {
+ _cast->SetInput(_image);
+ _cast->SetOutputScalarType(_image->GetScalarType());
+ _cast->Update();
+ }
}
\ No newline at end of file