Giter Club home page Giter Club logo

gphoto2pp's Introduction

gphoto2pp

gphoto2pp is a C++11 wrapper for libgphoto2.

Table Of Contents

Prerequisites

  • A C++11 compiler
  • libgphoto2 (2.5.0 or greater)
  • cmake (3.1 or greater) (build)
  • cxxtest (optional, for running tests)
  • doxygen and graphviz (optional, for generating documentation)

2 Minute Tutorial

The following snip will show you a quick demo of how easy it is to interact with your camera using gphoto2pp. Don't forget you will need to follow the installation instructions before you can compile this 2 minute tutorial on your computer. Make a source file eg. touch testgphoto2pp.cpp Now put this in the source file

#include <gphoto2pp/camera_wrapper.hpp> 		// Header for CameraWrapper
#include <gphoto2pp/camera_file_wrapper.hpp>	// Header for CameraFileWrapper
#include <gphoto2pp/helper_camera_wrapper.hpp>	// Used for helper::capture(...) method

#include <iostream>

int main()
{
	// Connects to the first camera found and initializes
	gphoto2pp::CameraWrapper camera;
	
	// Prints out the summary of your camera's abilities
	std::cout << camera.getSummary() << std::endl;
	
	// Creates empty instance of a cameraFile, which will be populated in our helper method
	gphoto2pp::CameraFileWrapper cameraFile;
	
	// Takes a picture with the camera and does all of the behind the scenes fetching
	gphoto2pp::helper::capture(camera, cameraFile);
	
	// Lastly saves the picture to your hard drive
	// Your camera might take files in different formats (bmp, raw)
	// so this extension might be wrong and you should rename your file appropriately
	cameraFile.save("my-gphoto2pp-test.jpg");
	
	return 1;
}

Now compile with the command:

g++ -std=c++11 testgphoto2pp.cpp -lgphoto2 -lgphoto2pp

and then execute it

./a.out

That's it! The library is certainly capable of more, which you can view at examples.

Building and Installing

git clone 'https://github.com/Marius-Linux/gphoto2pp'
cd gphotopp
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
make examples //Optional, for building examples
make docs //Optional, for building documentation with doxygen
sudo make install

Examples

Please see the Examples document for details about all examples provided.

Dev/Test

If you would like to contribute/develop/test gphoto2pp, please see the Dev-Test doc.

FAQ

Please see the FAQ document

Doxygen Documentation

Please see this projects github pages for the auto generated Doxygen Page.

Other Useful Links

If you are new to gphoto2pp (and perhaps gphoto), then please view some of these resources:

gphoto2pp's People

Contributors

maldworth avatar mariussteffen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.