MythTV  master
bumpscope.h
Go to the documentation of this file.
1 #ifndef BUMPSCOPE
2 #define BUMPSCOPE
3 
4 #include "mainvisual.h"
5 #include "config.h"
6 
7 #include <vector>
8 
9 #define MAX_PHONGRES 1024
10 
11 class BumpScope : public VisualBase
12 {
13 public:
14  BumpScope();
15  ~BumpScope() override;
16 
17  void resize(const QSize &size) override; // VisualBase
18  bool process(VisualNode *node) override; // VisualBase
19  bool draw(QPainter *p, const QColor &back) override; // VisualBase
20  void handleKeyPress(const QString &action) override // VisualBase
21  {(void) action;}
22 
23 private:
24  static void blur_8(unsigned char *ptr, int w, int h, int bpl);
25 
26  void generate_cmap(unsigned int color);
27  void generate_phongdat(void);
28 
29  void translate(int x, int y, int *xo, int *yo, int *xd, int *yd,
30  int *angle) const;
31 
32  inline void draw_vert_line(unsigned char *buffer, int x, int y1, int y2) const;
33  void render_light(int lx, int ly);
34 
35  static void rgb_to_hsv(unsigned int color, double *h, double *s, double *v);
36  static void hsv_to_rgb(double h, double s, double v, unsigned int *color);
37 
38  QImage *m_image {nullptr};
39 
40  QSize m_size {0,0};
41 
42  unsigned int m_color {0x2050FF};
43  unsigned int m_x {0};
44  unsigned int m_y {0};
45  unsigned int m_width {800};
46  unsigned int m_height {600};
47  unsigned int m_phongRad {800};
48 
49  bool m_colorCycle {true};
50  bool m_movingLight {true};
51  //bool m_diamond {true};
52 
53  int m_bpl {0};
54 
55  std::vector<std::vector<unsigned char> > m_phongDat {};
56  unsigned char *m_rgbBuf {nullptr};
57  std::array<double,256> m_intense1 {};
58  std::array<double,256> m_intense2 {};
59 
60  int m_iangle {0};
61  int m_ixo {0};
62  int m_iyo {0};
63  int m_ixd {0};
64  int m_iyd {0};
65  int m_ilx {0};
66  int m_ily {0};
67  int m_wasMoving {0};
68  int m_wasColor {0};
69  double m_ih {0.0};
70  double m_is {0.0};
71  double m_iv {0.0};
72  double m_isd {0.0};
73  int m_ihd {0};
74  unsigned int m_icolor {0};
75 };
76 
77 
78 #endif
BumpScope::~BumpScope
~BumpScope() override
Definition: bumpscope.cpp:32
BumpScope::m_y
unsigned int m_y
Definition: bumpscope.h:44
BumpScope::m_wasMoving
int m_wasMoving
Definition: bumpscope.h:67
BumpScope::m_image
QImage * m_image
Definition: bumpscope.h:38
BumpScope::generate_phongdat
void generate_phongdat(void)
Definition: bumpscope.cpp:120
back
static guint32 * back
Definition: goom_core.cpp:30
VisualNode
Definition: videovisual.h:24
BumpScope::m_phongDat
std::vector< std::vector< unsigned char > > m_phongDat
Definition: bumpscope.h:55
BumpScope::m_isd
double m_isd
Definition: bumpscope.h:72
BumpScope::m_ilx
int m_ilx
Definition: bumpscope.h:65
BumpScope::m_is
double m_is
Definition: bumpscope.h:70
BumpScope::m_movingLight
bool m_movingLight
Definition: bumpscope.h:50
VisualBase
Definition: visualize.h:72
BumpScope::m_iyd
int m_iyd
Definition: bumpscope.h:64
BumpScope::BumpScope
BumpScope()
Definition: bumpscope.cpp:19
BumpScope::m_height
unsigned int m_height
Definition: bumpscope.h:46
BumpScope::process
bool process(VisualNode *node) override
Definition: bumpscope.cpp:344
BumpScope::m_ih
double m_ih
Definition: bumpscope.h:69
BumpScope::rgb_to_hsv
static void rgb_to_hsv(unsigned int color, double *h, double *s, double *v)
Definition: bumpscope.cpp:272
hardwareprofile.config.p
p
Definition: config.py:33
BumpScope::translate
void translate(int x, int y, int *xo, int *yo, int *xd, int *yd, int *angle) const
Definition: bumpscope.cpp:164
BumpScope::m_width
unsigned int m_width
Definition: bumpscope.h:45
BumpScope::draw
bool draw(QPainter *p, const QColor &back) override
Definition: bumpscope.cpp:380
BumpScope::m_ixo
int m_ixo
Definition: bumpscope.h:61
BumpScope::m_wasColor
int m_wasColor
Definition: bumpscope.h:68
BumpScope::blur_8
static void blur_8(unsigned char *ptr, int w, int h, int bpl)
Definition: bumpscope.cpp:74
BumpScope::m_iangle
int m_iangle
Definition: bumpscope.h:60
BumpScope::m_size
QSize m_size
Definition: bumpscope.h:40
BumpScope::m_colorCycle
bool m_colorCycle
Definition: bumpscope.h:49
BumpScope::m_iv
double m_iv
Definition: bumpscope.h:71
BumpScope::m_phongRad
unsigned int m_phongRad
Definition: bumpscope.h:47
BumpScope::m_x
unsigned int m_x
Definition: bumpscope.h:43
BumpScope::m_color
unsigned int m_color
Definition: bumpscope.h:42
BumpScope::hsv_to_rgb
static void hsv_to_rgb(double h, double s, double v, unsigned int *color)
Definition: bumpscope.cpp:306
mainvisual.h
BumpScope::m_ily
int m_ily
Definition: bumpscope.h:66
build_compdb.action
action
Definition: build_compdb.py:9
BumpScope
Definition: bumpscope.h:11
BumpScope::m_iyo
int m_iyo
Definition: bumpscope.h:62
BumpScope::draw_vert_line
void draw_vert_line(unsigned char *buffer, int x, int y1, int y2) const
Definition: bumpscope.cpp:214
BumpScope::m_rgbBuf
unsigned char * m_rgbBuf
Definition: bumpscope.h:56
BumpScope::m_bpl
int m_bpl
Definition: bumpscope.h:53
BumpScope::m_icolor
unsigned int m_icolor
Definition: bumpscope.h:74
BumpScope::m_intense2
std::array< double, 256 > m_intense2
Definition: bumpscope.h:58
BumpScope::handleKeyPress
void handleKeyPress(const QString &action) override
Definition: bumpscope.h:20
BumpScope::m_intense1
std::array< double, 256 > m_intense1
Definition: bumpscope.h:57
BumpScope::m_ixd
int m_ixd
Definition: bumpscope.h:63
BumpScope::render_light
void render_light(int lx, int ly)
Definition: bumpscope.cpp:239
BumpScope::generate_cmap
void generate_cmap(unsigned int color)
Definition: bumpscope.cpp:90
BumpScope::m_ihd
int m_ihd
Definition: bumpscope.h:73
BumpScope::resize
void resize(const QSize &size) override
Definition: bumpscope.cpp:41