2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EDSDKのwrapperをC++で書いた

Last updated at Posted at 2019-07-02

4月からいよいよ日本国内でもEDSDKが希望者に配布されるようになりました。EDSDKなんたらかんたらのプログラミングをするには、ちと辛いのでC++でwrapperを作りました。C#で作られた物はありますが、C++で実用的なものはないようなので、自作しました。

使い方は、


#include “cameralib.h”

Camera* camera;

camera = new Camera();

camera->TakePictureToFile();
camera->TakePictureToStream();
camera->LiveViewOn();

Etc.etc.

実はNikon SDKのwrapperもできていて、上記はCanonとNikonを多重継承した汎用Cameraクラスです。

cameralib.h

#ifndef CAMERALIB
#define CAMERALIB
#include "edsdklib.h"
#include "nikonsdk.h"


class Camera : public CanonCamera, public NikonCamera {

	private:

		char CameraName[80];
		int TotalCameraCount;
		Camera* activeptr;

	public:
		bool    usenikon = false;
		bool    usecanon = false;

		  Camera();
		  ~Camera();

		  Camera* getptr(){
			return activeptr;
		  }
	  char* GetName();
	  unsigned char* getbuffer();
	  long	getsize();
		  unsigned char* getlivebuffer();
	  long	getlivesize();

			void TakePictureToStream();
			void RecordMovie();
			void StopMovie();
            char* CGetName();
			void LiveViewOn(void);
			void LiveViewOff(void);
			void LiveViewOnTFT(void);
            void LiveViewOffTFT(void);
			void DownLoadEVFData(void);
			int  IsTransfered(void);
			void UnsetTransfered(void);
			void TakePictureToFile();
			void Rehook(void);

};

#endif

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?