projects
/
my-code
/
ivac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
first additions for webcam usage
[my-code/ivac.git]
/
webcam.c
diff --git
a/webcam.c
b/webcam.c
index
e63c835
..
30c1550
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
*
*
* author: hackbard
*
@@
-15,12
+15,16
@@
#include <X11/xpm.h>
#include <X11/extensions/shape.h>
#include "minirgb.h"
#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_orig.xbm"
/* defines */
#define XBM_WIDTH 256
#define XBM_REAL_WIDTH 512
#define XBM_HEIGHT 256
/* defines */
#define XBM_WIDTH 256
#define XBM_REAL_WIDTH 512
#define XBM_HEIGHT 256
+// #define ivac_logo pixel_data
+#define ivac_logo example_bits
/* global variables */
Display *display;
/* 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;
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);
/* finaly ... map that stuff ;) */
XMapWindow(display,ivac_win);
@@
-136,12
+140,16
@@
int main(int argc,char **argv) {
exit(1);
}
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);
/* to be continued ... here is a test! */
XFlush(display);
- sleep(
5
);
+ sleep(
10
);
printf("blaaaa, schmaeee\n");
printf("blaaaa, schmaeee\n");
+ XCloseDisplay(display);
+ return 0;
}
}