webcam
This commit is contained in:
parent
7095c17058
commit
c8bc4dffd0
16
ofApp.cpp
16
ofApp.cpp
@ -2,17 +2,24 @@
|
|||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void ofApp::setup(){
|
void ofApp::setup(){
|
||||||
|
cout <<"setup methode()" <<endl;
|
||||||
|
cam.listDevices(); //listet alle kameras auf
|
||||||
|
cam.setDeviceID(0); //wählt eine Kamera aus der Liste aus
|
||||||
|
resolution.x=640;
|
||||||
|
resolution.y=480;
|
||||||
|
cam.setup(resolution.x,resolution.y); // int h und int w werden übergeben
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void ofApp::update(){
|
void ofApp::update(){
|
||||||
|
cam.update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void ofApp::draw(){
|
void ofApp::draw(){
|
||||||
|
cam.draw(0,0, resolution.x, resolution.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@ -22,7 +29,12 @@ void ofApp::keyPressed(int key){
|
|||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void ofApp::keyReleased(int key){
|
void ofApp::keyReleased(int key){
|
||||||
|
switch(key){
|
||||||
|
case 'f':
|
||||||
|
ofToggleFullscreen();
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
13
ofApp.h
13
ofApp.h
@ -5,12 +5,12 @@
|
|||||||
class ofApp : public ofBaseApp{
|
class ofApp : public ofBaseApp{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setup();
|
void setup(); //alles ab einstieg des programms wird einmal am anfang
|
||||||
void update();
|
void update(); // verarbeitung der daten
|
||||||
void draw();
|
void draw(); //darstellung der informationen
|
||||||
|
|
||||||
void keyPressed(int key);
|
void keyPressed(int key); // integer liefer gedrückt taste beim drücken
|
||||||
void keyReleased(int key);
|
void keyReleased(int key); // key released wenn taste los gelassen wird
|
||||||
void mouseMoved(int x, int y );
|
void mouseMoved(int x, int y );
|
||||||
void mouseDragged(int x, int y, int button);
|
void mouseDragged(int x, int y, int button);
|
||||||
void mousePressed(int x, int y, int button);
|
void mousePressed(int x, int y, int button);
|
||||||
@ -20,5 +20,6 @@ class ofApp : public ofBaseApp{
|
|||||||
void windowResized(int w, int h);
|
void windowResized(int w, int h);
|
||||||
void dragEvent(ofDragInfo dragInfo);
|
void dragEvent(ofDragInfo dragInfo);
|
||||||
void gotMessage(ofMessage msg);
|
void gotMessage(ofMessage msg);
|
||||||
|
ofVideoGrabber cam;
|
||||||
|
ofVec2f resolution;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user