summaryrefslogtreecommitdiff
path: root/camlibs/ricoh/ricoh.h
blob: 1d808a394c316fdde321a17b2e1dbe7969f3bd83 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/* ricoh.h
 *
 * Copyright © 2002 Lutz Müller <lutz@users.sourceforge.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __RICOH_H__
#define __RICOH_H__

#include <time.h>

#include <gphoto2/gphoto2-camera.h>
#include <gphoto2/gphoto2-context.h>

typedef enum _RicohSpeed RicohSpeed;
enum _RicohSpeed {
	RICOH_SPEED_2400   = 0x00,
	RICOH_SPEED_4800   = 0x01,
	RICOH_SPEED_9600   = 0x02,
	RICOH_SPEED_19200  = 0x03,
	RICOH_SPEED_38400  = 0x04,
	RICOH_SPEED_57600  = 0x05,
	RICOH_SPEED_115200 = 0x07
};

int ricoh_set_speed (Camera *camera, GPContext *context, RicohSpeed speed);

/* We don't know the numbers for the models marked as 'dummy'. */
typedef enum _RicohModel RicohModel;
enum _RicohModel {
	RICOH_MODEL_1        = 0x001, /* dummy */
	RICOH_MODEL_2        = 0x002, /* dummy */
	RICOH_MODEL_2E       = 0x003, /* dummy */
	RICOH_MODEL_100G     = 0x005, /* dummy */
	RICOH_MODEL_300      = 0x300,
	RICOH_MODEL_300Z     = 0x301,
	RICOH_MODEL_4200     = 0x402,
	RICOH_MODEL_4300     = 0x403,
	RICOH_MODEL_5000     = 0x004, /* dummy */
	RICOH_MODEL_ESP2     = 0x006, /* dummy */
	RICOH_MODEL_ESP50    = 0x007, /* dummy */
	RICOH_MODEL_ESP60    = 0x008, /* dummy */
	RICOH_MODEL_ESP70    = 0x009, /* dummy */
	RICOH_MODEL_ESP80    = 0x010, /* dummy */
	RICOH_MODEL_ESP80SXG = 0x400
};

int ricoh_connect    (Camera *camera, GPContext *context, RicohModel *model);
int ricoh_disconnect (Camera *camera, GPContext *context);

typedef enum _RicohMode RicohMode;
enum _RicohMode {
	RICOH_MODE_PLAY   = 0x00,
	RICOH_MODE_RECORD = 0x01
};

int ricoh_get_mode  (Camera *camera, GPContext *context, RicohMode *mode);
int ricoh_set_mode  (Camera *camera, GPContext *context, RicohMode  mode);

int ricoh_get_num   (Camera *camera, GPContext *context, unsigned int *n);

int ricoh_get_pic_size  (Camera *, GPContext *, unsigned int, unsigned long *);
int ricoh_get_pic_date  (Camera *, GPContext *, unsigned int, time_t *);
int ricoh_get_pic_name  (Camera *, GPContext *, unsigned int, const char **);
int ricoh_get_pic_memo  (Camera *, GPContext *, unsigned int, const char **);
int ricoh_del_pic       (Camera *, GPContext *, unsigned int);

typedef enum _RicohFileType RicohFileType;
enum _RicohFileType {
	RICOH_FILE_TYPE_NORMAL  = 0xa0,
	RICOH_FILE_TYPE_PREVIEW = 0xa4
};
int ricoh_get_pic   (Camera *camera, GPContext *context, unsigned int n,
		     RicohFileType type,
		     unsigned char **data, unsigned int *size);

int ricoh_take_pic  (Camera *, GPContext *);
int ricoh_put_file  (Camera *, GPContext *, const char *name,
		     const unsigned char *data, unsigned int size);

int ricoh_get_date  (Camera *camera, GPContext *context, time_t *time);
int ricoh_set_date  (Camera *camera, GPContext *context, time_t  time);

int ricoh_get_cam_mem   (Camera *camera, GPContext *context, int *mem);
int ricoh_get_cam_amem  (Camera *camera, GPContext *context, int *mem);

int ricoh_get_copyright (Camera *camera, GPContext *context,
		         const char **copyright);
int ricoh_set_copyright (Camera *camera, GPContext *context,
			 const char *copyright);

typedef enum _RicohResolution RicohResolution;
enum _RicohResolution {
	RICOH_RESOLUTION_640_480  = 0x01,
	RICOH_RESOLUTION_1280_960 = 0x04
};

