]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoCalculations.h
enhanced & corrected AtmoLight filter module
[vlc] / modules / video_filter / atmo / AtmoCalculations.h
1 /*
2  * AtmoCalculations.h: see calculations.h of the linux version... one to one copy
3  * calculations.h: calculations needed by the input devices
4  *
5  * See the README.txt file for copyright information and how to reach the author(s).
6  *
7  * $Id$
8  */
9
10 #ifndef _AtmoCalculations_h_
11 #define _AtmoCalculations_h_
12
13 #include "AtmoDefs.h"
14 #include "AtmoConfig.h"
15
16 #define Weight(zone, pixel_nummer) m_Weight[((zone) * (IMAGE_SIZE)) + (pixel_nummer)]
17
18 class CAtmoColorCalculator
19 {
20 protected:
21    CAtmoConfig *m_pAtmoConfig;
22
23   // Flip instead having a array with (64x48) entries of values for each channel
24   // I have x arrays of 64x48 so each channel has its own array...
25   // (or gradient which is use to judge about the pixels)
26   int *m_Weight;
27   int **m_Zone_Weights;
28
29   long int *m_hue_hist;
30   long int *m_windowed_hue_hist;
31   int *m_most_used_hue_last;
32   int *m_most_used_hue;
33
34   long int *m_sat_hist;
35   long int *m_windowed_sat_hist;
36   int *m_most_used_sat;
37
38   long int *m_average_v;
39   int *m_average_counter;
40
41 protected:
42   int m_LastEdgeWeighting;
43   int m_LastWidescreenMode;
44   int m_LastLayout_TopCount;
45   int m_LastLayout_BottomCount;
46   int m_LastLayout_LRCount;
47   int m_LastNumZones;
48
49
50 protected:
51     void FindMostUsed(int AtmoSetup_NumZones,int *most_used,long int *windowed_hist);
52
53 public:
54     CAtmoColorCalculator(CAtmoConfig *pAtmoConfig);
55         ~CAtmoColorCalculator(void);
56
57     pColorPacket AnalyzeHSV(tHSVColor *HSV_Img);
58
59     void UpdateParameters();
60 };
61
62
63 tHSVColor RGB2HSV(tRGBColor color);
64 tRGBColor HSV2RGB(tHSVColor color);
65
66 #endif