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__)
17 # include <vlc_common.h>
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
120 static const char *AtmoDeviceTypes[] = {
130 #define ATMO_DEVICE_COUNT 8
132 #if defined(_ATMO_VLC_PLUGIN_)
140 enum LivePictureSource {
156 enum LivePictureSource {
158 lpsScreenCapture = 1,
164 enum AtmoGammaCorrect {
170 enum AtmoFilterMode {
177 // --- tRGBColor --------------------------------------------------------------
180 unsigned char r, g, b;
183 // --- tColorPacket -----------------------------------------------------------
189 typedef xColorPacket* pColorPacket;
190 #define AllocColorPacket(packet, numColors_) packet = (pColorPacket)new char[sizeof(xColorPacket) + (numColors_)*sizeof(tRGBColor)]; \
191 packet->numColors = numColors_;
193 #define DupColorPacket(dest, source) dest = NULL; \
195 dest = (pColorPacket)new char[sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)]; \
196 memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)); \
199 #define CopyColorPacket( source, dest) memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor) );
202 #define ZeroColorPacket( packet ) memset( &((packet)->zone[0]), 0, (packet->numColors)*sizeof(tRGBColor));
204 // --- tRGBColorLongInt -------------------------------------------------------
210 // --- tColorPacketLongInt ----------------------------------------------------
214 tRGBColorLongInt longZone[1];
215 } xColorPacketLongInt;
216 typedef xColorPacketLongInt* pColorPacketLongInt;
217 #define AllocLongColorPacket(packet, numColors_) packet = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (numColors_)*sizeof(tRGBColorLongInt)]; \
218 packet->numColors = numColors_;
220 #define DupLongColorPacket(dest, source) dest = NULL; \
222 dest = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)]; \
223 memcpy(dest, source, sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)); \
225 #define ZeroLongColorPacket( packet ) memset( &((packet)->longZone[0]), 0, (packet->numColors)*sizeof(tRGBColorLongInt));
228 // --- tWeightPacket ----------------------------------------------------------
232 int channel[CAP_MAX_NUM_ZONES];
236 // --- tHSVColor --------------------------------------------------------------
239 unsigned char h, s, v;