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