jvcleave / ofxRPiCameraVideoGrabber

development of ofxRPiCameraVideoGrabber, an addon to control the native Raspberry Pi camera in openFrameworks
89 stars 17 forks source link

how can i rotate the screen #28

Closed rihani closed 8 years ago

rihani commented 8 years ago

Hi,

how could i rotate the screen please thanks

Wolftronics-SBC commented 8 years ago

you can rotate the camera or monitor? monitor rotate linux,windows.... camera rotate videoGrabber->setRotation(ROTATION_90); videoGrabber->setRotation(272); etc...

jvcleave commented 8 years ago

I think example-direct-mode-transform has this as a demo - take a look at that

https://github.com/jvcleave/ofxRPiCameraVideoGrabber/blob/master/example-direct-mode-transform/src/ofApp.cpp#L118

I don't have the camera hooked up at the moment to try it

rihani commented 8 years ago

I get the following error

error: base operand of ‘->’ has non-pointer type ‘ofxRPiCameraVideoGrabber’
         videoGrabber->setRotation(ROTATION_90);

I do insert this in keyPressed function but don't mind setting this during setup()

void ofApp::keyPressed  (int key)
{
    ofLog(OF_LOG_VERBOSE, "%c keyPressed", key);

    if (key == 'e')
    {
        videoGrabber.setImageFilter(filterCollection.getNextFilter());
    }

    if(key == 'm')  
    {
        videoGrabber->setRotation(ROTATION_90);
    }
....
jvcleave commented 8 years ago

the error says it's not a pointer in your code, change videoGrabber->setRotation(ROTATION_90); to videoGrabber.setRotation(ROTATION_90);

rihani commented 8 years ago

managed to do it using

videoGrabber.setDisplayRotation(rotation);

thanks

rihani commented 8 years ago

i managed to spin the camera 180 degrees using videoGrabber.setRotation(ROTATION_180); however how can i flip/mirror the camera vertically

rihani commented 8 years ago

videoGrabber.setMirror(MIRROR_VERTICAL);