1/*
2 * 1394-Based Digital Camera Control Library
3 *
4 * A few type definitions
5 *
6 * Written by Damien Douxchamps <ddouxchamps@users.sf.net>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __DC1394_TYPES_H__
24#define __DC1394_TYPES_H__
25
26/*! \file dc1394/types.h
27 \brief Various types that must be defined here
28
29 More details soon
30*/
31
32#include <stdint.h>
33
34/**
35 * Enumeration of video modes. Note that the notion of IIDC "format" is not present here, except in the format_7 name.
36 */
37typedef enum {
38 DC1394_VIDEO_MODE_160x120_YUV444= 64,
39 DC1394_VIDEO_MODE_320x240_YUV422,
40 DC1394_VIDEO_MODE_640x480_YUV411,
41 DC1394_VIDEO_MODE_640x480_YUV422,
42 DC1394_VIDEO_MODE_640x480_RGB8,
43 DC1394_VIDEO_MODE_640x480_MONO8,
44 DC1394_VIDEO_MODE_640x480_MONO16,
45 DC1394_VIDEO_MODE_800x600_YUV422,
46 DC1394_VIDEO_MODE_800x600_RGB8,
47 DC1394_VIDEO_MODE_800x600_MONO8,
48 DC1394_VIDEO_MODE_1024x768_YUV422,
49 DC1394_VIDEO_MODE_1024x768_RGB8,
50 DC1394_VIDEO_MODE_1024x768_MONO8,
51 DC1394_VIDEO_MODE_800x600_MONO16,
52 DC1394_VIDEO_MODE_1024x768_MONO16,
53 DC1394_VIDEO_MODE_1280x960_YUV422,
54 DC1394_VIDEO_MODE_1280x960_RGB8,
55 DC1394_VIDEO_MODE_1280x960_MONO8,
56 DC1394_VIDEO_MODE_1600x1200_YUV422,
57 DC1394_VIDEO_MODE_1600x1200_RGB8,
58 DC1394_VIDEO_MODE_1600x1200_MONO8,
59 DC1394_VIDEO_MODE_1280x960_MONO16,
60 DC1394_VIDEO_MODE_1600x1200_MONO16,
61 DC1394_VIDEO_MODE_EXIF,
62 DC1394_VIDEO_MODE_FORMAT7_0,
63 DC1394_VIDEO_MODE_FORMAT7_1,
64 DC1394_VIDEO_MODE_FORMAT7_2,
65 DC1394_VIDEO_MODE_FORMAT7_3,
66 DC1394_VIDEO_MODE_FORMAT7_4,
67 DC1394_VIDEO_MODE_FORMAT7_5,
68 DC1394_VIDEO_MODE_FORMAT7_6,
69 DC1394_VIDEO_MODE_FORMAT7_7
70} dc1394video_mode_t;
71#define DC1394_VIDEO_MODE_MIN DC1394_VIDEO_MODE_160x120_YUV444
72#define DC1394_VIDEO_MODE_MAX DC1394_VIDEO_MODE_FORMAT7_7
73#define DC1394_VIDEO_MODE_NUM (DC1394_VIDEO_MODE_MAX - DC1394_VIDEO_MODE_MIN + 1)
74
75/* Special min/max are defined for Format_7 */
76#define DC1394_VIDEO_MODE_FORMAT7_MIN DC1394_VIDEO_MODE_FORMAT7_0
77#define DC1394_VIDEO_MODE_FORMAT7_MAX DC1394_VIDEO_MODE_FORMAT7_7
78#define DC1394_VIDEO_MODE_FORMAT7_NUM (DC1394_VIDEO_MODE_FORMAT7_MAX - DC1394_VIDEO_MODE_FORMAT7_MIN + 1)
79
80/**
81 * Enumeration of colour codings. For details on the data format please read the IIDC specifications.
82 */
83typedef enum {
84 DC1394_COLOR_CODING_MONO8= 352,
85 DC1394_COLOR_CODING_YUV411,
86 DC1394_COLOR_CODING_YUV422,
87 DC1394_COLOR_CODING_YUV444,
88 DC1394_COLOR_CODING_RGB8,
89 DC1394_COLOR_CODING_MONO16,
90 DC1394_COLOR_CODING_RGB16,
91 DC1394_COLOR_CODING_MONO16S,
92 DC1394_COLOR_CODING_RGB16S,
93 DC1394_COLOR_CODING_RAW8,
94 DC1394_COLOR_CODING_RAW16
95} dc1394color_coding_t;
96#define DC1394_COLOR_CODING_MIN DC1394_COLOR_CODING_MONO8
97#define DC1394_COLOR_CODING_MAX DC1394_COLOR_CODING_RAW16
98#define DC1394_COLOR_CODING_NUM (DC1394_COLOR_CODING_MAX - DC1394_COLOR_CODING_MIN + 1)
99
100/**
101 * RAW sensor filters. These elementary tiles tesselate the image plane in RAW modes. RGGB should be interpreted in 2D as
102 *
103 * RG
104 * GB
105 *
106 * and similarly for other filters.
107 */
108typedef enum {
109 DC1394_COLOR_FILTER_RGGB = 512,
110 DC1394_COLOR_FILTER_GBRG,
111 DC1394_COLOR_FILTER_GRBG,
112 DC1394_COLOR_FILTER_BGGR
113} dc1394color_filter_t;
114#define DC1394_COLOR_FILTER_MIN DC1394_COLOR_FILTER_RGGB
115#define DC1394_COLOR_FILTER_MAX DC1394_COLOR_FILTER_BGGR
116#define DC1394_COLOR_FILTER_NUM (DC1394_COLOR_FILTER_MAX - DC1394_COLOR_FILTER_MIN + 1)
117
118/**
119 * Byte order for YUV formats (may be expanded to RGB in the future)
120 *
121 * IIDC cameras always return data in UYVY order, but conversion functions can change this if requested.
122 */
123typedef enum {
124 DC1394_BYTE_ORDER_UYVY=800,
125 DC1394_BYTE_ORDER_YUYV
126} dc1394byte_order_t;
127#define DC1394_BYTE_ORDER_MIN DC1394_BYTE_ORDER_UYVY
128#define DC1394_BYTE_ORDER_MAX DC1394_BYTE_ORDER_YUYV
129#define DC1394_BYTE_ORDER_NUM (DC1394_BYTE_ORDER_MAX - DC1394_BYTE_ORDER_MIN + 1)
130
131/**
132 * A struct containing a list of color codings
133 */
134typedef struct
135{
136 uint32_t num;
137 dc1394color_coding_t codings[DC1394_COLOR_CODING_NUM];
138} dc1394color_codings_t;
139
140/**
141 * A struct containing a list of video modes
142 */
143typedef struct
144{
145 uint32_t num;
146 dc1394video_mode_t modes[DC1394_VIDEO_MODE_NUM];
147} dc1394video_modes_t;
148
149/**
150 * Yet another boolean data type
151 */
152typedef enum {
153 DC1394_FALSE= 0,
154 DC1394_TRUE
155} dc1394bool_t;
156
157/**
158 * Yet another boolean data type, a bit more oriented towards electrical-engineers
159 */
160typedef enum {
161 DC1394_OFF= 0,
162 DC1394_ON
163} dc1394switch_t;
164
165
166#endif
167

source code of include/dc1394/types.h