summaryrefslogtreecommitdiff
path: root/camlibs/spca50x/spca50x-flash.h
blob: 19f624af4652d025647058e56c18a82c889d30f6 (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
/* spca50x_flash.h
 *
 *  This library is free software; you can redistribute and/or
 *  modify it inder the terms of the GNU Lesser Genreral Public
 *  License as publiced 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 warrenty of
 *  MERCHANTABULITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  lesser General Public License for more details.
 *
 *  Author: Till Adam <till@adam-lilienthal.de>
 *  based on work by: Mark A. Zimmerman <mark@foresthaven.com>
 */

#ifndef CAMLIBS_SPCA50X_SPCA50X_FLASH_H
#define CAMLIBS_SPCA50X_SPCA50X_FLASH_H

#include <gphoto2/gphoto2.h>
#include <gphoto2/gphoto2-port.h>

#define CHECK(result) {int res; res = result; if (res < 0) return (res);}

int spca50x_flash_init(CameraPrivateLibrary *pl, GPContext *context);
int spca50x_flash_close(CameraPrivateLibrary *pl, GPContext *context);

int spca50x_flash_get_TOC(CameraPrivateLibrary *pl, int *filecount);
int spca50x_flash_get_file_name(CameraPrivateLibrary *pl, int index, char *name);
int spca50x_flash_get_file_dimensions(CameraPrivateLibrary *pl, int index,
		int *w, int *h);
int spca50x_flash_get_file (CameraPrivateLibrary *pl, GPContext *context,
		uint8_t **buf, unsigned int *len, int index, int thumbnail);
int spca50x_flash_get_file_size(CameraPrivateLibrary *pl, int index, int *size);
int spca50x_flash_get_filecount(CameraPrivateLibrary *pl, int *filecount);
int spca50x_flash_delete_all (CameraPrivateLibrary *pl, GPContext *context);

/* for testing */
int spca500_flash_delete_file (CameraPrivateLibrary *pl, int index);
int spca500_flash_capture (CameraPrivateLibrary *pl);

#endif /* !defined(CAMLIBS_SPCA50X_SPCA50X_FLASH_H) */