diff --git a/CMakeLists.txt b/CMakeLists.txt index 27a82f06..cade7a7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,6 +285,7 @@ SET(SRC_FILTERS src/filters/filter_functions/simpleFilter.cpp src/filters/filter_functions/sdl.cpp src/filters/filter_functions/xBRZ/xbrz.cpp + src/filters/filter_functions/harsh.cpp ) SET(SRC_HQ_C diff --git a/src/filters/filter_factory.cpp b/src/filters/filter_factory.cpp index cda6ac0d..84fc8fc2 100644 --- a/src/filters/filter_factory.cpp +++ b/src/filters/filter_factory.cpp @@ -108,6 +108,10 @@ filter_base * filter_factory::createFilter(std::string filterName,unsigned int w { return new MotionBlurIB(width,height); } + if("Harsh" == filterName) + { + return new harsh(width,height); + } //If nothing found, just return a default filter return new filter_base(width,height); diff --git a/src/filters/filter_functions/harsh.cpp b/src/filters/filter_functions/harsh.cpp new file mode 100644 index 00000000..d0727c1c --- /dev/null +++ b/src/filters/filter_functions/harsh.cpp @@ -0,0 +1,27 @@ +#include "../filters.hpp" + +///Arthur's harsh filter +///All colors are either off or full color +void harsh::run(u32 *srcPtr,u32 *dstPtr) +{ + unsigned int numPixels = this->getWidth() * this->getHeight(); + for(unsigned int i=0;i