images
authorhackbard <hackbard>
Sat, 16 Nov 2002 16:04:59 +0000 (16:04 +0000)
committerhackbard <hackbard>
Sat, 16 Nov 2002 16:04:59 +0000 (16:04 +0000)
webcam.c

index e63c835..0cf1463 100644 (file)
--- a/webcam.c
+++ b/webcam.c
@@ -1,5 +1,5 @@
 /*
- * webcam.c - fetch data from webcam 
+ * webcam.c - fetch data from webcam and display
  *
  * author: hackbard
  *
 #include <X11/xpm.h>
 #include <X11/extensions/shape.h>
 #include "minirgb.h"
-#include "ivac-logo.xpm"
+// #include "images/ivac-logo.xpm"
+// #include "images/ivac-logo.h"
+#include "images/example_1.xbm"
 
 /* defines */
 #define XBM_WIDTH 256
 #define XBM_REAL_WIDTH 512
 #define XBM_HEIGHT 256
+// #define ivac_logo pixel_data
+#define ivac_logo example_1_bits
 
 /* global variables */
 Display *display;
@@ -108,8 +112,8 @@ void open_window(char *name,char *ivac_mask) {
  my_wm_hints.window_group=ivac_win;
  my_wm_hints.flags =
        StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
- XSetWMHints(display,ivac_win,&my_wm_hints);
// XSetWMHints(display,ivac_win,&my_wm_hints);
+
  /* finaly ... map that stuff ;) */
  XMapWindow(display,ivac_win);
 
@@ -136,12 +140,16 @@ int main(int argc,char **argv) {
   exit(1);
  }
 
- open_window(argv[0],ivac_logo);
+ open_window(argv[0],(char *)ivac_logo);
+ minirgb_new(&rgb1,XBM_WIDTH,XBM_HEIGHT);
+ minirgb_new(&rgb2,XBM_WIDTH,XBM_HEIGHT);
+ minirgb_copy(&rgb2,&rgb1,0,0,XBM_WIDTH,XBM_HEIGHT,0,0);
 
  /* to be continued ... here is a test! */
  XFlush(display);
- sleep(5);
+ sleep(10);
  printf("blaaaa, schmaeee\n");
+ XCloseDisplay(display);
+ return 0;
 
 }