MythTV  master
synaesthesia.h
Go to the documentation of this file.
1 #ifndef SYNAETHESIA
2 #define SYNAETHESIA
3 
4 #include <visual.h>
5 #include "polygon.h"
6 #include "mainvisual.h"
7 #include "config.h"
8 
9 class QImage;
10 
11 #define LogSize 10
12 #define Brightness 150
13 #define NumSamples (1<<LogSize)
14 
15 #define Flame 0
16 #define Wave 1
17 #define Stars 2
18 
19 class Synaesthesia : public VisualBase
20 {
21 public:
22  Synaesthesia(void);
23  virtual ~Synaesthesia();
24 
25  void resize(const QSize &size) override; // VisualBase
26  bool process(VisualNode *node) override; // VisualBase
27  bool draw(QPainter *p, const QColor &back) override; // VisualBase
28  void handleKeyPress(const QString &action) override // VisualBase
29  {(void) action;}
30 
31 private:
32  void setupPalette(void);
33  void coreInit(void);
34  int bitReverser(int i);
35  void fft(double *x, double *y);
36  void setStarSize(double lsize);
37 
38  inline void addPixel(int x, int y, int br1, int br2);
39  inline void addPixelFast(unsigned char *p, int br1, int br2);
40  inline unsigned char getPixel(int x, int y, int where);
41 
42  inline void fadePixelWave(int x, int y, int where, int step);
43  void fadeWave(void);
44  inline void fadePixelHeat(int x, int y, int where, int step);
45  void fadeHeat(void);
46  void fadeFade(void);
47  void fade(void);
48 
49  QSize m_size {0,0};
50 
54  int m_scaleDown[256];
55  int m_maxStarRadius {1};
57  bool m_pointsAreDiamonds {true};
58  double m_brightnessTwiddler {0.3};
59  double m_starSize {0.5};
60 
61  int m_outWidth {0};
62  int m_outHeight {0};
63 
65  QImage *m_outputImage {nullptr};
66 
67  unsigned char m_palette[768];
68  double m_fgRedSlider {0.0};
69  double m_fgGreenSlider {0.5};
70  double m_bgRedSlider {0.75};
71  double m_bgGreenSlider {0.4};
72 
73  double m_energy_avg {80.0};
74 };
75 
76 #endif // SYNAETHESIA
double m_brightnessTwiddler
Definition: synaesthesia.h:58
Bitmap< unsigned short > m_outputBmp
Definition: synaesthesia.h:64
void setupPalette(void)
void fadePixelWave(int x, int y, int where, int step)
unsigned char m_palette[768]
Definition: synaesthesia.h:67
void fade(void)
double m_negSinTable[NumSamples]
Definition: synaesthesia.h:52
Bitmap< unsigned short > m_lastOutputBmp
Definition: synaesthesia.h:64
#define NumSamples
Definition: synaesthesia.h:13
bool draw(QPainter *p, const QColor &back) override
bool m_pointsAreDiamonds
Definition: synaesthesia.h:57
double m_energy_avg
Definition: synaesthesia.h:73
unsigned char getPixel(int x, int y, int where)
void addPixelFast(unsigned char *p, int br1, int br2)
double m_fgGreenSlider
Definition: synaesthesia.h:69
Bitmap< unsigned short > m_lastLastOutputBmp
Definition: synaesthesia.h:64
double m_bgRedSlider
Definition: synaesthesia.h:70
#define Stars
Definition: synaesthesia.h:17
int bitReverser(int i)
void fadeWave(void)
void coreInit(void)
double m_fgRedSlider
Definition: synaesthesia.h:68
void setStarSize(double lsize)
void handleKeyPress(const QString &action) override
Definition: synaesthesia.h:28
void addPixel(int x, int y, int br1, int br2)
void resize(const QSize &size) override
int m_scaleDown[256]
Definition: synaesthesia.h:54
void fadeFade(void)
int m_bitReverse[NumSamples]
Definition: synaesthesia.h:53
void fadeHeat(void)
void fadePixelHeat(int x, int y, int where, int step)
void fft(double *x, double *y)
Synaesthesia(void)
double m_starSize
Definition: synaesthesia.h:59
static guint32 * back
Definition: goom_core.c:34
double m_bgGreenSlider
Definition: synaesthesia.h:71
double m_cosTable[NumSamples]
Definition: synaesthesia.h:51
bool process(VisualNode *node) override
virtual ~Synaesthesia()
QImage * m_outputImage
Definition: synaesthesia.h:65
int m_maxStarRadius
Definition: synaesthesia.h:55