int ricoh_get_resolution (Camera *, GPContext *, RicohResolution *);
int ricoh_set_resolution (Camera *, GPContext *, RicohResolution);

typedef enum _RicohExposure RicohExposure;
enum _RicohExposure {
	RICOH_EXPOSURE_M20  = 0x01, /* -2.0 */
	RICOH_EXPOSURE_M15  = 0x02,
	RICOH_EXPOSURE_M10  = 0x03,
	RICOH_EXPOSURE_M05  = 0x04,
	RICOH_EXPOSURE_00   = 0x05,
	RICOH_EXPOSURE_05   = 0x06,
	RICOH_EXPOSURE_10   = 0x07,
	RICOH_EXPOSURE_15   = 0x08,
	RICOH_EXPOSURE_20   = 0x09, /* +2.0 */
	RICOH_EXPOSURE_AUTO = 0xff
};

int ricoh_get_exposure (Camera *, GPContext *, RicohExposure *);
int ricoh_set_exposure (Camera *, GPContext *, RicohExposure);

typedef enum _RicohWhiteLevel RicohWhiteLevel;
enum _RicohWhiteLevel {
	RICOH_WHITE_LEVEL_AUTO		= 0x00,
	RICOH_WHITE_LEVEL_OUTDOOR	= 0x01,
	RICOH_WHITE_LEVEL_FLUORESCENT	= 0x02,
	RICOH_WHITE_LEVEL_INCANDESCENT	= 0x03,
	RICOH_WHITE_LEVEL_BLACK_WHITE	= 0x04,
	RICOH_WHITE_LEVEL_SEPIA		= 0x05
};

int ricoh_get_white_level (Camera *, GPContext *, RicohWhiteLevel *);
int ricoh_set_white_level (Camera *, GPContext *, RicohWhiteLevel);

typedef enum _RicohMacro RicohMacro;
enum _RicohMacro {
	RICOH_MACRO_OFF = 0x00,
	RICOH_MACRO_ON  = 0x01
};

int ricoh_get_macro (Camera *, GPContext *, RicohMacro *);
int ricoh_set_macro (Camera *, GPContext *, RicohMacro);

typedef enum _RicohZoom RicohZoom;
enum _RicohZoom {
	RICOH_ZOOM_OFF = 0x00,
	RICOH_ZOOM_1   = 0x01,
	RICOH_ZOOM_2   = 0x02,
	RICOH_ZOOM_3   = 0x03,
	RICOH_ZOOM_4   = 0x04,
	RICOH_ZOOM_5   = 0x05,
	RICOH_ZOOM_6   = 0x06,
	RICOH_ZOOM_7   = 0x07,
	RICOH_ZOOM_8   = 0x08
};

int ricoh_get_zoom (Camera *, GPContext *, RicohZoom *);
int ricoh_set_zoom (Camera *, GPContext *, RicohZoom);

typedef enum _RicohFlash RicohFlash;
enum _RicohFlash {
	RICOH_FLASH_AUTO = 0x00,
	RICOH_FLASH_OFF  = 0x01,
	RICOH_FLASH_ON   = 0x02
};

int ricoh_get_flash (Camera *, GPContext *, RicohFlash *);
int ricoh_set_flash (Camera *, GPContext *, RicohFlash);

typedef enum _RicohRecMode RicohRecMode;
enum _RicohRecMode {
	RICOH_REC_MODE_IMAGE           = 0x00,
	RICOH_REC_MODE_CHARACTER       = 0x01,
	RICOH_REC_MODE_SOUND           = 0x03,
	RICOH_REC_MODE_IMAGE_SOUND     = 0x04,
	RICOH_REC_MODE_CHARACTER_SOUND = 0x06
};

int ricoh_get_rec_mode (Camera *, GPContext *, RicohRecMode *);
int ricoh_set_rec_mode (Camera *, GPContext *, RicohRecMode);

typedef enum _RicohCompression RicohCompression;
enum _RicohCompression {
	RICOH_COMPRESSION_NONE = 0x00,
	RICOH_COMPRESSION_MAX  = 0x01,
	RICOH_COMPRESSION_NORM = 0x02,
	RICOH_COMPRESSION_MIN  = 0x03
};

int ricoh_get_compression (Camera *, GPContext *, RicohCompression *);
int ricoh_set_compression (Camera *, GPContext *, RicohCompression);

#endif /* __RICOH_H__ */