summaryrefslogtreecommitdiff
path: root/camlibs/sonix/sonix.h
blob: 8af1af04c0f0c02bcc3355ed037e94cd565da779 (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
/* sonix.h
 *
 * Copyright (C) 2005 Theodore Kilgore <kilgota@auburn.edu>
 *
 * 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., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301  USA
 */

#ifndef CAMLIBS_SONIX_SONIX_H
#define CAMLIBS_SONIX_SONIX_H

#include <gphoto2/gphoto2-port.h>

#define DECOMP	1
#define REVERSE	2

struct _CameraPrivateLibrary {
/*	Model model; */ 	/* "model" and "fwversion" functionally equal */
	int num_pics;
	unsigned char size_code[512];
	unsigned char fwversion[4];
	unsigned char full;
	unsigned char avitype;
	unsigned char post;
	unsigned char offset;
	unsigned char avi_offset;
	unsigned char can_do_capture;
	int sonix_init_done;
};


int sonix_init              	(GPPort *port, CameraPrivateLibrary *priv);
int sonix_get_picture_size   	(GPPort *port, int n);
int sonix_read_data_size 	(GPPort *port, int n);
int sonix_delete_all_pics      	(GPPort *port);
int sonix_delete_last      	(GPPort *port);
int sonix_capture_image      	(GPPort *port);
int sonix_exit		      	(GPPort *port);
int sonix_decode		(unsigned char * dst, unsigned char * src,
				    int width, int height);
int sonix_byte_reverse (unsigned char *imagedata, int datasize);
int sonix_rows_reverse (unsigned char *imagedata, int width, int height);
int sonix_cols_reverse (unsigned char *imagedata, int width, int height);
int white_balance (unsigned char *data, unsigned int size, float saturation);

#endif /* !defined(CAMLIBS_SONIX_SONIX_H) */