AtmoDefs.h

Go to the documentation of this file.
00001 /*
00002  * AtmoDefs.h: a lot of globals defines for the color computation - most of this file
00003  * is an one  to one copy of "defs.h" from Atmo VDR Plugin
00004  *
00005  * See the README.txt file for copyright information and how to reach the author(s).
00006  *
00007  * $Id: ed48e880f31caf5f65c1bb5f92de9b3619dc5e9b $
00008  */
00009 
00010 #ifndef _AtmoDefs_h_
00011 #define _AtmoDefs_h_
00012 
00013 
00014 #if defined(__LIBVLC__)
00015 
00016 #   include "config.h"
00017 #   include <vlc_common.h>
00018 
00019 /* some things need to be changed if this code is used inside VideoLan Filter Module */
00020 #   define _ATMO_VLC_PLUGIN_
00021 #   define get_time mdate()
00022 #   define do_sleep(a) msleep(a)
00023 
00024 #else
00025 
00026 #   define MakeDword(ch1,ch2,ch3,ch4) ((((DWORD)(ch1)&255) << 24) | \
00027                                    (((DWORD)(ch2)&255) << 16) | \
00028                                    (((DWORD)(ch3)&255) << 8) | \
00029                                    (((DWORD)(ch4)&255)))
00030 
00031 #  define get_time GetTickCount()
00032 #  define do_sleep(a) Sleep(a)
00033 
00034 #endif
00035 
00036 #define ATMO_BOOL   bool
00037 #define ATMO_TRUE   true
00038 #define ATMO_FALSE  false
00039 
00040 
00041 /*
00042   can't use the VLC_TWOCC macro because the byte order there is CPU dependent
00043   but for the use in Atmo I need for this single purpose Intel Byte Order
00044   every time!
00045 */
00046 
00047 #define MakeIntelWord(ch1,ch2)  ((((int)(ch1)&255)<<8) | \
00048                            ((int)(ch2)&255))
00049 
00050 // my own min max macros
00051 #define ATMO_MIN(X, Y)  ((X) < (Y) ? (X) : (Y))
00052 #define ATMO_MAX(X, Y)  ((X) > (Y) ? (X) : (Y))
00053 
00054 
00055 #if !defined(WIN32)
00056 
00057 #define INVALID_HANDLE_VALUE -1
00058 typedef int HANDLE;
00059 typedef unsigned long DWORD;
00060 
00061 #define BI_RGB 0L
00062 
00063 #if !defined(_BITMAPFILEHEADER_)
00064 #define _BITMAPFILEHEADER_
00065 typedef struct
00066 #ifdef HAVE_ATTRIBUTE_PACKED
00067     __attribute__((__packed__))
00068 #endif
00069 {
00070         uint16_t   bfType;
00071         uint32_t   bfSize;
00072         uint16_t   bfReserved1;
00073         uint16_t   bfReserved2;
00074         uint32_t   bfOffBits;
00075 } BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
00076 #endif
00077 
00078 #endif
00079 
00080 
00081 
00082 // maximal Anzahl Kanäle... original 5!
00083 #define CAP_MAX_NUM_ZONES  64
00084 // only for classic to avoid changing too much code!
00085 // #define ATMO_MAX_NUM_CHANNELS 5
00086 
00087 // capture width/height
00088 
00089 // #define CAP_WIDTH    88
00090 
00091 #ifdef CAP_16x9
00092 # define CAP_WIDTH    88
00093 # define CAP_HEIGHT   48
00094 #else
00095 # define CAP_WIDTH    64
00096 # define CAP_HEIGHT   48
00097 #endif
00098 
00099 // imagesize
00100 #define IMAGE_SIZE   (CAP_WIDTH * CAP_HEIGHT)
00101 
00102 /*
00103   number of pixel the atmo zones should overlap - based on CAP_WIDTH and CAP_HEIGHT
00104 */
00105 #define CAP_ZONE_OVERLAP  2
00106 
00107 
00108 
00109 enum AtmoConnectionType
00110 {
00111       actClassicAtmo = 0,
00112       actDummy = 1,
00113       actDMX = 2,
00114       actNUL = 3,
00115       actMultiAtmo = 4,
00116       actMondolight = 5,
00117       actMoMoLight  = 6
00118 };
00119 static const char *AtmoDeviceTypes[] = {
00120       "Atmo-Classic",
00121       "Dummy",
00122       "DMX",
00123       "Nul-Device",
00124       "Multi-Atmo",
00125       "Mondolight",
00126       "MoMoLight"
00127 
00128   };
00129 #define ATMO_DEVICE_COUNT 7
00130 
00131 #if defined(_ATMO_VLC_PLUGIN_)
00132 enum EffectMode {
00133       emUndefined = -1,
00134       emDisabled = 0,
00135       emStaticColor = 1,
00136       emLivePicture = 2
00137    };
00138 
00139 enum LivePictureSource {
00140        lpsDisabled = 0,
00141        lpsExtern = 2
00142      };
00143 
00144 #else
00145 
00146 enum EffectMode {
00147       emUndefined = -1,
00148       emDisabled = 0,
00149       emStaticColor = 1,
00150       emLivePicture = 2,
00151       emColorChange = 3,
00152       emLrColorChange = 4
00153    };
00154 
00155 enum LivePictureSource {
00156        lpsDisabled = 0,
00157        lpsScreenCapture = 1,
00158        lpsExtern = 2
00159      };
00160 
00161 #endif
00162 
00163 enum AtmoGammaCorrect {
00164      agcNone = 0,
00165      agcPerColor = 1,
00166      agcGlobal = 2
00167 };
00168 
00169 enum AtmoFilterMode {
00170      afmNoFilter,
00171      afmCombined,
00172      afmPercent
00173 };
00174 
00175 
00176 // --- tRGBColor --------------------------------------------------------------
00177 typedef struct
00178 {
00179   unsigned char r, g, b;
00180 } tRGBColor;
00181 
00182 // --- tColorPacket -----------------------------------------------------------
00183 typedef struct
00184 {
00185    int numColors;
00186    tRGBColor zone[1];
00187 } xColorPacket;
00188 typedef xColorPacket* pColorPacket;
00189 #define AllocColorPacket(packet, numColors_) packet = (pColorPacket)new char[sizeof(xColorPacket) + (numColors_)*sizeof(tRGBColor)]; \
00190                                              packet->numColors = numColors_;
00191 
00192 #define DupColorPacket(dest, source) dest = NULL; \
00193                                      if(source) { \
00194                                          dest = (pColorPacket)new char[sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)]; \
00195                                          memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)); \
00196                                      }
00197 
00198 #define CopyColorPacket( source, dest)  memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor) );
00199 
00200 
00201 #define ZeroColorPacket( packet ) memset( &((packet)->zone[0]), 0, (packet->numColors)*sizeof(tRGBColor));
00202 
00203 // --- tRGBColorLongInt -------------------------------------------------------
00204 typedef struct
00205 {
00206   long int r, g, b;
00207 } tRGBColorLongInt;
00208 
00209 // --- tColorPacketLongInt ----------------------------------------------------
00210 typedef struct
00211 {
00212   int numColors;
00213   tRGBColorLongInt longZone[1];
00214 } xColorPacketLongInt;
00215 typedef xColorPacketLongInt* pColorPacketLongInt;
00216 #define AllocLongColorPacket(packet, numColors_) packet = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (numColors_)*sizeof(tRGBColorLongInt)]; \
00217                                              packet->numColors = numColors_;
00218 
00219 #define DupLongColorPacket(dest, source) dest = NULL; \
00220                                      if(source) { \
00221                                          dest = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)]; \
00222                                          memcpy(dest, source, sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)); \
00223                                      }
00224 #define ZeroLongColorPacket( packet ) memset( &((packet)->longZone[0]), 0, (packet->numColors)*sizeof(tRGBColorLongInt));
00225 
00226 
00227 // --- tWeightPacket ----------------------------------------------------------
00228 /*
00229 typedef struct
00230 {
00231   int channel[CAP_MAX_NUM_ZONES];
00232 } tWeightPacket;
00233 */
00234 
00235 // --- tHSVColor --------------------------------------------------------------
00236 typedef struct
00237 {
00238   unsigned char h, s, v;
00239 } tHSVColor;
00240 
00241 #endif

Generated on Tue May 25 08:04:59 2010 for VLC by  doxygen 1.5.6