-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snapper.h
45 lines (39 loc) · 967 Bytes
/
Snapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __SNAPPER_H__
#define __SNAPPER_H__
#include <gphoto2/gphoto2-camera.h>
#include <stdio.h>
#include <jpeglib.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifdef RPI
#include "JPEG.h"
#include "Logger.h"
#endif
#include "Epeg.h"
namespace SuperBooth {
class Snapper {
private:
Camera *camera;
GPContext *context;
unsigned char retries;
unsigned int im_h, im_w;
#ifdef RPI
JPEG *jpeg;
Logger *pLogger;
#endif
public:
Snapper();
~Snapper();
int connect();
void disconnect();
bool valid();
void downloadPicture(char *, char *, char **, unsigned int *);
void downloadResizePicture(char *name, char *folder, unsigned int *size, char **pic, Epeg_Image **img);
void setTargetCard();
void takePicture(char *name, char *folder, unsigned int *size);
void capturePreview(char **out, unsigned int *size);
void decodeJPEG(const char *jpeg, unsigned long int jpeg_len, char **out, unsigned int *size);
};
}
#endif