aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdrian Bowyer <adrian@reprappro.com>2016-09-12 10:45:04 +0100
committerAdrian Bowyer <adrian@reprappro.com>2016-09-12 10:45:04 +0100
commit19f2a694456d73016e477949794423323ed21946 (patch)
tree56f5e72e5da946660cc1090cdb0c6a2a0bb5e019 /src
parent167b7f402f605ff0b6eb34adee4609cec8d4b95d (diff)
Reichardt filter added properly to menus etc.
Diffstat (limited to 'src')
-rw-r--r--src/.deps/camorama-filter-mirror.Po40
-rw-r--r--src/.deps/camorama-filter-reichardt.Po469
-rw-r--r--src/Makefile3
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile.in3
-rw-r--r--src/callbacks.h1
-rw-r--r--src/callbacks.obin111296 -> 111296 bytes
-rwxr-xr-xsrc/camoramabin349384 -> 355392 bytes
-rw-r--r--src/camorama-filter-mirror.c170
-rw-r--r--src/camorama-filter-mirror.c.original70
-rw-r--r--src/camorama-filter-mirror.obin27656 -> 16088 bytes
-rw-r--r--src/camorama-filter-reichardt.c (renamed from src/camorama-filter-mirror.c~)45
-rw-r--r--src/camorama-filter-reichardt.obin0 -> 28152 bytes
-rw-r--r--src/camorama-window.c~468
-rw-r--r--src/camorama-window.obin137984 -> 137984 bytes
-rw-r--r--src/filter.c1
-rw-r--r--src/filter.c~581
-rw-r--r--src/filter.obin73384 -> 73680 bytes
-rw-r--r--src/main.obin61720 -> 61720 bytes
19 files changed, 1570 insertions, 282 deletions
diff --git a/src/.deps/camorama-filter-mirror.Po b/src/.deps/camorama-filter-mirror.Po
index afc4279..b9314f8 100644
--- a/src/.deps/camorama-filter-mirror.Po
+++ b/src/.deps/camorama-filter-mirror.Po
@@ -122,17 +122,7 @@ camorama-filter-mirror.o: camorama-filter-mirror.c \
/usr/include/locale.h /usr/include/x86_64-linux-gnu/bits/locale.h \
/usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \
/usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/stdlib.h \
- /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/stdio.h \
- /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
- /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
- /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
- /usr/include/x86_64-linux-gnu/bits/stdio.h \
- /usr/include/x86_64-linux-gnu/bits/stdio2.h \
- /usr/include/x86_64-linux-gnu/bits/waitflags.h \
- /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \
- /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
- /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
- /usr/include/x86_64-linux-gnu/bits/stdlib.h
+ /usr/include/x86_64-linux-gnu/bits/string3.h
/usr/include/stdc-predef.h:
@@ -439,31 +429,3 @@ filter.h:
/usr/include/stdlib.h:
/usr/include/x86_64-linux-gnu/bits/string3.h:
-
-/usr/include/stdio.h:
-
-/usr/include/libio.h:
-
-/usr/include/_G_config.h:
-
-/usr/include/wchar.h:
-
-/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
-
-/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
-
-/usr/include/x86_64-linux-gnu/bits/stdio.h:
-
-/usr/include/x86_64-linux-gnu/bits/stdio2.h:
-
-/usr/include/x86_64-linux-gnu/bits/waitflags.h:
-
-/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
-
-/usr/include/alloca.h:
-
-/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
-
-/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
-
-/usr/include/x86_64-linux-gnu/bits/stdlib.h:
diff --git a/src/.deps/camorama-filter-reichardt.Po b/src/.deps/camorama-filter-reichardt.Po
new file mode 100644
index 0000000..1539d07
--- /dev/null
+++ b/src/.deps/camorama-filter-reichardt.Po
@@ -0,0 +1,469 @@
+camorama-filter-reichardt.o: camorama-filter-reichardt.c \
+ /usr/include/stdc-predef.h filter.h /usr/include/glib-2.0/glib-object.h \
+ /usr/include/glib-2.0/gobject/gbinding.h /usr/include/glib-2.0/glib.h \
+ /usr/include/glib-2.0/glib/galloca.h /usr/include/glib-2.0/glib/gtypes.h \
+ /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h \
+ /usr/include/glib-2.0/glib/gmacros.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h \
+ /usr/include/glib-2.0/glib/gversionmacros.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/xlocale.h \
+ /usr/include/glib-2.0/glib/garray.h \
+ /usr/include/glib-2.0/glib/gasyncqueue.h \
+ /usr/include/glib-2.0/glib/gthread.h \
+ /usr/include/glib-2.0/glib/gatomic.h /usr/include/glib-2.0/glib/gerror.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/glib-2.0/glib/gquark.h /usr/include/glib-2.0/glib/gutils.h \
+ /usr/include/glib-2.0/glib/gbacktrace.h /usr/include/signal.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/signum.h \
+ /usr/include/x86_64-linux-gnu/bits/siginfo.h \
+ /usr/include/x86_64-linux-gnu/bits/sigaction.h \
+ /usr/include/x86_64-linux-gnu/bits/sigcontext.h \
+ /usr/include/x86_64-linux-gnu/bits/sigstack.h \
+ /usr/include/x86_64-linux-gnu/sys/ucontext.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
+ /usr/include/x86_64-linux-gnu/bits/sigthread.h \
+ /usr/include/glib-2.0/glib/gbase64.h \
+ /usr/include/glib-2.0/glib/gbitlock.h \
+ /usr/include/glib-2.0/glib/gbookmarkfile.h \
+ /usr/include/glib-2.0/glib/gbytes.h \
+ /usr/include/glib-2.0/glib/gcharset.h \
+ /usr/include/glib-2.0/glib/gchecksum.h \
+ /usr/include/glib-2.0/glib/gconvert.h \
+ /usr/include/glib-2.0/glib/gdataset.h /usr/include/glib-2.0/glib/gdate.h \
+ /usr/include/glib-2.0/glib/gdatetime.h \
+ /usr/include/glib-2.0/glib/gtimezone.h /usr/include/glib-2.0/glib/gdir.h \
+ /usr/include/dirent.h /usr/include/x86_64-linux-gnu/bits/dirent.h \
+ /usr/include/glib-2.0/glib/genviron.h \
+ /usr/include/glib-2.0/glib/gfileutils.h \
+ /usr/include/glib-2.0/glib/ggettext.h /usr/include/glib-2.0/glib/ghash.h \
+ /usr/include/glib-2.0/glib/glist.h /usr/include/glib-2.0/glib/gmem.h \
+ /usr/include/glib-2.0/glib/gnode.h /usr/include/glib-2.0/glib/ghmac.h \
+ /usr/include/glib-2.0/glib/gchecksum.h \
+ /usr/include/glib-2.0/glib/ghook.h \
+ /usr/include/glib-2.0/glib/ghostutils.h \
+ /usr/include/glib-2.0/glib/giochannel.h \
+ /usr/include/glib-2.0/glib/gmain.h /usr/include/glib-2.0/glib/gpoll.h \
+ /usr/include/glib-2.0/glib/gslist.h /usr/include/glib-2.0/glib/gstring.h \
+ /usr/include/glib-2.0/glib/gunicode.h \
+ /usr/include/glib-2.0/glib/gkeyfile.h \
+ /usr/include/glib-2.0/glib/gmappedfile.h \
+ /usr/include/glib-2.0/glib/gmarkup.h \
+ /usr/include/glib-2.0/glib/gmessages.h \
+ /usr/include/glib-2.0/glib/goption.h \
+ /usr/include/glib-2.0/glib/gpattern.h \
+ /usr/include/glib-2.0/glib/gprimes.h /usr/include/glib-2.0/glib/gqsort.h \
+ /usr/include/glib-2.0/glib/gqueue.h /usr/include/glib-2.0/glib/grand.h \
+ /usr/include/glib-2.0/glib/gregex.h \
+ /usr/include/glib-2.0/glib/gscanner.h \
+ /usr/include/glib-2.0/glib/gsequence.h \
+ /usr/include/glib-2.0/glib/gshell.h /usr/include/glib-2.0/glib/gslice.h \
+ /usr/include/glib-2.0/glib/gspawn.h \
+ /usr/include/glib-2.0/glib/gstrfuncs.h \
+ /usr/include/glib-2.0/glib/gstringchunk.h \
+ /usr/include/glib-2.0/glib/gtestutils.h \
+ /usr/include/glib-2.0/glib/gthreadpool.h \
+ /usr/include/glib-2.0/glib/gtimer.h \
+ /usr/include/glib-2.0/glib/gtrashstack.h \
+ /usr/include/glib-2.0/glib/gtree.h \
+ /usr/include/glib-2.0/glib/gurifuncs.h \
+ /usr/include/glib-2.0/glib/gvarianttype.h \
+ /usr/include/glib-2.0/glib/gvariant.h \
+ /usr/include/glib-2.0/glib/gversion.h \
+ /usr/include/glib-2.0/glib/deprecated/gallocator.h \
+ /usr/include/glib-2.0/glib/deprecated/gcache.h \
+ /usr/include/glib-2.0/glib/deprecated/gcompletion.h \
+ /usr/include/glib-2.0/glib/deprecated/gmain.h \
+ /usr/include/glib-2.0/glib/deprecated/grel.h \
+ /usr/include/glib-2.0/glib/deprecated/gthread.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h /usr/include/pthread.h \
+ /usr/include/sched.h /usr/include/x86_64-linux-gnu/bits/sched.h \
+ /usr/include/x86_64-linux-gnu/bits/setjmp.h \
+ /usr/include/glib-2.0/glib/glib-autocleanups.h \
+ /usr/include/glib-2.0/gobject/gobject.h \
+ /usr/include/glib-2.0/gobject/gtype.h \
+ /usr/include/glib-2.0/gobject/gvalue.h \
+ /usr/include/glib-2.0/gobject/gparam.h \
+ /usr/include/glib-2.0/gobject/gclosure.h \
+ /usr/include/glib-2.0/gobject/gsignal.h \
+ /usr/include/glib-2.0/gobject/gmarshal.h \
+ /usr/include/glib-2.0/gobject/gboxed.h \
+ /usr/include/glib-2.0/gobject/glib-types.h \
+ /usr/include/glib-2.0/gobject/genums.h \
+ /usr/include/glib-2.0/gobject/gparamspecs.h \
+ /usr/include/glib-2.0/gobject/gsourceclosure.h \
+ /usr/include/glib-2.0/gobject/gtypemodule.h \
+ /usr/include/glib-2.0/gobject/gtypeplugin.h \
+ /usr/include/glib-2.0/gobject/gvaluearray.h \
+ /usr/include/glib-2.0/gobject/gvaluetypes.h \
+ /usr/include/glib-2.0/gobject/gobject-autocleanups.h ../config.h \
+ /usr/include/glib-2.0/glib/gi18n.h /usr/include/libintl.h \
+ /usr/include/locale.h /usr/include/x86_64-linux-gnu/bits/locale.h \
+ /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/stdlib.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/stdio.h \
+ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h
+
+/usr/include/stdc-predef.h:
+
+filter.h:
+
+/usr/include/glib-2.0/glib-object.h:
+
+/usr/include/glib-2.0/gobject/gbinding.h:
+
+/usr/include/glib-2.0/glib.h:
+
+/usr/include/glib-2.0/glib/galloca.h:
+
+/usr/include/glib-2.0/glib/gtypes.h:
+
+/usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:
+
+/usr/include/glib-2.0/glib/gmacros.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+/usr/include/glib-2.0/glib/gversionmacros.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/glib-2.0/glib/garray.h:
+
+/usr/include/glib-2.0/glib/gasyncqueue.h:
+
+/usr/include/glib-2.0/glib/gthread.h:
+
+/usr/include/glib-2.0/glib/gatomic.h:
+
+/usr/include/glib-2.0/glib/gerror.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/glib-2.0/glib/gquark.h:
+
+/usr/include/glib-2.0/glib/gutils.h:
+
+/usr/include/glib-2.0/glib/gbacktrace.h:
+
+/usr/include/signal.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/signum.h:
+
+/usr/include/x86_64-linux-gnu/bits/siginfo.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigaction.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigcontext.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigstack.h:
+
+/usr/include/x86_64-linux-gnu/sys/ucontext.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigthread.h:
+
+/usr/include/glib-2.0/glib/gbase64.h:
+
+/usr/include/glib-2.0/glib/gbitlock.h:
+
+/usr/include/glib-2.0/glib/gbookmarkfile.h:
+
+/usr/include/glib-2.0/glib/gbytes.h:
+
+/usr/include/glib-2.0/glib/gcharset.h:
+
+/usr/include/glib-2.0/glib/gchecksum.h:
+
+/usr/include/glib-2.0/glib/gconvert.h:
+
+/usr/include/glib-2.0/glib/gdataset.h:
+
+/usr/include/glib-2.0/glib/gdate.h:
+
+/usr/include/glib-2.0/glib/gdatetime.h:
+
+/usr/include/glib-2.0/glib/gtimezone.h:
+
+/usr/include/glib-2.0/glib/gdir.h:
+
+/usr/include/dirent.h:
+
+/usr/include/x86_64-linux-gnu/bits/dirent.h:
+
+/usr/include/glib-2.0/glib/genviron.h:
+
+/usr/include/glib-2.0/glib/gfileutils.h:
+
+/usr/include/glib-2.0/glib/ggettext.h:
+
+/usr/include/glib-2.0/glib/ghash.h:
+
+/usr/include/glib-2.0/glib/glist.h:
+
+/usr/include/glib-2.0/glib/gmem.h:
+
+/usr/include/glib-2.0/glib/gnode.h:
+
+/usr/include/glib-2.0/glib/ghmac.h:
+
+/usr/include/glib-2.0/glib/gchecksum.h:
+
+/usr/include/glib-2.0/glib/ghook.h:
+
+/usr/include/glib-2.0/glib/ghostutils.h:
+
+/usr/include/glib-2.0/glib/giochannel.h:
+
+/usr/include/glib-2.0/glib/gmain.h:
+
+/usr/include/glib-2.0/glib/gpoll.h:
+
+/usr/include/glib-2.0/glib/gslist.h:
+
+/usr/include/glib-2.0/glib/gstring.h:
+
+/usr/include/glib-2.0/glib/gunicode.h:
+
+/usr/include/glib-2.0/glib/gkeyfile.h:
+
+/usr/include/glib-2.0/glib/gmappedfile.h:
+
+/usr/include/glib-2.0/glib/gmarkup.h:
+
+/usr/include/glib-2.0/glib/gmessages.h:
+
+/usr/include/glib-2.0/glib/goption.h:
+
+/usr/include/glib-2.0/glib/gpattern.h:
+
+/usr/include/glib-2.0/glib/gprimes.h:
+
+/usr/include/glib-2.0/glib/gqsort.h:
+
+/usr/include/glib-2.0/glib/gqueue.h:
+
+/usr/include/glib-2.0/glib/grand.h:
+
+/usr/include/glib-2.0/glib/gregex.h:
+
+/usr/include/glib-2.0/glib/gscanner.h:
+
+/usr/include/glib-2.0/glib/gsequence.h:
+
+/usr/include/glib-2.0/glib/gshell.h:
+
+/usr/include/glib-2.0/glib/gslice.h:
+
+/usr/include/glib-2.0/glib/gspawn.h:
+
+/usr/include/glib-2.0/glib/gstrfuncs.h:
+
+/usr/include/glib-2.0/glib/gstringchunk.h:
+
+/usr/include/glib-2.0/glib/gtestutils.h:
+
+/usr/include/glib-2.0/glib/gthreadpool.h:
+
+/usr/include/glib-2.0/glib/gtimer.h:
+
+/usr/include/glib-2.0/glib/gtrashstack.h:
+
+/usr/include/glib-2.0/glib/gtree.h:
+
+/usr/include/glib-2.0/glib/gurifuncs.h:
+
+/usr/include/glib-2.0/glib/gvarianttype.h:
+
+/usr/include/glib-2.0/glib/gvariant.h:
+
+/usr/include/glib-2.0/glib/gversion.h:
+
+/usr/include/glib-2.0/glib/deprecated/gallocator.h:
+
+/usr/include/glib-2.0/glib/deprecated/gcache.h:
+
+/usr/include/glib-2.0/glib/deprecated/gcompletion.h:
+
+/usr/include/glib-2.0/glib/deprecated/gmain.h:
+
+/usr/include/glib-2.0/glib/deprecated/grel.h:
+
+/usr/include/glib-2.0/glib/deprecated/gthread.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/pthread.h:
+
+/usr/include/sched.h:
+
+/usr/include/x86_64-linux-gnu/bits/sched.h:
+
+/usr/include/x86_64-linux-gnu/bits/setjmp.h:
+
+/usr/include/glib-2.0/glib/glib-autocleanups.h:
+
+/usr/include/glib-2.0/gobject/gobject.h:
+
+/usr/include/glib-2.0/gobject/gtype.h:
+
+/usr/include/glib-2.0/gobject/gvalue.h:
+
+/usr/include/glib-2.0/gobject/gparam.h:
+
+/usr/include/glib-2.0/gobject/gclosure.h:
+
+/usr/include/glib-2.0/gobject/gsignal.h:
+
+/usr/include/glib-2.0/gobject/gmarshal.h:
+
+/usr/include/glib-2.0/gobject/gboxed.h:
+
+/usr/include/glib-2.0/gobject/glib-types.h:
+
+/usr/include/glib-2.0/gobject/genums.h:
+
+/usr/include/glib-2.0/gobject/gparamspecs.h:
+
+/usr/include/glib-2.0/gobject/gsourceclosure.h:
+
+/usr/include/glib-2.0/gobject/gtypemodule.h:
+
+/usr/include/glib-2.0/gobject/gtypeplugin.h:
+
+/usr/include/glib-2.0/gobject/gvaluearray.h:
+
+/usr/include/glib-2.0/gobject/gvaluetypes.h:
+
+/usr/include/glib-2.0/gobject/gobject-autocleanups.h:
+
+../config.h:
+
+/usr/include/glib-2.0/glib/gi18n.h:
+
+/usr/include/libintl.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+/usr/include/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
diff --git a/src/Makefile b/src/Makefile
index 121093a..b4232ea 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -50,6 +50,7 @@ am_camorama_OBJECTS = callbacks.$(OBJEXT) camorama-display.$(OBJEXT) \
camorama-filter-chain.$(OBJEXT) \
camorama-filter-laplace.$(OBJEXT) \
camorama-filter-mirror.$(OBJEXT) \
+ camorama-filter-reichardt.$(OBJEXT) \
camorama-stock-items.$(OBJEXT) camorama-window.$(OBJEXT) \
filter.$(OBJEXT) main.$(OBJEXT) support.$(OBJEXT) \
v4l.$(OBJEXT) fileio.$(OBJEXT) $(am__objects_1) \
@@ -227,6 +228,7 @@ camorama_SOURCES = \
camorama-filter-chain.h \
camorama-filter-laplace.c \
camorama-filter-mirror.c \
+ camorama-filter-reichardt.c \
camorama-globals.h \
camorama-stock-items.c \
camorama-stock-items.h \
@@ -322,6 +324,7 @@ include ./$(DEPDIR)/camorama-display.Po
include ./$(DEPDIR)/camorama-filter-chain.Po
include ./$(DEPDIR)/camorama-filter-laplace.Po
include ./$(DEPDIR)/camorama-filter-mirror.Po
+include ./$(DEPDIR)/camorama-filter-reichardt.Po
include ./$(DEPDIR)/camorama-stock-items.Po
include ./$(DEPDIR)/camorama-window.Po
include ./$(DEPDIR)/fileio.Po
diff --git a/src/Makefile.am b/src/Makefile.am
index 1531700..d0e6733 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,6 +16,7 @@ camorama_SOURCES = \
camorama-filter-chain.h \
camorama-filter-laplace.c \
camorama-filter-mirror.c \
+ camorama-filter-reichardt.c \
camorama-globals.h \
camorama-stock-items.c \
camorama-stock-items.h \
diff --git a/src/Makefile.in b/src/Makefile.in
index 7d3580c..1062f96 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -50,6 +50,7 @@ am_camorama_OBJECTS = callbacks.$(OBJEXT) camorama-display.$(OBJEXT) \
camorama-filter-chain.$(OBJEXT) \
camorama-filter-laplace.$(OBJEXT) \
camorama-filter-mirror.$(OBJEXT) \
+ camorama-filter-reichardt.$(OBJEXT) \
camorama-stock-items.$(OBJEXT) camorama-window.$(OBJEXT) \
filter.$(OBJEXT) main.$(OBJEXT) support.$(OBJEXT) \
v4l.$(OBJEXT) fileio.$(OBJEXT) $(am__objects_1) \
@@ -227,6 +228,7 @@ camorama_SOURCES = \
camorama-filter-chain.h \
camorama-filter-laplace.c \
camorama-filter-mirror.c \
+ camorama-filter-reichardt.c \
camorama-globals.h \
camorama-stock-items.c \
camorama-stock-items.h \
@@ -322,6 +324,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camorama-filter-chain.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camorama-filter-laplace.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camorama-filter-mirror.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camorama-filter-reichardt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camorama-stock-items.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camorama-window.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileio.Po@am__quote@
diff --git a/src/callbacks.h b/src/callbacks.h
index a4294f9..5954c03 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -55,6 +55,7 @@ void threshold_func1 (GtkToggleButton *, gpointer);
void threshold_ch_func (GtkToggleButton *, gpointer);
void edge_func3 (GtkToggleButton *, gpointer);
void mirror_func (GtkToggleButton *, gpointer);
+void reichardt_func (GtkToggleButton *, gpointer);
void colour_func (GtkToggleButton *, gpointer);
void smooth_func (GtkToggleButton *, gpointer);
void negative_func (GtkToggleButton *, gpointer);
diff --git a/src/callbacks.o b/src/callbacks.o
index 7340932..e1c31d2 100644
--- a/src/callbacks.o
+++ b/src/callbacks.o
Binary files differ
diff --git a/src/camorama b/src/camorama
index 790f30f..1495b00 100755
--- a/src/camorama
+++ b/src/camorama
Binary files differ
diff --git a/src/camorama-filter-mirror.c b/src/camorama-filter-mirror.c
index a9bbd67..41e67a6 100644
--- a/src/camorama-filter-mirror.c
+++ b/src/camorama-filter-mirror.c
@@ -29,9 +29,6 @@
#include <glib/gi18n.h>
-#include <stdio.h>
-#include <stdlib.h>
-
/* GType stuff for CamoramaFilterMirror */
typedef struct _CamoramaFilter CamoramaFilterMirror;
typedef struct _CamoramaFilterClass CamoramaFilterMirrorClass;
@@ -41,162 +38,23 @@ G_DEFINE_TYPE(CamoramaFilterMirror, camorama_filter_mirror, CAMORAMA_TYPE_FILTER
static void
camorama_filter_mirror_init(CamoramaFilterMirror* self) {}
-static gint oldWidth = -1;
-static gint oldHeight = -1;
-static gint oldDepth = -1;
-
-static long *lastSignal = 0;
-static long *lastHigh = 0;
-static long *lastHighThenLow = 0;
-static long *output = 0;
-
-static int lowPassTC = 1;
-static int highPassTC = 10;
-
-static int count = 0;
-
-char debug = 1;
-
-static void MaybeNewMemory(gint width, gint height, gint depth)
-{
- long needed, i, memory;
-
- if(width == oldWidth && height == oldHeight && depth == oldDepth)
- return;
-
- if(lastSignal)
- free(lastSignal);
- if(lastHigh)
- free(lastHigh);
- if(lastHighThenLow)
- free(lastHighThenLow);
- if(output)
- free(output);
-
- if(debug)
- printf("\n\nwidth: %d, height: %d, depth: %d\n\n", width, height, depth);
-
- needed = 5 + (width+1)*(height+1);
- memory = needed*sizeof(long);
- lastSignal = (long *)malloc(memory);
- if (!lastSignal)
- {
- printf("ERROR: Cannot malloc image memory for lastSignal\n");
- return;
- }
- lastHigh = (long *)malloc(memory);
- if (!lastHigh)
- {
- printf("ERROR: Cannot malloc image memory for lastHigh\n");
- return;
- }
- lastHighThenLow = (long *)malloc(memory);
- if (!lastHighThenLow)
- {
- printf("ERROR: Cannot malloc image memory for lastHighThenLow\n");
- return;
- }
- output = (long *)malloc(memory);
- if (!output)
- {
- printf("ERROR: Cannot malloc image memory for output\n");
- return;
- }
- for(i=0; i < needed; i++)
- {
- lastSignal[i] = 127;
- lastHigh[i] = 127;
- lastHighThenLow[i] = 127;
- }
-
- oldWidth = width;
- oldHeight = height;
- oldDepth = depth;
-}
-
-
static void
-camorama_filter_mirror_filter(CamoramaFilter* filter, guchar *image, gint width, gint height, gint depth)
-{
- gint x, y, z, row_length, row, column, thisPixel, thisXY, thatXY;
-
- long signal, thisHigh, thisHighThenLow, thatHigh, thatHighThenLow, thatSignal, newValue, max, min, scale;
-
- MaybeNewMemory(width, height, depth);
-
- max = LONG_MIN;
- min = LONG_MAX;
- thatSignal = 0;
+camorama_filter_mirror_filter(CamoramaFilter* filter, guchar *image, gint width, gint height, gint depth) {
+ gint x, y, z, row_length, image_length, new_row, next_row, half_row, index1, index2;
+ guchar temp;
row_length = width * depth;
- for(y = 0; y < height; y++)
- {
- row = y*row_length;
- for (x = 1; x < width; x++)
- {
- column = x*depth;
- thisPixel = row + column;
- thisXY = y*width+x;
- thatXY = thisXY - 1;
-
- // Go to grey
-
- signal = 0;
- for (z = 0; z < depth; z++)
- {
- signal += image[thisPixel + z];
- }
- signal = signal/depth;
-
- // Apply Reichardt
-
- thisHigh = (highPassTC*(lastHigh[thisXY] + signal - lastSignal[thisXY]))/(highPassTC + 1);
- thisHighThenLow = (thisHigh + lastHighThenLow[thisXY]*lowPassTC)/(lowPassTC + 1);
- thatHigh = (highPassTC*(lastHigh[thatXY] + thatSignal - lastSignal[thatXY]))/(highPassTC + 1);
- thatHighThenLow = (thatHigh + lastHighThenLow[thatXY]*lowPassTC)/(lowPassTC + 1);
-
- newValue = thisHighThenLow*thatHigh - thatHighThenLow*thisHigh;
- output[thisXY] = newValue;
-
- if(newValue > max)
- max = newValue;
- if(newValue < min)
- min = newValue;
-
- // Remember for next time
-
- thatSignal = signal;
- lastHigh[thisXY] = thisHigh;
- lastHighThenLow[thisXY] = thisHighThenLow;
- lastSignal[thisXY] = signal;
- }
- }
- count++;
- if(debug && !(count%50))
- {
- printf("\nmax: %ld, min: %ld\n", max, min);
- }
-
- scale = max - min;
- if(scale == 0)
- scale = 1;
-
- for(y = 0; y < height; y++)
- {
- row = y*row_length;
- for (x = 1; x < width; x++)
- {
- column = x*depth;
- thisPixel = row + column;
- thisXY = y*width+x;
- signal = ((output[thisXY] - min)*255)/scale;
- if(signal > 255)
- signal = 255;
- if(signal < 0)
- signal = 0;
- for (z = 0; z < depth; z++)
- {
- image[thisPixel + z] = (guchar)signal;
+ image_length = row_length * height;
+ half_row = ((width+1)/2)*depth;
+ for(new_row = 0; new_row < image_length; new_row = next_row) { // 0, 320*depth, 640*depth, 960*depth, ...
+ next_row = new_row + row_length;
+ for (x = 0; x < half_row; x+=depth) { // 0, 3, 6, ..., 160*depth
+ index1 = new_row + x; // 0, 3, 6, ..., 160*depth
+ index2 = next_row - x - depth;// 320, 319, 318, ..., 161*depth
+ for (z = 0; z < depth; z++) { // 0, ..., depth
+ temp = image[index1 + z];
+ image[index1 + z] = image[index2 + z];
+ image[index2 + z] = temp;
}
}
}
diff --git a/src/camorama-filter-mirror.c.original b/src/camorama-filter-mirror.c.original
deleted file mode 100644
index 41e67a6..0000000
--- a/src/camorama-filter-mirror.c.original
+++ /dev/null
@@ -1,70 +0,0 @@
-/* This file is part of camorama
- *
- * AUTHORS
- * Sven Herzberg <herzi@gnome-de.org>
- *
- * Copyright (C) 2006 Sven Herzberg <herzi@gnome-de.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#include "filter.h"
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-
-/* GType stuff for CamoramaFilterMirror */
-typedef struct _CamoramaFilter CamoramaFilterMirror;
-typedef struct _CamoramaFilterClass CamoramaFilterMirrorClass;
-
-G_DEFINE_TYPE(CamoramaFilterMirror, camorama_filter_mirror, CAMORAMA_TYPE_FILTER);
-
-static void
-camorama_filter_mirror_init(CamoramaFilterMirror* self) {}
-
-static void
-camorama_filter_mirror_filter(CamoramaFilter* filter, guchar *image, gint width, gint height, gint depth) {
- gint x, y, z, row_length, image_length, new_row, next_row, half_row, index1, index2;
- guchar temp;
-
- row_length = width * depth;
- image_length = row_length * height;
- half_row = ((width+1)/2)*depth;
- for(new_row = 0; new_row < image_length; new_row = next_row) { // 0, 320*depth, 640*depth, 960*depth, ...
- next_row = new_row + row_length;
- for (x = 0; x < half_row; x+=depth) { // 0, 3, 6, ..., 160*depth
- index1 = new_row + x; // 0, 3, 6, ..., 160*depth
- index2 = next_row - x - depth;// 320, 319, 318, ..., 161*depth
- for (z = 0; z < depth; z++) { // 0, ..., depth
- temp = image[index1 + z];
- image[index1 + z] = image[index2 + z];
- image[index2 + z] = temp;
- }
- }
- }
-}
-
-static void
-camorama_filter_mirror_class_init(CamoramaFilterMirrorClass* self_class) {
- self_class->filter = camorama_filter_mirror_filter;
- // TRANSLATORS: This is a noun
- self_class->name = _("Mirror");
-}
-
-
diff --git a/src/camorama-filter-mirror.o b/src/camorama-filter-mirror.o
index e480339..565eb08 100644
--- a/src/camorama-filter-mirror.o
+++ b/src/camorama-filter-mirror.o
Binary files differ
diff --git a/src/camorama-filter-mirror.c~ b/src/camorama-filter-reichardt.c
index 8ee7c4c..1a5e7ac 100644
--- a/src/camorama-filter-mirror.c~
+++ b/src/camorama-filter-reichardt.c
@@ -21,6 +21,16 @@
* USA
*/
+/*
+
+ Reichardt movement detection filter coded by Adrian Bowyer
+
+ 12 September 2016
+
+ http://adrianbowyer.com
+
+*/
+
#include "filter.h"
#ifdef HAVE_CONFIG_H
@@ -32,14 +42,14 @@
#include <stdio.h>
#include <stdlib.h>
-/* GType stuff for CamoramaFilterMirror */
-typedef struct _CamoramaFilter CamoramaFilterMirror;
-typedef struct _CamoramaFilterClass CamoramaFilterMirrorClass;
+/* GType stuff for CamoramaFilterReichardt */
+typedef struct _CamoramaFilter CamoramaFilterReichardt;
+typedef struct _CamoramaFilterClass CamoramaFilterReichardtClass;
-G_DEFINE_TYPE(CamoramaFilterMirror, camorama_filter_mirror, CAMORAMA_TYPE_FILTER);
+G_DEFINE_TYPE(CamoramaFilterReichardt, camorama_filter_reichardt, CAMORAMA_TYPE_FILTER);
static void
-camorama_filter_mirror_init(CamoramaFilterMirror* self) {}
+camorama_filter_reichardt_init(CamoramaFilterReichardt* self) {}
static gint oldWidth = -1;
static gint oldHeight = -1;
@@ -50,12 +60,12 @@ static long *lastHigh = 0;
static long *lastHighThenLow = 0;
static long *output = 0;
-static int lowPassTC = 4;
-static int highPassTC = 10;
+static int lowPassTC = 1;
+static int highPassTC = 5;
static int count = 0;
-char debug = 1;
+char debug = 0;
static void MaybeNewMemory(gint width, gint height, gint depth)
{
@@ -116,7 +126,7 @@ static void MaybeNewMemory(gint width, gint height, gint depth)
static void
-camorama_filter_mirror_filter(CamoramaFilter* filter, guchar *image, gint width, gint height, gint depth)
+camorama_filter_reichardt_filter(CamoramaFilter* filter, guchar *image, gint width, gint height, gint depth)
{
gint x, y, z, row_length, row, column, thisPixel, thisXY, thatXY;
@@ -184,16 +194,17 @@ camorama_filter_mirror_filter(CamoramaFilter* filter, guchar *image, gint width,
for(y = 0; y < height; y++)
{
row = y*row_length;
+ for (z = 0; z < depth; z++)
+ {
+ image[thisPixel + z] = 0;
+ }
for (x = 1; x < width; x++)
{
column = x*depth;
thisPixel = row + column;
thisXY = y*width+x;
- signal = ((output[thisXY] - min)*255)/scale;
- if(signal > 255)
- signal = 255;
- if(signal < 0)
- signal = 0;
+ signal = output[thisXY];
+ signal = ((signal - min)*255)/scale;
for (z = 0; z < depth; z++)
{
image[thisPixel + z] = (guchar)signal;
@@ -203,10 +214,10 @@ camorama_filter_mirror_filter(CamoramaFilter* filter, guchar *image, gint width,
}
static void
-camorama_filter_mirror_class_init(CamoramaFilterMirrorClass* self_class) {
- self_class->filter = camorama_filter_mirror_filter;
+camorama_filter_reichardt_class_init(CamoramaFilterReichardtClass* self_class) {
+ self_class->filter = camorama_filter_reichardt_filter;
// TRANSLATORS: This is a noun
- self_class->name = _("Mirror");
+ self_class->name = _("Reichardt");
}
diff --git a/src/camorama-filter-reichardt.o b/src/camorama-filter-reichardt.o
new file mode 100644
index 0000000..d62020f
--- /dev/null
+++ b/src/camorama-filter-reichardt.o
Binary files differ
diff --git a/src/camorama-window.c~ b/src/camorama-window.c~
new file mode 100644
index 0000000..7d1e49b
--- /dev/null
+++ b/src/camorama-window.c~
@@ -0,0 +1,468 @@
+/* This file is part of camorama
+ *
+ * AUTHORS
+ * Sven Herzberg <herzi@gnome-de.org>
+ *
+ * Copyright (C) 2003 Greg Jones
+ * Copyright (C) 2006 Sven Herzberg <herzi@gnome-de.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#include "camorama-window.h"
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib/gi18n.h>
+#include <libgnomeui/gnome-file-entry.h>
+#include "callbacks.h"
+#include "camorama-filter-chain.h"
+#include "camorama-globals.h"
+#include "camorama-stock-items.h"
+#include "filter.h"
+#include "glib-helpers.h"
+#include "support.h"
+
+static GQuark menu_item_filter_type = 0;
+
+static void
+add_filter_clicked(GtkMenuItem* menuitem, CamoramaFilterChain* chain) {
+ GType filter_type = GPOINTER_TO_SIZE(g_object_get_qdata(G_OBJECT(menuitem), menu_item_filter_type));
+ camorama_filter_chain_append(chain, filter_type);
+}
+
+struct weak_target {
+ GtkTreeModel* model;
+ GList * list;
+};
+
+static void
+reference_path(GtkTreePath* path, struct weak_target* target) {
+ target->list = g_list_prepend(target->list, gtk_tree_row_reference_new(target->model, path));
+}
+
+static void
+delete_filter(GtkTreeRowReference* ref, GtkTreeModel* model) {
+ GtkTreeIter iter;
+ GtkTreePath* path = gtk_tree_row_reference_get_path(ref);
+ gtk_tree_model_get_iter(model, &iter, path);
+ gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+}
+
+static void
+delete_filter_clicked(GtkTreeSelection* sel, GtkMenuItem* menuitem) {
+ GtkTreeModel* model;
+ GList* paths = gtk_tree_selection_get_selected_rows(sel, &model);
+ struct weak_target target = {model, NULL};
+ g_list_foreach(paths, G_FUNC(reference_path), &target);
+ g_list_foreach(target.list, G_FUNC(delete_filter), model);
+ g_list_foreach(target.list, G_FUNC(gtk_tree_row_reference_free), NULL);
+ g_list_free(target.list);
+ g_list_foreach(paths, G_FUNC(gtk_tree_path_free), NULL);
+ g_list_free(paths);
+}
+
+static void
+menu_position_func(GtkMenu* menu, gint* x, gint* y, gboolean *push_in, gpointer user_data) {
+ if(user_data) {
+ GdkEventButton* ev = (GdkEventButton*)user_data;
+ *x = ev->x;
+ *y = ev->y;
+ } else {
+ // find the selected row and open the popup there
+ }
+}
+
+static void
+show_popup(cam* cam, GtkTreeView* treeview, GdkEventButton* ev) {
+ GtkMenu* menu = GTK_MENU(gtk_menu_new());
+ GtkWidget* item;
+ GtkWidget* add_filters = gtk_menu_new();
+ GType* filters;
+ guint n_filters, i;
+ GtkTreeModel* model = gtk_tree_view_get_model(treeview);
+ GtkTreeSelection* sel = gtk_tree_view_get_selection(treeview);
+
+ gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
+
+ item = gtk_menu_item_new_with_mnemonic("_Delete");
+ g_signal_connect_swapped(item, "activate",
+ G_CALLBACK(delete_filter_clicked), sel);
+ gtk_container_add(GTK_CONTAINER(menu), item);
+ gtk_container_add(GTK_CONTAINER(menu), gtk_separator_menu_item_new());
+
+ if(!gtk_tree_selection_count_selected_rows(sel)) {
+ gtk_widget_set_sensitive(item, FALSE);
+ }
+
+ item = gtk_menu_item_new_with_mnemonic(_("_Add Filter"));
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), add_filters);
+ gtk_container_add(GTK_CONTAINER(menu), item);
+
+ filters = g_type_children(CAMORAMA_TYPE_FILTER, &n_filters);
+ for(i = 0; i < n_filters; i++) {
+ CamoramaFilterClass* filter_class = g_type_class_ref(filters[i]);
+ gchar const* filter_name = filter_class->name;
+ printf("\n%s\n", filter_name);
+
+ if(!filter_name) {
+ filter_name = g_type_name(filters[i]);
+ }
+
+ item = gtk_menu_item_new_with_label(filter_name);
+ g_object_set_qdata(G_OBJECT(item), menu_item_filter_type, GSIZE_TO_POINTER(filters[i]));
+ g_signal_connect(item, "activate",
+ G_CALLBACK(add_filter_clicked), model);
+ gtk_container_add(GTK_CONTAINER(add_filters), item);
+ g_type_class_unref(filter_class);
+ }
+ g_free(filters);
+
+ gtk_widget_show_all(GTK_WIDGET(menu));
+ gtk_menu_popup(menu,
+ NULL, NULL,
+ menu_position_func, ev,
+ ev ? ev->button : 0,
+ ev ? ev->time : gtk_get_current_event_time());
+}
+
+static void
+treeview_popup_menu_cb(cam* cam, GtkTreeView* treeview) {
+ show_popup(cam, treeview, NULL);
+}
+
+static gboolean
+treeview_clicked_cb(cam* cam, GdkEventButton* ev, GtkTreeView* treeview) {
+ gboolean retval = GTK_WIDGET_GET_CLASS(treeview)->button_press_event(GTK_WIDGET(treeview), ev);
+
+ if(ev->button == 3) {
+ show_popup(cam, treeview, NULL);
+ retval = TRUE;
+ }
+
+ return retval;
+}
+
+static void
+tray_clicked_callback (GtkStatusIcon* status, guint button, guint activate_time, cam * cam){
+ // FIXME: change to switch
+ if (button == 1) {
+ if (GTK_WIDGET_VISIBLE
+ (glade_xml_get_widget (cam->xml, "main_window"))) {
+ cam->hidden = TRUE;
+ gtk_idle_remove (cam->idle_id);
+ gtk_widget_hide (glade_xml_get_widget
+ (cam->xml, "main_window"));
+ } else {
+ cam->idle_id =
+ gtk_idle_add ((GSourceFunc) pt2Function, (gpointer) cam);
+ gtk_widget_show (glade_xml_get_widget
+ (cam->xml, "main_window"));
+ cam->hidden = FALSE;
+ }
+ } else if (button == 3) {
+
+ //gw = MyApp->GetMainWindow ();
+
+ //gnomemeeting_component_view (NULL, (gpointer) gw->ldap_window);
+
+ }
+}
+
+void
+load_interface(cam* cam) {
+ gchar *title;
+ GdkPixbuf *logo = NULL;
+ GtkTreeView* treeview = GTK_TREE_VIEW(glade_xml_get_widget(cam->xml, "treeview_effects"));
+ GtkCellRenderer* cell;
+
+ menu_item_filter_type = g_quark_from_static_string("camorama-menu-item-filter-type");
+
+ /* set up the tree view */
+ cell = gtk_cell_renderer_text_new();
+ g_object_set(cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(cell), 1);
+ gtk_tree_view_insert_column_with_attributes(treeview, -1,
+ _("Effects"), cell,
+ "text", CAMORAMA_FILTER_CHAIN_COL_NAME,
+ NULL);
+ cam->filter_chain = camorama_filter_chain_new();
+ gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(cam->filter_chain));
+ g_object_unref(cam->filter_chain);
+ g_signal_connect_swapped(treeview, "button-press-event",
+ G_CALLBACK(treeview_clicked_cb), cam);
+ g_signal_connect_swapped(treeview, "popup-menu",
+ G_CALLBACK(treeview_popup_menu_cb), cam);
+
+ logo = gtk_icon_theme_load_icon(gtk_icon_theme_get_for_screen(gtk_widget_get_screen(glade_xml_get_widget(cam->xml, "main_window"))), CAMORAMA_STOCK_WEBCAM, 24, 0, NULL);
+ gtk_window_set_default_icon(logo);
+ logo = gtk_icon_theme_load_icon(gtk_icon_theme_get_for_screen(gtk_widget_get_screen(glade_xml_get_widget(cam->xml, "main_window"))), "camorama", 48, 0, NULL);
+ if (cam->show_adjustments == FALSE) {
+ gtk_widget_hide (glade_xml_get_widget
+ (cam->xml, "adjustments_table"));
+
+ gtk_window_resize (GTK_WINDOW
+ (glade_xml_get_widget
+ (cam->xml, "main_window")), 320, 240);
+ }
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(glade_xml_get_widget(cam->xml, "showadjustment_item")), cam->show_adjustments);
+ if (cam->show_effects == FALSE) {
+ gtk_widget_hide (glade_xml_get_widget (cam->xml, "scrolledwindow_effects"));
+ gtk_window_resize (GTK_WINDOW
+ (glade_xml_get_widget
+ (cam->xml, "main_window")), 320, 240);
+ }
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(glade_xml_get_widget(cam->xml, "show_effects")), cam->show_effects);
+
+ cam->tray_icon = gtk_status_icon_new_from_stock (CAMORAMA_STOCK_WEBCAM);
+ update_tooltip (cam);
+ /* add the status to the plug */
+ g_object_set_data (G_OBJECT (cam->tray_icon), "available",
+ GINT_TO_POINTER (1));
+ g_object_set_data (G_OBJECT (cam->tray_icon), "embedded",
+ GINT_TO_POINTER (0));
+
+ g_signal_connect (cam->tray_icon, "popup-menu",
+ G_CALLBACK (tray_clicked_callback), cam);
+
+ /* connect the signals in the interface
+ * glade_xml_signal_autoconnect(xml);
+ * this won't work, can't pass data to callbacks. have to do it individually :(*/
+
+ title = g_strdup_printf ("Camorama - %s - %dx%d", cam->vid_cap.name,
+ cam->x, cam->y);
+ gtk_window_set_title (GTK_WINDOW
+ (glade_xml_get_widget (cam->xml, "main_window")),
+ title);
+ g_free (title);
+
+ gtk_window_set_icon (GTK_WINDOW
+ (glade_xml_get_widget (cam->xml, "main_window")),
+ logo);
+ gtk_window_set_icon (GTK_WINDOW
+ (glade_xml_get_widget (cam->xml, "prefswindow")),
+ logo);
+
+ glade_xml_signal_connect_data (cam->xml, "on_show_effects_activate",
+ G_CALLBACK (on_show_effects_activate),
+ cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "togglebutton1"),
+ cam->show_adjustments);
+ glade_xml_signal_connect_data (cam->xml,
+ "on_show_adjustments_activate",
+ G_CALLBACK
+ (on_show_adjustments_activate), cam);
+
+ glade_xml_signal_connect_data (cam->xml, "on_large_activate",
+ G_CALLBACK (on_change_size_activate), cam);
+ glade_xml_signal_connect_data (cam->xml, "on_medium_activate",
+ G_CALLBACK (on_change_size_activate), cam);
+ glade_xml_signal_connect_data (cam->xml, "on_small_activate",
+ G_CALLBACK (on_change_size_activate), cam);
+
+ //glade_xml_signal_connect_data(cam->xml, "capture_func", G_CALLBACK(on_change_size_activate), cam);
+ glade_xml_signal_connect_data (cam->xml, "capture_func",
+ G_CALLBACK (capture_func), cam);
+ glade_xml_signal_connect_data (cam->xml, "gtk_main_quit",
+ G_CALLBACK (delete_event), NULL);
+
+ /* sliders */
+ glade_xml_signal_connect_data (cam->xml, "contrast_change",
+ G_CALLBACK (contrast_change), cam);
+ gtk_range_set_value ((GtkRange *)
+ glade_xml_get_widget (cam->xml, "slider2"),
+ (int) (cam->contrast / 256));
+ glade_xml_signal_connect_data (cam->xml, "brightness_change",
+ G_CALLBACK (brightness_change), cam);
+ gtk_range_set_value ((GtkRange *)
+ glade_xml_get_widget (cam->xml, "slider3"),
+ (int) (cam->brightness / 256));
+ glade_xml_signal_connect_data (cam->xml, "colour_change",
+ G_CALLBACK (colour_change), cam);
+ gtk_range_set_value ((GtkRange *)
+ glade_xml_get_widget (cam->xml, "slider4"),
+ (int) (cam->colour / 256));
+ glade_xml_signal_connect_data (cam->xml, "hue_change",
+ G_CALLBACK (hue_change), cam);
+ gtk_range_set_value ((GtkRange *)
+ glade_xml_get_widget (cam->xml, "slider5"),
+ (int) (cam->hue / 256));
+ glade_xml_signal_connect_data (cam->xml, "wb_change",
+ G_CALLBACK (wb_change), cam);
+ gtk_range_set_value ((GtkRange *)
+ glade_xml_get_widget (cam->xml, "slider6"),
+ (int) (cam->wb / 256));
+
+ /* buttons */
+ glade_xml_signal_connect_data (cam->xml, "on_status_show",
+ G_CALLBACK (on_status_show),
+ (gpointer) cam);
+ glade_xml_signal_connect_data (cam->xml, "on_quit_activate",
+ G_CALLBACK (on_quit_activate),
+ (gpointer) cam);
+ glade_xml_signal_connect_data (cam->xml, "on_preferences1_activate",
+ G_CALLBACK (on_preferences1_activate),
+ (gpointer) cam);
+ glade_xml_signal_connect_data (cam->xml, "on_about_activate",
+ G_CALLBACK (on_about_activate),
+ (gpointer) cam);
+
+ /* prefs */
+ glade_xml_signal_connect_data (cam->xml, "prefs_func",
+ G_CALLBACK (prefs_func), cam);
+
+ /* general */
+ glade_xml_signal_connect_data (cam->xml, "cap_func",
+ G_CALLBACK (cap_func), cam);
+
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "captured_cb"),
+ cam->cap);
+
+ glade_xml_signal_connect_data (cam->xml, "rcap_func",
+ G_CALLBACK (rcap_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "rcapture"),
+ cam->rcap);
+
+ glade_xml_signal_connect_data (cam->xml, "acap_func",
+ G_CALLBACK (acap_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "acapture"),
+ cam->acap);
+
+ glade_xml_signal_connect_data (cam->xml, "interval_change",
+ G_CALLBACK (interval_change), cam);
+
+ gtk_spin_button_set_value ((GtkSpinButton *)
+ glade_xml_get_widget (cam->xml,
+ "interval_entry"),
+ (cam->timeout_interval / 60000));
+
+ /* local */
+ dentry = glade_xml_get_widget (cam->xml, "dentry");
+ entry2 = glade_xml_get_widget (cam->xml, "entry2");
+ gtk_entry_set_text (GTK_ENTRY
+ (gnome_file_entry_gtk_entry
+ (GNOME_FILE_ENTRY (dentry))), cam->pixdir);
+
+ gtk_entry_set_text (GTK_ENTRY (entry2), cam->capturefile);
+
+ glade_xml_signal_connect_data (cam->xml, "append_func",
+ G_CALLBACK (append_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "appendbutton"),
+ cam->timefn);
+
+ glade_xml_signal_connect_data (cam->xml, "jpg_func",
+ G_CALLBACK (jpg_func), cam);
+ if (cam->savetype == JPEG) {
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "jpgb"), TRUE);
+ }
+ glade_xml_signal_connect_data (cam->xml, "png_func",
+ G_CALLBACK (png_func), cam);
+ if (cam->savetype == PNG) {
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "pngb"), TRUE);
+ }
+
+ glade_xml_signal_connect_data (cam->xml, "ts_func",
+ G_CALLBACK (ts_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "tsbutton"),
+ cam->timestamp);
+
+ /* remote */
+ login_entry = glade_xml_get_widget (cam->xml, "login_entry");
+ host_entry = glade_xml_get_widget (cam->xml, "host_entry");
+ pw_entry = glade_xml_get_widget (cam->xml, "pw_entry");
+ directory_entry = glade_xml_get_widget (cam->xml, "directory_entry");
+ filename_entry = glade_xml_get_widget (cam->xml, "filename_entry");
+ gtk_entry_set_text (GTK_ENTRY (host_entry), cam->rhost);
+ gtk_entry_set_text (GTK_ENTRY (login_entry), cam->rlogin);
+ gtk_entry_set_text (GTK_ENTRY (pw_entry), cam->rpw);
+ gtk_entry_set_text (GTK_ENTRY (directory_entry), cam->rpixdir);
+ gtk_entry_set_text (GTK_ENTRY (filename_entry), cam->rcapturefile);
+
+ glade_xml_signal_connect_data (cam->xml, "rappend_func",
+ G_CALLBACK (rappend_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "timecb"),
+ cam->rtimefn);
+
+ glade_xml_signal_connect_data (cam->xml, "rjpg_func",
+ G_CALLBACK (rjpg_func), cam);
+ if (cam->rsavetype == JPEG) {
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "fjpgb"), TRUE);
+ }
+ glade_xml_signal_connect_data (cam->xml, "rpng_func",
+ G_CALLBACK (rpng_func), cam);
+ if (cam->rsavetype == PNG) {
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "fpngb"), TRUE);
+ }
+
+ glade_xml_signal_connect_data (cam->xml, "rts_func",
+ G_CALLBACK (rts_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml,
+ "tsbutton2"),
+ cam->rtimestamp);
+
+ /* timestamp */
+ glade_xml_signal_connect_data (cam->xml, "customstring_func",
+ G_CALLBACK (customstring_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml, "cscb"),
+ cam->usestring);
+
+ string_entry = glade_xml_get_widget (cam->xml, "string_entry");
+ gtk_entry_set_text (GTK_ENTRY (string_entry), cam->ts_string);
+
+ glade_xml_signal_connect_data (cam->xml, "drawdate_func",
+ G_CALLBACK (drawdate_func), cam);
+ gtk_toggle_button_set_active ((GtkToggleButton *)
+ glade_xml_get_widget (cam->xml, "tscb"),
+ cam->usedate);
+
+ cam->status = glade_xml_get_widget (cam->xml, "status");
+ set_sensitive (cam);
+ gtk_widget_set_sensitive (glade_xml_get_widget
+ (cam->xml, "string_entry"), cam->usestring);
+
+ gtk_widget_set_size_request (glade_xml_get_widget (cam->xml, "da"),
+ cam->x, cam->y);
+
+ prefswindow = glade_xml_get_widget (cam->xml, "prefswindow");
+}
+
+
diff --git a/src/camorama-window.o b/src/camorama-window.o
index a7a1d04..12e85f1 100644
--- a/src/camorama-window.o
+++ b/src/camorama-window.o
Binary files differ
diff --git a/src/filter.c b/src/filter.c
index 3fca7f9..cdcac4b 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -571,6 +571,7 @@ camorama_filters_init(void) {
camorama_filter_threshold_get_type();
camorama_filter_threshold_channel_get_type();
camorama_filter_mirror_get_type();
+ camorama_filter_reichardt_get_type();
camorama_filter_wacky_get_type();
camorama_filter_smooth_get_type();
camorama_filter_laplace_get_type();
diff --git a/src/filter.c~ b/src/filter.c~
new file mode 100644
index 0000000..3fca7f9
--- /dev/null
+++ b/src/filter.c~
@@ -0,0 +1,581 @@
+#include "filter.h"
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib/gi18n.h>
+
+gchar const*
+camorama_filter_get_name(CamoramaFilter* self) {
+ gchar const* name = CAMORAMA_FILTER_GET_CLASS(self)->name;
+ g_return_val_if_fail(name, G_OBJECT_TYPE_NAME(self));
+ return _(name);
+}
+
+void
+camorama_filter_apply(CamoramaFilter* self, guchar* image, gint width, gint height, gint depth) {
+ g_return_if_fail(CAMORAMA_FILTER_GET_CLASS(self)->filter);
+
+ CAMORAMA_FILTER_GET_CLASS(self)->filter(self, image, width, height, depth);
+}
+
+/* GType stuff ifor CamoramaFilter */
+G_DEFINE_ABSTRACT_TYPE(CamoramaFilter, camorama_filter, G_TYPE_OBJECT);
+
+static void
+camorama_filter_init(CamoramaFilter* self) {}
+
+static void
+camorama_filter_class_init(CamoramaFilterClass* self_class) {}
+
+#include "v4l.h"
+
+static inline void move_420_block (int yTL, int yTR, int yBL, int yBR, int u,
+ int v, int rowPixels, unsigned char *rgb,
+ int bits);
+
+/*these two functions are borrowed from the ov511 driver, with the author,
+ *Mark McClelland's kind encoragement*/
+
+/* LIMIT: convert a 16.16 fixed-point value to a byte, with clipping. */
+#define LIMIT(x) ((x)>0xffffff?0xff: ((x)<=0xffff?0:((x)>>16)))
+
+void
+yuv420p_to_rgb (unsigned char *image, unsigned char *temp, int x, int y, int z) {
+ const int numpix = x * y;
+ const int bytes = z; /* (z*8) >> 3; */
+ int i, j, y00, y01, y10, y11, u, v;
+ unsigned char *pY = image;
+ unsigned char *pU = pY + numpix;
+ unsigned char *pV = pU + numpix / 4;
+ unsigned char *image2 = temp;
+ if(FALSE) // FIXME: make TRUE to add debugging in here
+ g_print("%s\n", "yuv420p->rgb");
+ for (j = 0; j <= y - 2; j += 2) {
+ for (i = 0; i <= x - 2; i += 2) {
+ y00 = *pY;
+ y01 = *(pY + 1);
+ y10 = *(pY + x);
+ y11 = *(pY + x + 1);
+ u = (*pU++) - 128;
+ v = (*pV++) - 128;
+
+ move_420_block (y00, y01, y10, y11, u, v, x, image2, z * 8);
+
+ pY += 2;
+ image2 += 2 * bytes;
+ }
+ pY += x;
+ image2 += x * bytes;
+ }
+}
+
+static inline void
+move_420_block (int yTL, int yTR, int yBL, int yBR, int u, int v,
+ int rowPixels, unsigned char *rgb, int bits)
+{
+ const int rvScale = 91881;
+ const int guScale = -22553;
+ const int gvScale = -46801;
+ const int buScale = 116129;
+ const int yScale = 65536;
+ int r, g, b;
+
+ g = guScale * u + gvScale * v;
+ if (1) {
+ r = buScale * u;
+ b = rvScale * v;
+ } else {
+ r = rvScale * v;
+ b = buScale * u;
+ }
+
+ yTL *= yScale;
+ yTR *= yScale;
+ yBL *= yScale;
+ yBR *= yScale;
+
+ if (bits == 24) {
+ /* Write out top two pixels */
+ rgb[0] = LIMIT (b + yTL);
+ rgb[1] = LIMIT (g + yTL);
+ rgb[2] = LIMIT (r + yTL);
+
+ rgb[3] = LIMIT (b + yTR);
+ rgb[4] = LIMIT (g + yTR);
+ rgb[5] = LIMIT (r + yTR);
+
+ /* Skip down to next line to write out bottom two pixels */
+ rgb += 3 * rowPixels;
+ rgb[0] = LIMIT (b + yBL);
+ rgb[1] = LIMIT (g + yBL);
+ rgb[2] = LIMIT (r + yBL);
+
+ rgb[3] = LIMIT (b + yBR);
+ rgb[4] = LIMIT (g + yBR);
+ rgb[5] = LIMIT (r + yBR);
+ } else if (bits == 16) {
+ /* Write out top two pixels */
+ rgb[0] = ((LIMIT (b + yTL) >> 3) & 0x1F)
+ | ((LIMIT (g + yTL) << 3) & 0xE0);
+ rgb[1] = ((LIMIT (g + yTL) >> 5) & 0x07)
+ | (LIMIT (r + yTL) & 0xF8);
+
+ rgb[2] = ((LIMIT (b + yTR) >> 3) & 0x1F)
+ | ((LIMIT (g + yTR) << 3) & 0xE0);
+ rgb[3] = ((LIMIT (g + yTR) >> 5) & 0x07)
+ | (LIMIT (r + yTR) & 0xF8);
+
+ /* Skip down to next line to write out bottom two pixels */
+ rgb += 2 * rowPixels;
+
+ rgb[0] = ((LIMIT (b + yBL) >> 3) & 0x1F)
+ | ((LIMIT (g + yBL) << 3) & 0xE0);
+ rgb[1] = ((LIMIT (g + yBL) >> 5) & 0x07)
+ | (LIMIT (r + yBL) & 0xF8);
+
+ rgb[2] = ((LIMIT (b + yBR) >> 3) & 0x1F)
+ | ((LIMIT (g + yBR) << 3) & 0xE0);
+ rgb[3] = ((LIMIT (g + yBR) >> 5) & 0x07)
+ | (LIMIT (r + yBR) & 0xF8);
+ }
+}
+
+/* GType stuff for CamoramaFilterColor */
+typedef struct _CamoramaFilter CamoramaFilterColor;
+typedef struct _CamoramaFilterClass CamoramaFilterColorClass;
+
+G_DEFINE_TYPE(CamoramaFilterColor, camorama_filter_color, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_color_init(CamoramaFilterColor* self) {}
+
+void
+camorama_filter_color_filter(CamoramaFilterColor* filter, guchar *image, int x, int y, int depth) {
+ int i;
+ char tmp;
+ i = x * y;
+ while (i--) {
+ tmp = image[0];
+ image[0] = image[2];
+ image[2] = tmp;
+ image += 3;
+ }
+}
+
+static void
+camorama_filter_color_class_init(CamoramaFilterColorClass* self_class) {
+ self_class->filter = camorama_filter_color_filter;
+ self_class->name = _("Color Correction");
+}
+
+/* GType stuff for CamoramaFilterInvert */
+typedef struct _CamoramaFilter CamoramaFilterInvert;
+typedef struct _CamoramaFilterClass CamoramaFilterInvertClass;
+
+G_DEFINE_TYPE(CamoramaFilterInvert, camorama_filter_invert, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_invert_init(CamoramaFilterInvert* self) {}
+
+static void
+camorama_filter_invert_filter(CamoramaFilter* filter, guchar *image, int x, int y, int depth) {
+#warning "FIXME: add a checking cast here"
+ CamoramaFilterInvert* self = (CamoramaFilterInvert*)filter;
+ int i;
+ for (i = 0; i < x * y * depth; i++) {
+ image[i] = 255 - image[i];
+ }
+}
+
+static void
+camorama_filter_invert_class_init(CamoramaFilterClass* self_class) {
+ self_class->filter = camorama_filter_invert_filter;
+ self_class->name = _("Invert");
+}
+
+/* GType stuff for CamoramaFilterThreshold */
+typedef struct _CamoramaFilterThreshold {
+ CamoramaFilter base_instance;
+ gint threshold;
+} CamoramaFilterThreshold;
+typedef struct _CamoramaFilterClass CamoramaFilterThresholdClass;
+
+G_DEFINE_TYPE(CamoramaFilterThreshold, camorama_filter_threshold, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_threshold_init(CamoramaFilterThreshold* self) {
+ self->threshold = 127;
+}
+
+static void
+camorama_filter_threshold_filter(CamoramaFilter* filter, guchar *image, int x, int y, int depth) {
+#warning "FIXME: cast"
+ CamoramaFilterThreshold* self = (CamoramaFilterThreshold*)filter;
+ int i;
+ for (i = 0; i < x * y; i++) {
+ if ((image[0] + image[1] + image[2]) > (self->threshold * 3)) {
+ image[0] = 255;
+ image[1] = 255;
+ image[2] = 255;
+ } else {
+ image[0] = 0;
+ image[1] = 0;
+ image[2] = 0;
+ }
+ image += 3;
+ }
+}
+
+static void
+camorama_filter_threshold_class_init(CamoramaFilterThresholdClass* self_class) {
+ self_class->filter = camorama_filter_threshold_filter;
+ self_class->name = _("Threshold (Overall)");
+}
+
+/* GType stuff for CamoramaFilterThresholdChannel */
+typedef struct _CamoramaFilterThreshold CamoramaFilterThresholdChannel;
+typedef struct _CamoramaFilterClass CamoramaFilterThresholdChannelClass;
+
+G_DEFINE_TYPE(CamoramaFilterThresholdChannel, camorama_filter_threshold_channel, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_threshold_channel_init(CamoramaFilterThresholdChannel* self) {
+ self->threshold = 127;
+}
+
+static void
+camorama_filter_threshold_channel_filter(CamoramaFilter* filter, unsigned char *image, int x, int y, int depth) {
+#warning "FIXME: cast"
+ CamoramaFilterThresholdChannel* self = (CamoramaFilterThresholdChannel*)filter;
+ int i;
+ for (i = 0; i < x * y; i++) {
+ if (image[0] > self->threshold) {
+ image[0] = 255;
+ } else {
+ image[0] = 0;
+ }
+ if (image[1] > self->threshold) {
+ image[1] = 255;
+ } else {
+ image[1] = 0;
+ }
+ if (image[2] > self->threshold) {
+ image[2] = 255;
+ } else {
+ image[2] = 0;
+ }
+ image += 3;
+ }
+}
+
+static void
+camorama_filter_threshold_channel_class_init(CamoramaFilterThresholdChannelClass* self_class) {
+ self_class->filter = camorama_filter_threshold_channel_filter;
+ self_class->name = _("Threshold (Per Channel)");
+}
+
+/* GType stuff for CamoramaFilterWacky */
+typedef struct _CamoramaFilter CamoramaFilterWacky;
+typedef struct _CamoramaFilterClass CamoramaFilterWackyClass;
+
+G_DEFINE_TYPE(CamoramaFilterWacky, camorama_filter_wacky, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_wacky_init(CamoramaFilterWacky* self) {}
+
+static void
+camorama_filter_wacky_filter(CamoramaFilter* filter, unsigned char *image, int x, int y, int depth) {
+ int i;
+ int neighbours;
+ int total;
+ unsigned char *image2, *image3;
+ image2 = (unsigned char *) malloc (sizeof (unsigned char) * x * y * depth);
+ memcpy (image2, image, x * y * depth);
+ image3 = image2;
+
+ for (i = 0; i < x * y; i++) {
+ total = 0;
+ neighbours = 0;
+
+ if (i < x * depth) {
+ /*we are in the top row */
+ } else {
+ image2 -= (x + 1) * depth;
+ total = total + ((1 / 6) * image2[0]);
+ image2 += depth;
+ total = total + ((4 / 6) * image2[0]);
+ image2 += depth;
+ total = total + ((1 / 6) * image2[0]);
+ neighbours = neighbours + depth;
+ image2 += (x - 1) * depth;
+ }
+ if (i > x * (y - 1) * depth) {
+ /*we are in the bottom row */
+ } else {
+ image2 += (x + 1) * depth;
+ total = total + ((1 / 6) * image2[0]);
+ image2 -= depth;
+ total = total + ((4 / 6) * image2[0]);
+ image2 -= depth;
+ total = total + ((1 / 6) * image2[0]);
+ image2 -= (x - 1) * depth;
+ neighbours = neighbours + depth;
+ }
+
+ image2 += depth;
+ total = total + ((4 / 6) * image2[0]);
+ image2 -= depth;
+ neighbours++;
+
+ image2 -= depth;
+ total = total + ((4 / 6) * image2[0]);
+ image2 += depth;
+ neighbours++;
+
+ image[0] = image[0] * (-20 / 6);
+ image[0] = image[0] + total;
+ image[1] = image[0];
+ image[2] = image[0];
+ image += depth;
+ }
+ free (image2);
+}
+
+static void
+camorama_filter_wacky_class_init(CamoramaFilterWackyClass* self_class) {
+ self_class->filter = camorama_filter_wacky_filter;
+ self_class->name = _("Wacky");
+}
+
+/* GType stuff for CamoramaFilterSmotth */
+typedef struct _CamoramaFilter CamoramaFilterSmooth;
+typedef struct _CamoramaFilterClass CamoramaFilterSmoothClass;
+
+G_DEFINE_TYPE(CamoramaFilterSmooth, camorama_filter_smooth, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_smooth_init(CamoramaFilterSmooth* self) {}
+
+static void
+camorama_filter_smooth_filter(CamoramaFilter* filter, guchar *image, int x, int y, int depth) {
+ int i;
+ int neighbours;
+ int total0, total1, total2;
+ unsigned char *image2, *image3;
+ int tr = 0, br = 0;
+
+ image2 = (unsigned char *) malloc (sizeof (unsigned char) * x * y * depth);
+ memcpy (image2, image, x * y * depth);
+ image3 = image2;
+
+ for (i = 0; i < x * y; i++) {
+ total0 = 0;
+ total1 = 0;
+ total2 = 0;
+ neighbours = 0;
+
+ if (i < x) {
+ /*we are in the top row */
+ tr++;
+ } else {
+ image2 -= (x + 1) * depth;
+ total0 = total0 + image2[0];
+ total1 = total1 + image2[1];
+ total2 = total2 + image2[2];
+
+ total0 = total0 + image2[3];
+ total1 = total1 + image2[4];
+ total2 = total2 + image2[5];
+
+ total0 = total0 + image2[6];
+ total1 = total1 + image2[7];
+ total2 = total2 + image2[8];
+ neighbours = neighbours + depth;
+ if (tr > 1) {
+ tr = 0;
+ }
+ image2 += (x + 1) * depth;
+ }
+ if (i > x * (y - 1)) {
+ br++;
+ /*we are in the bottom row */
+ } else {
+ image2 += (x - 1) * depth;
+ total0 = total0 + image2[0];
+ total1 = total1 + image2[1];
+ total2 = total2 + image2[2];
+
+ total0 = total0 + image2[3];
+ total1 = total1 + image2[4];
+ total2 = total2 + image2[5];
+
+ total0 = total0 + image2[6];
+ total1 = total1 + image2[7];
+ total2 = total2 + image2[8];
+
+ image2 -= (x - 1) * depth;
+
+ neighbours = neighbours + depth;
+ }
+
+ image2 += 3;
+ total0 = total0 + image2[0];
+ total1 = total1 + image2[1];
+ total2 = total2 + image2[2];
+ image2 -= 3;
+ neighbours++;
+
+ image2 -= 3;
+ total0 = total0 + image2[0];
+ total1 = total1 + image2[1];
+ total2 = total2 + image2[2];
+ image2 += 3;
+ neighbours++;
+
+ image[0] = (int) (total0 / neighbours);
+ image[1] = (int) (total1 / neighbours);
+ image[2] = (int) (total2 / neighbours);
+
+ image += 3;
+ image2 += 3;
+ }
+ free (image3);
+}
+
+static void
+camorama_filter_smooth_class_init(CamoramaFilterSmoothClass* self_class) {
+ self_class->filter = camorama_filter_smooth_filter;
+ self_class->name = _("Smooth");
+}
+
+/* GType for CamoramaFilterMono */
+typedef struct _CamoramaFilter CamoramaFilterMono;
+typedef struct _CamoramaFilterClass CamoramaFilterMonoClass;
+
+G_DEFINE_TYPE(CamoramaFilterMono, camorama_filter_mono, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_mono_init(CamoramaFilterMono* self) {}
+
+static void
+camorama_filter_mono_filter(CamoramaFilter* filter, unsigned char *image, int x, int y, int depth) {
+ int i;
+ int total, avg;
+
+ for (i = 0; i < x * y; i++) {
+ total = image[0] + image[1] + image[2];
+ avg = (int) (total / 3);
+
+ image[0] = avg;
+ image[1] = avg;
+ image[2] = avg;
+ image += 3;
+ }
+}
+
+static void
+camorama_filter_mono_class_init(CamoramaFilterMonoClass* self_class) {
+ self_class->filter = camorama_filter_mono_filter;
+ self_class->name = _("Monochrome");
+}
+
+/* GType for CamoramaFilterMonoWeight */
+typedef struct _CamoramaFilter CamoramaFilterMonoWeight;
+typedef struct _CamoramaFilterClass CamoramaFilterMonoWeightClass;
+
+G_DEFINE_TYPE(CamoramaFilterMonoWeight, camorama_filter_mono_weight, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_mono_weight_init(CamoramaFilterMonoWeight* self) {}
+
+static void
+camorama_filter_mono_weight_filter(CamoramaFilter* filter, unsigned char *image, int x, int y, int depth) {
+ int i;
+ int avg;
+ for (i = 0; i < x * y; i++) {
+ avg = (int) ((image[0] * 0.2125) + (image[1] * 0.7154) +
+ (image[2] * 0.0721));
+
+ image[0] = avg;
+ image[1] = avg;
+ image[2] = avg;
+ image += 3; /* bump to next triplet */
+ }
+}
+
+static void
+camorama_filter_mono_weight_class_init(CamoramaFilterMonoWeightClass* self_class) {
+ self_class->filter = camorama_filter_mono_weight_filter;
+ self_class->name = _("Monochrome (Weight)");
+}
+
+/* GType stuff for CamoramaFilterSobel */
+typedef struct _CamoramaFilter CamoramaFilterSobel;
+typedef struct _CamoramaFilterClass CamoramaFilterSobelClass;
+
+G_DEFINE_TYPE(CamoramaFilterSobel, camorama_filter_sobel, CAMORAMA_TYPE_FILTER);
+
+static void
+camorama_filter_sobel_init(CamoramaFilterSobel* self) {}
+
+/* fix this at some point, very slow */
+static void
+camorama_filter_sobel_filter(CamoramaFilter* filter, unsigned char *image, int x, int y, int depth) {
+ int i, j, grad[3];
+ int deltaX[3], deltaY[3];
+ int width = x * 3;
+ guchar *image2;
+
+ image2 = (guchar *) malloc (sizeof (guchar) * (x * y * 3));
+
+ for (i = width; i < (y - 1) * width; i++) {
+ for (j = 0; j <= 2; j++) {
+ deltaX[j] =
+ 2 * image[i + 1] + image[i - width + 1] +
+ image[i + width + 1] - 2 * image[i - 1] -
+ image[i - width - 1] - image[i + width - 1];
+
+ deltaY[j] =
+ image[i - width - 1] + 2 * image[i -
+ width] +
+ image[i - width + 1] - image[i + width -
+ 1] -
+ 2 * image[i + width] - image[i + width + 1];
+ grad[j] = (abs (deltaX[j]) + abs (deltaY[j]));
+ grad[j] = grad[j] / 5.66; /* <<<<<------------------------ new line */
+ if (grad[j] > 255) {
+ grad[j] = 255;
+ }
+ image2[i + j] = (unsigned char) grad[j];
+ }
+ }
+
+ memcpy (image, image2, (x * y * 3));
+ free (image2);
+}
+
+static void
+camorama_filter_sobel_class_init(CamoramaFilterSobelClass* self_class) {
+ self_class->filter = camorama_filter_sobel_filter;
+ // TRANSLATORS: http://en.wikipedia.org/wiki/Sobel
+ self_class->name = _("Sobel");
+}
+
+/* general filter initialization */
+void
+camorama_filters_init(void) {
+ camorama_filter_color_get_type();
+ camorama_filter_invert_get_type();
+ camorama_filter_threshold_get_type();
+ camorama_filter_threshold_channel_get_type();
+ camorama_filter_mirror_get_type();
+ camorama_filter_wacky_get_type();
+ camorama_filter_smooth_get_type();
+ camorama_filter_laplace_get_type();
+ camorama_filter_mono_get_type();
+ camorama_filter_mono_weight_get_type();
+ camorama_filter_sobel_get_type();
+}
+
diff --git a/src/filter.o b/src/filter.o
index 84f2840..3f8bc25 100644
--- a/src/filter.o
+++ b/src/filter.o
Binary files differ
diff --git a/src/main.o b/src/main.o
index 403aa8a..facb8de 100644
--- a/src/main.o
+++ b/src/main.o
Binary files differ

Privacy Policy