Index: trunk/MagicSoft/Cosy/videodev/Camera.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 738)
+++ trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 808)
@@ -188,5 +188,5 @@
 
 void Camera::Execute(const unsigned long n,
-                     char *img,
+                     byte *img,
                      struct timeval *tm)
 {
@@ -247,5 +247,5 @@
             if (!StartGrab(i&1))
                 break;
-            Execute(i, fImg, &fTime);
+            Execute(i, (byte*)fImg, &fTime);
             i++;
         }
@@ -254,10 +254,10 @@
         {
             LoopStep(i);
-            Execute(i, fImg, &fTime);
+            Execute(i, (byte*)fImg, &fTime);
             i++;
         }
 
         LoopStep(i);
-        Execute(i, fImg, &fTime);
+        Execute(i, (byte*)fImg, &fTime);
         i++;
 
Index: trunk/MagicSoft/Cosy/videodev/Camera.h
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 738)
+++ trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 808)
@@ -4,4 +4,6 @@
 #include <pthread.h>
 #include <sys/time.h>
+
+typedef unsigned char byte;
 
 class Camera
@@ -85,5 +87,5 @@
     //
     virtual void Execute(const unsigned long n,
-                         char *img, struct timeval *tm);
+                         byte *img, struct timeval *tm);
 
     //
Index: trunk/MagicSoft/Cosy/videodev/Filter.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Filter.cc	(revision 738)
+++ trunk/MagicSoft/Cosy/videodev/Filter.cc	(revision 808)
@@ -6,5 +6,5 @@
 void Filter::DrawBox(const int x1, const int y1,
                      const int x2, const int y2,
-                     char *buffer, const int col)
+                     byte *buffer, const int col)
 {
     for (int x=x1; x<x2+1; x++)
@@ -13,5 +13,5 @@
 }
 
-void Filter::MarkPoint(const int x, const int y, char *buffer, const int col)
+void Filter::MarkPoint(const int x, const int y, byte *buffer, const int col)
 {
     DrawBox(x-8, y, x-5, y, buffer, col);
@@ -22,5 +22,5 @@
 }
 
-float Filter::Mean(const char *buffer, const int offset, int *min, int *max)
+float Filter::Mean(const byte *buffer, const int offset, int *min, int *max)
 {
     double mean = 0.0;
@@ -35,12 +35,12 @@
         for (int y=offset; y<576-offset; y++)
         {
-            unsigned char val = (unsigned char)buffer[y*768+x];
+            byte val = buffer[y*768+x];
 
             mean += val;
 
-            if (*max<val)
+            if (val>*max)
                 *max = val;
 
-            if (*min>val)
+            if (val<*min)
                 *min = val;
         }
@@ -51,5 +51,5 @@
 }
 
-float Filter::SDev(const char *buffer, const int offset, const double mean)
+float Filter::SDev(const byte *buffer, const int offset, const double mean)
 {
     //
@@ -61,5 +61,5 @@
         for (int y=offset; y<576-offset; y++)
         {
-            const float val = mean - (unsigned char)buffer[y*768+x];
+            const float val = mean - buffer[y*768+x];
 
             sdev += val*val;
@@ -71,5 +71,5 @@
 }
 
-int Filter::GetMeanPosition(const char *bitmap, const int x, const int y,
+int Filter::GetMeanPosition(const byte *bitmap, const int x, const int y,
                             const int box)
 {
@@ -82,5 +82,5 @@
         for (int dy=y-box; dy<y+box+1; dy++)
         {
-            const unsigned char m = (unsigned char)bitmap[dy*768+dx]; // desc->buffer[3*(x+y*768)]; //
+            const byte m = bitmap[dy*768+dx]; // desc->buffer[3*(x+y*768)]; //
 
             sumx += m*dx;
@@ -95,5 +95,5 @@
 }
 
-void Filter::Execute(char *img)
+void Filter::Execute(byte *img)
 {
     const int offset = 10;
@@ -115,4 +115,8 @@
             if (img[y*768+x]>cut)
                 continue;
+
+            //
+            // FIXME: Create LOOKUP Table!
+            //
 
             img[y*768+x] = 0;
@@ -169,5 +173,5 @@
     int points=0;
 
-    char marker[768*576];
+    byte marker[768*576];
     memset(marker, 0, 768*576);
 
Index: trunk/MagicSoft/Cosy/videodev/Filter.h
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Filter.h	(revision 738)
+++ trunk/MagicSoft/Cosy/videodev/Filter.h	(revision 808)
@@ -1,4 +1,6 @@
 #ifndef FILTER_H
 #define FILTER_H
+
+typedef unsigned char byte;
 
 class Filter
@@ -6,21 +8,21 @@
     static void  DrawBox(const int x1, const int y1,
                          const int x2, const int y2,
-                         char *buffer, const int col);
+                         byte *buffer, const int col);
 
     static void  MarkPoint(const int x, const int y,
-                           char *buffer, const int col);
+                           byte *buffer, const int col);
 
-    static float Mean(const char *buffer, const int offset,
+    static float Mean(const byte *buffer, const int offset,
                       int *min, int *max);
 
-    static float SDev(const char *buffer, const int offset,
+    static float SDev(const byte *buffer, const int offset,
                       const double mean);
 
-    static int   GetMeanPosition(const char *bitmap,
+    static int   GetMeanPosition(const byte *bitmap,
                                  const int x, const int y,
                                  const int box);
 
 public:
-    static void Execute(char *img);
+    static void Execute(byte *img);
 };
 
Index: trunk/MagicSoft/Cosy/videodev/Writer.cc
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 738)
+++ trunk/MagicSoft/Cosy/videodev/Writer.cc	(revision 808)
@@ -9,5 +9,5 @@
 #include "timer.h"
 
-void Writer::Png(const char *fname, const char *buf,
+void Writer::Png(const char *fname, const byte *buf,
                  struct timeval *date)
 {
@@ -106,5 +106,5 @@
 }
 
-void Writer::Ppm(const char *fname, const char *img)
+void Writer::Ppm(const char *fname, const byte *img)
 {
     cout << "Writing PPM '" << fname << "'" << endl;
@@ -121,5 +121,5 @@
     //
     fout << "P6\n768 576\n255\n";
-    for (char const *buf = img; buf < img+768*576; buf++)
+    for (byte const *buf = img; buf < img+768*576; buf++)
         fout << *buf << *buf << *buf;
 }
Index: trunk/MagicSoft/Cosy/videodev/Writer.h
===================================================================
--- trunk/MagicSoft/Cosy/videodev/Writer.h	(revision 738)
+++ trunk/MagicSoft/Cosy/videodev/Writer.h	(revision 808)
@@ -3,4 +3,6 @@
 
 #include <sys/time.h>
+
+typedef unsigned char byte;
 
 class Writer;
@@ -10,6 +12,6 @@
 public:
 
-    static void Ppm(const char *fname, const char *img);
-    static void Png(const char *fname, const char *buf, struct timeval *date);
+    static void Ppm(const char *fname, const byte *img);
+    static void Png(const char *fname, const byte *buf, struct timeval *date);
 };
 
