diff options
author | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-06 17:50:18 +0000 |
---|---|---|
committer | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-06 17:50:18 +0000 |
commit | 4d64e4cd434426234a5c313c151cd79b6afc299e (patch) | |
tree | 5c23dd6acc65b869741d3bb9d33912d74bb7407d /Plugins/2colors.cpp |
*** empty log message ***svn2git-root
svn path=/trunk/Framestein/; revision=27
Diffstat (limited to 'Plugins/2colors.cpp')
-rw-r--r-- | Plugins/2colors.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Plugins/2colors.cpp b/Plugins/2colors.cpp new file mode 100644 index 0000000..b76be62 --- /dev/null +++ b/Plugins/2colors.cpp @@ -0,0 +1,21 @@ +#include <stdlib.h> +#include "plugin.h" +#include "pixels.h" + +// 2colors: make the image consist of black and white pixels only. +// I haven't tested this yet and it most likely WILL NOT WORK!!! + +void perform_effect(_frame f, _args a) +{ + pixels p(f); + int i=127, o; // intensity + + if(a.s) i=atoi(a.s); + + while(!p.eof()) + { + o = (p.red() + p.green() + p.blue()) / 3; + if(i<o) p.putrgb(0, 0, 0); else p.putrgb(255, 255, 255); + p.next(); + } +} |