Debian Codegraph @

camlibs/kodak/dc210/library.h

raw
1 /* library.h
2 *
3 * Copyright (C) 2002 Michel Koltan <[email protected]>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
19 */
20
21
22 #ifndef CAMLIBS_KODAK_DC210_LIBRARY_H
23 #define CAMLIBS_KODAK_DC210_LIBRARY_H
24
25 #define DC210_CMD_OKAY 0
26 #define DC210_WRITE_ERROR -1
27 #define DC210_READ_ERROR -2
28 #define DC210_TIMEOUT_ERROR -3
29 #define DC210_NAK_ERROR -4
30 #define DC210_GARBAGE_ERROR -5
31
32 #define THUMBHEIGHT 72
33 #define THUMBWIDTH 96
34 #define RED 0
35 #define GREEN 1
36 #define BLUE 2
37
38 static void cfa2ppm (CameraFile * file);
39 static void dc210_cmd_init (char *cmd, unsigned char command_byte);
40 static void dc210_cmd_packet_init (char * cmd_packet, const char * filename);
41 static int dc210_write_single_char (Camera *camera, unsigned char response);
42 static int dc210_write_command_packet(Camera * camera, char * data);
43 static int dc210_execute_command (Camera *camera, char *cmd);
44 static int dc210_read_single_char (Camera *camera, unsigned char * p);
45 static int dc210_wait_for_response (Camera *camera, int expect_busy, GPContext *context);
46 static int dc210_read_to_file (Camera *camera, CameraFile * f, int blocksize, long int expectsize, GPContext *context);
47 static int dc210_read_single_block (Camera *camera, unsigned char * b, int blocksize);
48 static int dc210_set_option (Camera * camera, char command, unsigned int value, int valuesize);
49 static int dc210_check_battery (Camera *camera);
50 static int dc210_get_card_status (Camera * camera, dc210_card_status * card_status);
51 static void dc210_picinfo_from_block (dc210_picture_info * picinfo, unsigned char * data);
52
53 #ifdef DEBUG
54 static int dc210_read_dummy_packet(Camera * camera);
55 static int dc210_test_command(Camera * camera, unsigned char cmdbyte, unsigned char *databytes);
56 #endif
57
58 #endif /* !defined(CAMLIBS_KODAK_DC210_LIBRARY_H) */
59
60