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
5 * See the README.txt file for copyright information and how to reach the author(s).
14 #if defined(__LIBVLC__)
19 /* some things need to be changed if this code is used inside VideoLan Filter Module */
20 # define _ATMO_VLC_PLUGIN_
21 # define get_time mdate()
22 # define do_sleep(a) msleep(a)
26 # define MakeDword(ch1,ch2,ch3,ch4) ((((DWORD)(ch1)&255) << 24) | \
27 (((DWORD)(ch2)&255) << 16) | \
28 (((DWORD)(ch3)&255) << 8) | \
31 # define get_time GetTickCount()
32 # define do_sleep(a) Sleep(a)
36 #define ATMO_BOOL bool
37 #define ATMO_TRUE true
38 #define ATMO_FALSE false
42 can't use the VLC_TWOCC macro because the byte order there is CPU dependent
43 but for the use in Atmo I need for this single purpose Intel Byte Order
47 #define MakeIntelWord(ch1,ch2) ((((int)(ch1)&255)<<8) | \
50 // my own min max macros
51 #define ATMO_MIN(X, Y) ((X) < (Y) ? (X) : (Y))
52 #define ATMO_MAX(X, Y) ((X) > (Y) ? (X) : (Y))
57 #define INVALID_HANDLE_VALUE -1
59 typedef unsigned long DWORD;
63 #if !defined(_BITMAPFILEHEADER_)
64 #define _BITMAPFILEHEADER_
66 #ifdef HAVE_ATTRIBUTE_PACKED
67 __attribute__((__packed__))
75 } BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
82 // maximal Anzahl Kanäle... original 5!
83 #define CAP_MAX_NUM_ZONES 64
84 // only for classic to avoid changing too much code!
85 // #define ATMO_MAX_NUM_CHANNELS 5
87 // capture width/height
89 // #define CAP_WIDTH 88
93 # define CAP_HEIGHT 48
96 # define CAP_HEIGHT 48
100 #define IMAGE_SIZE (CAP_WIDTH * CAP_HEIGHT)
103 number of pixel the atmo zones should overlap - based on CAP_WIDTH and CAP_HEIGHT
105 #define CAP_ZONE_OVERLAP 2
109 enum AtmoConnectionType
119 static const char *AtmoDeviceTypes[] = {
129 #define ATMO_DEVICE_COUNT 7
131 #if defined(_ATMO_VLC_PLUGIN_)
139 enum LivePictureSource {
155 enum LivePictureSource {
157 lpsScreenCapture = 1,
163 enum AtmoGammaCorrect {
169 enum AtmoFilterMode {
176 // --- tRGBColor --------------------------------------------------------------
179 unsigned char r, g, b;
182 // --- tColorPacket -----------------------------------------------------------
188 typedef xColorPacket* pColorPacket;
189 #define AllocColorPacket(packet, numColors_) packet = (pColorPacket)new char[sizeof(xColorPacket) + (numColors_)*sizeof(tRGBColor)]; \
190 packet->numColors = numColors_;
192 #define DupColorPacket(dest, source) dest = NULL; \
194 dest = (pColorPacket)new char[sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)]; \
195 memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)); \
198 #define CopyColorPacket( source, dest) memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor) );
201 #define ZeroColorPacket( packet ) memset( &((packet)->zone[0]), 0, (packet->numColors)*sizeof(tRGBColor));
203 // --- tRGBColorLongInt -------------------------------------------------------
209 // --- tColorPacketLongInt ----------------------------------------------------
213 tRGBColorLongInt longZone[1];
214 } xColorPacketLongInt;
215 typedef xColorPacketLongInt* pColorPacketLongInt;
216 #define AllocLongColorPacket(packet, numColors_) packet = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (numColors_)*sizeof(tRGBColorLongInt)]; \
217 packet->numColors = numColors_;
219 #define DupLongColorPacket(dest, source) dest = NULL; \
221 dest = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)]; \
222 memcpy(dest, source, sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)); \
224 #define ZeroLongColorPacket( packet ) memset( &((packet)->longZone[0]), 0, (packet->numColors)*sizeof(tRGBColorLongInt));
227 // --- tWeightPacket ----------------------------------------------------------
231 int channel[CAP_MAX_NUM_ZONES];
235 // --- tHSVColor --------------------------------------------------------------
238 unsigned char h, s, v;