1 /****************************************************************/
2 /* spca50x.h - Gphoto2 library for cameras with sunplus spca50x */
5 /* Copyright © 2002, 2003 Till Adam */
7 /* Author: Till Adam <till@adam-lilienthal.de> */
9 /* This library is free software; you can redistribute it */
10 /* and/or modify it under the terms of the GNU Library General */
11 /* Public License as published by the Free Software Foundation; */
12 /* either version 2 of the License, or (at your option) any */
15 /* This library is distributed in the hope that it will be */
16 /* useful, but WITHOUT ANY WARRANTY; without even the implied */
17 /* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
18 /* PURPOSE. See the GNU Library General Public License for */
21 /* You should have received a copy of the GNU Library General */
22 /* Public License along with this library; if not, write to the */
23 /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */
24 /* Boston, MA 02111-1307, USA. */
25 /****************************************************************/
30 #include <gphoto2/gphoto2-camera.h>
32 #define SPCA50X_FAT_PAGE_SIZE 0x100
33 #define SPCA50X_FILE_TYPE_IMAGE 0x00
34 #define SPCA50X_FILE_TYPE_AVI 0x01
36 #define CHECK(result) {int res; res = result; if (res < 0) return (res);}
47 int type; /* not necessarily the same thing as mime_type! */
49 uint8_t *thumb; /* used to cache the thumbnail data, for some cams */
55 BRIDGE_SPCA504B_PD /* with specialized pure digital firmware */
58 struct _CameraPrivateLibrary
63 int storage_media_mask;
65 SPCA50xBridgeChip bridge;
66 int num_files_on_flash;
67 int num_files_on_sdram;
75 struct SPCA50xFile *files;
78 #define SPCA50X_SDRAM 0x01
79 #define SPCA50X_FLASH 0x02
80 #define SPCA50X_CARD 0x04
82 #define SPCA50X_JPG_DEFAULT_HEADER_LENGTH 589
83 int spca50x_get_firmware_revision (CameraPrivateLibrary *lib);
84 int spca50x_detect_storage_type (CameraPrivateLibrary *lib);
85 int spca50x_reset (CameraPrivateLibrary * lib);
86 int spca50x_capture (CameraPrivateLibrary * lib);
87 int yuv2rgb (int y, int u, int v, int *r, int *g, int *b);
88 void create_jpeg_from_data (uint8_t * dst, uint8_t * src, int qIndex,
89 int w, int h, uint8_t format,
90 int original_size, int *size,
91 int omit_huffman_table, int omit_escape);
93 #endif /* __SPCA50X_H__ */