← Back

ofxModuleGphoto

github.com/reddoLabs/ofxModuleGphoto · @reddoLabs
OF 0.11 Video/Camera Hardware Interface

Module for ofxModule that allows easy control over gphoto supported cameras.

0 0 Last commit 3y ago Created 5y ago

README

ofxModuleCanon



Module for ofxModule that allows easy control over libgphoto supported cameras using ofxGphoto.

Compatible with openFrameworks 0.11.0+ and Linux.

Generate all project files using the openFrameworks Project Generator. Manually add linker flags -lgphoto2 and -lgphoto2_port.

Required Addons



ofxModule ofxGphoto

Getting started



Have a look at the sample project to get started directly and have a small explanation here.

Settings



The module can be configured in the settings.json.

{
    "Gphoto":{
		"deviceName": "Fujifilm XT-2",
        "mirrorX":true,
        "mirrorY":true,
        "streamingMethod": "both",
        "rotate":90
    }
}


propertytypedescription
deviceIdintsets device ID (search order of gphoto, can change on restart)
deviceNamestringname of the device as shoen in device list
mirrorXbooleanmirrors Image on x-axis
mirrorYbooleanmirrors Image on y-axis
rotateintrotate the image either 0, 90, 180 or 270
streamingMethodstringtransmit type of images to other modules either "texture","pixels" or "both"

Communication



Control the module



Activate/ deactivate live-view:

ofJson j;
j["value"] = false; // activate the module, for deactivate use true
notifyEvent("setIdle", j);


Take photo:

notifyEvent("capture");


Get messages from the module



Depending of the selected streaming method you receive the cam image as ofTexture or ofPixels. A photo arrives at the address photo, other messages represent the current live view.

void Presenter::proceedModuleEvent(ModuleEvent& e) {
		
		// update the cam image 
		if (e.type == ModuleEvent::MODULE_EVENT_TEXTURE) {
			if (e.address == "photo") {
				highResTexture = e.texture;
			}else{
				lowResTexture = e.texture;
			}
			else  camTexture = e.texture;
		}else if (e.type == ModuleEvent::MODULE_EVENT_PIXELS) {
			if (e.address == "photo") {
				highResImage.setFromPixels(e.pixels);
			} else  {
				lowResImage.setFromPixels(e.pixels);
			}
		}
    }

Get this addon

HTTPS
SSH