]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoDefs.h
C++ <inttypes.h> inclusion fixes
[vlc] / modules / video_filter / atmo / AtmoDefs.h
1 /*
2  * AtmoDefs.h: a lot of globals defines for the color computation - most of this file
3  * is an one  to one copy of "defs.h" from Atmo VDR Plugin
4  *
5  * See the README.txt file for copyright information and how to reach the author(s).
6  *
7  * $Id$
8  */
9
10 #ifndef _AtmoDefs_h_
11 #define _AtmoDefs_h_
12
13 #if defined(__LIBVLC__)
14 #   include "config.h"
15
16 #   define __STDC_CONSTANT_MACROS 1
17 #   include <inttypes.h>
18
19 #   include <vlc/vlc.h>
20
21 /* some things need to be changed if this code is used inside VideoLan Filter Module */
22 #   define _ATMO_VLC_PLUGIN_
23 #   define ATMO_BOOL bool
24 #   define ATMO_TRUE true
25 #   define ATMO_FALSE false
26
27 #else
28
29     typedef int ATMO_BOOL;
30 #   define ATMO_TRUE   1
31 #   define ATMO_FALSE  0
32 #   define MakeWord(ch1,ch2)  ((((int)(ch1)&255)<<8) | \
33                            ((int)(ch2)&255))
34
35 #   define MakeDword(ch1,ch2,ch3,ch4) ((((DWORD)(ch1)&255) << 24) | \
36                                    (((DWORD)(ch2)&255) << 16) | \
37                                    (((DWORD)(ch3)&255) << 8) | \
38                                    (((DWORD)(ch4)&255)))
39
40
41 #endif
42
43
44 #if !defined(WIN32)
45
46 #define INVALID_HANDLE_VALUE -1
47 typedef int HANDLE;
48 typedef unsigned long DWORD;
49
50 #define BI_RGB 0L
51
52 #if !defined(_BITMAPFILEHEADER_)
53 #define _BITMAPFILEHEADER_
54 typedef struct
55 #ifdef HAVE_ATTRIBUTE_PACKED
56     __attribute__((__packed__))
57 #endif
58 {
59         uint16_t   bfType;
60         uint32_t   bfSize;
61         uint16_t   bfReserved1;
62         uint16_t   bfReserved2;
63         uint32_t   bfOffBits;
64 } BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
65 #endif
66
67 #endif
68
69
70
71
72
73
74
75 // maximal Anzahl Kanäle...
76 #define ATMO_NUM_CHANNELS   5
77
78 // capture width/height
79 #define CAP_WIDTH    64
80 #define CAP_HEIGHT   48
81
82 // imagesize
83 #define IMAGE_SIZE   (CAP_WIDTH * CAP_HEIGHT)
84
85
86 enum AtmoConnectionType
87 {
88       actSerialPort = 0,
89       actDummy = 1,
90       actDMX = 2
91 };
92 static const char *AtmoDeviceTypes[] = {
93       "Atmo",
94       "Dummy",
95       "DMX"
96   };
97 #define ATMO_DEVICE_COUNT 3
98
99 #if defined(_ATMO_VLC_PLUGIN_)
100 enum EffectMode {
101       emUndefined = -1,
102       emDisabled = 0,
103       emStaticColor = 1,
104       emLivePicture = 2
105    };
106 #else
107 enum EffectMode {
108       emUndefined = -1,
109       emDisabled = 0,
110       emStaticColor = 1,
111       emLivePicture = 2,
112       emColorChange = 3,
113       emLrColorChange = 4
114    };
115 #endif
116
117
118
119
120 enum AtmoFilterMode {
121      afmNoFilter,
122      afmCombined,
123      afmPercent
124 };
125
126 typedef struct {
127     ATMO_BOOL system;
128     char name[64];
129     int mappings[ATMO_NUM_CHANNELS];
130 } tChannelAssignment;
131
132
133 // --- tRGBColor --------------------------------------------------------------
134 typedef struct
135 {
136   unsigned char r, g, b;
137 } tRGBColor;
138
139 // --- tColorPacket -----------------------------------------------------------
140 typedef struct
141 {
142   tRGBColor channel[ATMO_NUM_CHANNELS];
143 } tColorPacket;
144
145 // --- tRGBColorLongInt -------------------------------------------------------
146 typedef struct
147 {
148   long int r, g, b;
149 } tRGBColorLongInt;
150
151 // --- tColorPacketLongInt ----------------------------------------------------
152 typedef struct
153 {
154   tRGBColorLongInt channel[ATMO_NUM_CHANNELS];
155 } tColorPacketLongInt;
156
157 // --- tWeightPacket ----------------------------------------------------------
158 typedef struct
159 {
160   int channel[ATMO_NUM_CHANNELS];
161 } tWeightPacket;
162
163 // --- tHSVColor --------------------------------------------------------------
164 typedef struct
165 {
166   unsigned char h, s, v;
167 } tHSVColor;
168
169 #endif