AtmoDefs.h 3.28 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * AtmoDefs.h: a lot of globals defines for the color computation - most of this file
 * is an one  to one copy of "defs.h" from Atmo VDR Plugin
 *
 * See the README.txt file for copyright information and how to reach the author(s).
 *
 * $Id$
 */

#ifndef _AtmoDefs_h_
#define _AtmoDefs_h_

#if defined(__LIBVLC__)
#   include "config.h"
#   include <vlc/vlc.h>

/* some things need to be changed if this code is used inside VideoLan Filter Module */
#   define _ATMO_VLC_PLUGIN_
#   define ATMO_BOOL vlc_bool_t
#   define ATMO_TRUE VLC_TRUE
#   define ATMO_FALSE VLC_FALSE

#else

    typedef int ATMO_BOOL;
#   define ATMO_TRUE   1
#   define ATMO_FALSE  0
28
29
30
31
32
33
34
35
#   define MakeWord(ch1,ch2)  ((((int)(ch1)&255)<<8) | \
                           ((int)(ch2)&255))

#   define MakeDword(ch1,ch2,ch3,ch4) ((((DWORD)(ch1)&255) << 24) | \
                                   (((DWORD)(ch2)&255) << 16) | \
                                   (((DWORD)(ch3)&255) << 8) | \
                                   (((DWORD)(ch4)&255)))

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

#endif


#if !defined(WIN32)

#define INVALID_HANDLE_VALUE -1
typedef int HANDLE;
typedef unsigned long DWORD;

#define BI_RGB 0L

#if !defined(_BITMAPFILEHEADER_)
#define _BITMAPFILEHEADER_
typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
    __attribute__((__packed__))
#endif
{
        uint16_t   bfType;
        uint32_t   bfSize;
        uint16_t   bfReserved1;
        uint16_t   bfReserved2;
        uint32_t   bfOffBits;
} BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
#endif

#endif



67
68
69



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165

// maximal Anzahl Kanle...
#define ATMO_NUM_CHANNELS   5

// capture width/height
#define CAP_WIDTH    64
#define CAP_HEIGHT   48

// imagesize
#define IMAGE_SIZE   (CAP_WIDTH * CAP_HEIGHT)


enum AtmoConnectionType
{
      actSerialPort = 0,
      actDummy = 1,
      actDMX = 2
};
static const char *AtmoDeviceTypes[] = {
      "Atmo",
      "Dummy",
      "DMX"
  };
#define ATMO_DEVICE_COUNT 3

#if defined(_ATMO_VLC_PLUGIN_)
enum EffectMode {
      emUndefined = -1,
      emDisabled = 0,
      emStaticColor = 1,
      emLivePicture = 2
   };
#else
enum EffectMode {
      emUndefined = -1,
      emDisabled = 0,
      emStaticColor = 1,
      emLivePicture = 2,
      emColorChange = 3,
      emLrColorChange = 4
   };
#endif




enum AtmoFilterMode {
     afmNoFilter,
     afmCombined,
     afmPercent
};

typedef struct {
    ATMO_BOOL system;
    char name[64];
    int mappings[ATMO_NUM_CHANNELS];
} tChannelAssignment;


// --- tRGBColor --------------------------------------------------------------
typedef struct
{
  unsigned char r, g, b;
} tRGBColor;

// --- tColorPacket -----------------------------------------------------------
typedef struct
{
  tRGBColor channel[ATMO_NUM_CHANNELS];
} tColorPacket;

// --- tRGBColorLongInt -------------------------------------------------------
typedef struct
{
  long int r, g, b;
} tRGBColorLongInt;

// --- tColorPacketLongInt ----------------------------------------------------
typedef struct
{
  tRGBColorLongInt channel[ATMO_NUM_CHANNELS];
} tColorPacketLongInt;

// --- tWeightPacket ----------------------------------------------------------
typedef struct
{
  int channel[ATMO_NUM_CHANNELS];
} tWeightPacket;

// --- tHSVColor --------------------------------------------------------------
typedef struct
{
  unsigned char h, s, v;
} tHSVColor;

#endif