Remove generated files
[framework/connectivity/libgphoto2.git] / camlibs / spca50x / spca50x.h
1 /****************************************************************/
2 /* spca50x.h - Gphoto2 library for cameras with sunplus spca50x */
3 /*             chips                                            */
4 /*                                                              */
5 /* Copyright © 2002, 2003 Till Adam                             */
6 /*                                                              */
7 /* Author: Till Adam <till@adam-lilienthal.de>                  */
8 /*                                                              */
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     */
13 /* later version.                                               */
14 /*                                                              */
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     */
19 /* more details.                                                */
20 /*                                                              */
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 /****************************************************************/
26
27 #ifndef __SPCA50X_H__
28 #define __SPCA50X_H__
29 #include <_stdint.h>
30 #include <gphoto2/gphoto2-camera.h>
31
32 #define SPCA50X_FAT_PAGE_SIZE 0x100
33 #define SPCA50X_FILE_TYPE_IMAGE 0x00
34 #define SPCA50X_FILE_TYPE_AVI 0x01
35
36 #define CHECK(result) {int res; res = result; if (res < 0) return (res);}
37
38 struct SPCA50xFile
39 {
40         char *name;
41         int width;
42         int height;
43         int fat_start;
44         int fat_end;
45         uint8_t *fat;
46         int mime_type;
47         int type; /* not necessarily the same thing as mime_type! */
48         unsigned int size;
49         uint8_t *thumb; /* used to cache the thumbnail data, for some cams */
50 };
51
52 typedef enum {
53         BRIDGE_SPCA500,
54         BRIDGE_SPCA504,
55         BRIDGE_SPCA504B_PD    /* with specialized pure digital firmware */
56 } SPCA50xBridgeChip;
57
58 struct _CameraPrivateLibrary
59 {
60         GPPort *gpdev;
61         int dirty_sdram:1;
62         int dirty_flash:1;
63         int storage_media_mask;
64         uint8_t fw_rev;
65         SPCA50xBridgeChip bridge;
66         int num_files_on_flash;
67         int num_files_on_sdram;
68         int num_images;
69         int num_movies;
70         int num_fats;
71         int size_used;
72         int size_free;
73         uint8_t *flash_toc;
74         uint8_t *fats;
75         struct SPCA50xFile *files;
76 };
77
78 #define SPCA50X_SDRAM 0x01
79 #define SPCA50X_FLASH 0x02
80 #define SPCA50X_CARD  0x04
81
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);
92
93 #endif /* __SPCA50X_H__ */