MythTV  master
synaesthesia.cpp
Go to the documentation of this file.
1 // Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com>
2 //
3 // Use, modification and distribution is allowed without limitation,
4 // warranty, or liability of any kind.
5 //
6 // modified 12-2004 by Kyle Schlansker to add 64 bit support
7 //
8 
9 // C++
10 #include <cinttypes>
11 #include <cmath>
12 #include <cstdint>
13 #include <cstdlib>
14 #include <iostream>
15 
16 // Qt
17 #include <QCoreApplication>
18 #include <QPainter>
19 #include <QImage>
20 
21 // MythTV
22 #include <libmythbase/compat.h>
24 
25 // MythMusic
26 #include "mainvisual.h"
27 #include "synaesthesia.h"
28 
30 {
31  m_fps = 29;
32 
33  coreInit(); // init cosTable, negSinTable, bitReverse
34  setStarSize(m_starSize); // init scaleDown, maxStarRadius
35  setupPalette(); // init palette
36 }
37 
39 {
40  delete m_outputImage;
41 }
42 
43 //static constexpr uint8_t sBOUND(int x)
44 // { return std::clamp(x, 0, 255); };
45 //static constexpr uint8_t sPEAKIFY(int x)
46 // {return sBOUND(x - x*(255-x)/255/2); };
47 
49 {
50  double fgRed = m_fgRedSlider;
51  double fgGreen = m_fgGreenSlider;
52  double fgBlue = 1.0 - std::max(m_fgRedSlider,m_fgGreenSlider);
53  //double scale = std::max({fgRed,fgGreen,fgBlue});
54  double scale = (fgRed + fgGreen + fgBlue) / 2.0;
55  fgRed /= scale;
56  fgGreen /= scale;
57  fgBlue /= scale;
58 
59  double bgRed = m_bgRedSlider;
60  double bgGreen = m_bgGreenSlider;
61  double bgBlue = 1.0 - std::max(m_bgRedSlider,m_bgGreenSlider);
62  //scale = std::max({bgRed,bgGreen,bgBlue});
63  scale = (bgRed + bgGreen + bgBlue) / 2.0;
64  bgRed /= scale;
65  bgGreen /= scale;
66  bgBlue /= scale;
67 
68  for (int i = 0; i < 256; i++) {
69  int f = i & 15;
70  int b = i / 16;
71  //m_palette[i * 3 + 0] = sPEAKIFY(b*bgRed*16+f*fgRed*16);
72  //m_palette[i * 3 + 1] = sPEAKIFY(b*bgGreen*16+f*fgGreen*16);
73  //m_palette[i * 3 + 2] = sPEAKIFY(b*bgBlue*16+f*fgBlue*16);
74 
75  double red = b * bgRed * 16 + f * fgRed * 16;
76  double green = b * bgGreen * 16 + f * fgGreen * 16;
77  double blue = b * bgBlue * 16 + f * fgBlue * 16;
78 
79  double excess = 0.0;
80  for (int j = 0; j < 5; j++)
81  {
82  red += excess / 3;
83  green += excess / 3;
84  blue += excess / 3;
85  excess = 0.0;
86 
87 
88  if (red > 255) { excess += red - 255; red = 255; }
89  if (green > 255) { excess += green - 255; green = 255; }
90  if (blue > 255) { excess += blue - 255; blue = 255; }
91  }
92 
93  double scale2 = (0.5 + (red + green + blue) / 768.0) / 1.5;
94  red *= scale2;
95  green *= scale2;
96  blue *= scale2;
97 
98  m_palette[i * 3 + 0] = std::clamp(int(red), 0, 255);
99  m_palette[i * 3 + 1] = std::clamp(int(green), 0, 255);
100  m_palette[i * 3 + 2] = std::clamp(int(blue), 0, 255);
101  }
102 }
103 
104 void Synaesthesia::resize(const QSize &newsize)
105 {
106  m_size = newsize;
107 
108  m_size.setHeight(m_size.height() / 2);
109  m_size.setWidth((m_size.width() / 4) * 4);
110  m_outputBmp.size(m_size.width(), m_size.height());
111  m_lastOutputBmp.size(m_size.width(), m_size.height());
112  m_lastLastOutputBmp.size(m_size.width(), m_size.height());
113  m_outWidth = m_size.width();
114  m_outHeight = m_size.height();
115 
116  delete m_outputImage;
117 
118  m_size.setHeight(m_size.height() * 2);
119  m_outputImage = new QImage(m_size, QImage::Format_Indexed8);
120 
121  if (!m_outputImage)
122  {
123  LOG(VB_GENERAL, LOG_ERR,
124  "outputImage in Synaesthesia::resize() is NULL");
125  return;
126  }
127 
128  for (size_t i = 0; i < 256; i++)
129  m_outputImage->setColor(i, qRgba(m_palette[i * 3], m_palette[i * 3 + 1],
130  m_palette[i * 3 + 2], 255));
131 
132 #if 0
133  surface = SDL_SetVideoMode(size.width(), size.height(), 8, 0);
134 
135  if (!surface)
136  {
137  LOG(VB_GENERAL, LOG_ERR, "Couldn't get SDL surface");
138  return;
139  }
140 
141  SDL_Color sdlPalette[256];
142 
143  for (int i = 0; i < 256; i++)
144  {
145  sdlPalette[i].r = m_palette[i * 3];
146  sdlPalette[i].g = m_palette[i * 3 + 1];
147  sdlPalette[i].b = m_palette[i * 3 + 2];
148  }
149 
150  SDL_SetColors(surface, sdlPalette, 0, 256);
151 #endif
152 }
153 
155 {
156  int sum = 0;
157  for (size_t j = 0; j < LogSize; j++)
158  {
159  sum = (i & 1) + sum * 2;
160  i >>= 1;
161  }
162 
163  return sum;
164 }
165 
166 void Synaesthesia::fft(double *x, double *y)
167 {
168  size_t n2 = NumSamples;
169  for (size_t twoToTheK = 1; twoToTheK < NumSamples; twoToTheK *= 2)
170  {
171  size_t n1 = n2;
172  n2 /= 2;
173  for (size_t j = 0; j < n2; j++)
174  {
175  double c = m_cosTable[j * twoToTheK & (NumSamples - 1)];
176  double s = m_negSinTable[j * twoToTheK & (NumSamples - 1)];
177  for (size_t i = j; i < NumSamples; i += n1)
178  {
179  size_t l = i + n2;
180  double xt = x[i] - x[l];
181  x[i] = (x[i] + x[l]);
182  double yt = y[i] - y[l];
183  y[i] = (y[i] + y[l]);
184  x[l] = xt * c - yt * s;
185  y[l] = xt * s + yt * c;
186  }
187  }
188  }
189 }
190 
191 void Synaesthesia::setStarSize(double lsize)
192 {
193  double fadeModeFudge = (m_fadeMode == Wave ? 0.4 :
194  (m_fadeMode == Flame ? 0.6 : 0.78));
195 
196  int factor = 0;
197  if (lsize > 0.0)
198  factor = int(exp(log(fadeModeFudge) / (lsize * 8.0)) * 255);
199  if (factor > 255)
200  factor = 255;
201 
202  for (int i = 0; i < 256; i++)
203  m_scaleDown[i] = i * factor>>8;
204 
205  m_maxStarRadius = 1;
206  for (int i = 255; i; i = m_scaleDown[i])
207  m_maxStarRadius++;
208 }
209 
211 {
212  for (size_t i = 0; i < NumSamples; i++)
213  {
214  m_negSinTable[i] = -sin(3.141592 * 2.0 / NumSamples * i);
215  m_cosTable[i] = cos(3.141592 * 2.0 / NumSamples * i);
216  m_bitReverse[i] = bitReverser(i);
217  }
218 }
219 
220 #define output ((unsigned char*)m_outputBmp.data)
221 #define lastOutput ((unsigned char*)m_lastOutputBmp.data)
222 #define lastLastOutput ((unsigned char*)m_lastLastOutputBmp.data)
223 
224 void Synaesthesia::addPixel(int x, int y, int br1, int br2) const
225 {
226  if (x < 0 || x > m_outWidth || y < 0 || y >= m_outHeight)
227  return;
228 
229  unsigned char *p = output + static_cast<ptrdiff_t>(x) * 2 +
230  static_cast<ptrdiff_t>(y) * m_outWidth * 2;
231  if (p[0] + br1 < 255)
232  p[0] += br1;
233  else
234  p[0] = 255;
235  if (p[1] + br2 < 255)
236  p[1] += br2;
237  else
238  p[1] = 255;
239 }
240 
241 void Synaesthesia::addPixelFast(unsigned char *p, int br1, int br2)
242 {
243  if (p[0] + br1 < 255)
244  p[0] += br1;
245  else
246  p[0] = 255;
247  if (p[1] + br2 < 255)
248  p[1] += br2;
249  else
250  p[1] = 255;
251 }
252 
253 unsigned char Synaesthesia::getPixel(int x, int y, int where) const
254 {
255  if (x < 0 || y < 0 || x >= m_outWidth || y >= m_outHeight)
256  return 0;
257 
258  return lastOutput[where];
259 }
260 
261 void Synaesthesia::fadeFade(void) const
262 {
263  auto *ptr = (uint32_t *)output;
264  int i = static_cast<ptrdiff_t>(m_outWidth) * m_outHeight * 2 / sizeof(uint32_t);
265  do {
266  uint32_t x = *ptr;
267  if (x)
268  {
269  *(ptr++) = x - ((x & (uintptr_t)0xf0f0f0f0) >> 4) -
270  ((x & (uintptr_t)0xe0e0e0e0) >> 5);
271  }
272  else
273  {
274  ptr++;
275  }
276  } while (--i > 0);
277 }
278 
279 void Synaesthesia::fadePixelWave(int x, int y, int where, int step)
280 {
281  short j = short((int(getPixel(x - 1, y, where - 2)) +
282  int(getPixel(x + 1, y, where + 2)) +
283  int(getPixel(x, y - 1, where - step)) +
284  int(getPixel(x, y + 1, where + step))) >> 2) +
285  lastOutput[where];
286 
287  if (!j)
288  {
289  output[where] = 0;
290  return;
291  }
292  j = j - lastLastOutput[where] - 1;
293  if (j < 0)
294  output[where] = 0;
295  else if (j & (255 * 256))
296  output[where] = 255;
297  else
298  output[where] = j;
299 }
300 
302 {
303  unsigned short *t = m_lastLastOutputBmp.data;
306  m_outputBmp.data = t;
307 
308  int step = m_outWidth*2;
309  for (int x = 0, i = 0, j = m_outWidth * (m_outHeight - 1) * 2;
310  x < m_outWidth; x++, i += 2, j += 2)
311  {
312  fadePixelWave(x, 0, i, step);
313  fadePixelWave(x, 0, i + 1, step);
314  fadePixelWave(x, m_outHeight - 1, j, step);
315  fadePixelWave(x, m_outHeight - 1, j + 1, step);
316  }
317 
318  for (int y = 1, i = m_outWidth * 2, j = m_outWidth * 4 - 2;
319  y < m_outHeight; y++, i += step, j += step)
320  {
321  fadePixelWave(0, y, i, step);
322  fadePixelWave(0, y, i + 1, step);
323  fadePixelWave(m_outWidth - 1, y, j, step);
324  fadePixelWave(m_outWidth - 1, y, j + 1, step);
325  }
326 
327  for (int y = 1, start = m_outWidth * 2 + 2, end = m_outWidth * 4 - 2;
328  y < m_outHeight - 1; y++, start += step, end += step)
329  {
330  int i2 = start;
331  do
332  {
333  short j2 = short((int(lastOutput[i2 - 2]) +
334  int(lastOutput[i2 + 2]) +
335  int(lastOutput[i2 - step]) +
336  int(lastOutput[i2 + step])) >> 2) +
337  lastOutput[i2];
338  if (!j2)
339  {
340  output[i2] = 0;
341  }
342  else
343  {
344  j2 = j2 - lastLastOutput[i2] - 1;
345  if (j2 < 0)
346  output[i2] = 0;
347  else if (j2 & (255*256))
348  output[i2] = 255;
349  else
350  output[i2] = j2;
351  }
352  } while(++i2 < end);
353  }
354 }
355 
356 void Synaesthesia::fadePixelHeat(int x, int y, int where, int step)
357 {
358  short j = short((int(getPixel(x - 1, y, where - 2)) +
359  int(getPixel(x + 1, y, where + 2)) +
360  int(getPixel(x, y - 1, where - step)) +
361  int(getPixel(x, y + 1, where + step))) >> 2) +
362  lastOutput[where];
363  if (!j)
364  {
365  output[where] = 0;
366  return;
367  }
368  j = j -lastLastOutput[where] - 1;
369  if (j < 0)
370  output[where] = 0;
371  else if (j & (255 * 256))
372  output[where] = 255;
373  else
374  output[where] = j;
375 }
376 
378 {
379  unsigned short *t = m_lastLastOutputBmp.data;
382  m_outputBmp.data = t;
383 
384  int step = m_outWidth * 2;
385  for (int x = 0, i = 0, j = m_outWidth * (m_outHeight - 1) * 2;
386  x < m_outWidth; x++, i += 2, j += 2)
387  {
388  fadePixelHeat(x, 0, i, step);
389  fadePixelHeat(x, 0, i + 1, step);
390  fadePixelHeat(x, m_outHeight - 1, j, step);
391  fadePixelHeat(x, m_outHeight - 1, j + 1, step);
392  }
393 
394  for(int y = 1, i = m_outWidth * 2, j = m_outWidth * 4 - 2; y < m_outHeight;
395  y++, i += step, j += step)
396  {
397  fadePixelHeat(0, y, i, step);
398  fadePixelHeat(0, y, i + 1, step);
399  fadePixelHeat(m_outWidth - 1, y, j, step);
400  fadePixelHeat(m_outWidth - 1, y, j + 1, step);
401  }
402 
403  for(int y = 1, start = m_outWidth * 2 + 2, end = m_outWidth * 4 - 2;
404  y < m_outHeight - 1; y++, start += step, end += step)
405  {
406  int i2 = start;
407  do
408  {
409  short j2 = short((int(lastOutput[i2 - 2]) +
410  int(lastOutput[i2 + 2]) +
411  int(lastOutput[i2 - step]) +
412  int(lastOutput[i2 + step])) >> 2) +
413  lastOutput[i2];
414  if (!j2)
415  output[i2] = 0;
416  else
417  {
418  j2 = j2 - lastLastOutput[i2] +
419  ((lastLastOutput[i2] - lastOutput[i2]) >> 2) - 1;
420  if (j2 < 0)
421  output[i2] = 0;
422  else if (j2 & (255*256))
423  output[i2] = 255;
424  else
425  output[i2] = j2;
426  }
427  } while(++i2 < end);
428  }
429 }
430 
432 {
433  switch(m_fadeMode)
434  {
435  case Stars: fadeFade(); break;
436  case Flame: fadeHeat(); break;
437  case Wave: fadeWave(); break;
438  default: break;
439  }
440 }
441 
443 {
444  fade();
445 
446  if (!node)
447  return false;
448 
449  samp_dbl_array x {};
450  samp_dbl_array y {};
451  samp_dbl_array a {};
452  samp_dbl_array b {};
453  samp_int_array clarity {};
454 
455  int brightFactor = int(Brightness * m_brightnessTwiddler / (m_starSize + 0.01));
456 
457  size_t numSamps = NumSamples;
458  if (node->m_length < NumSamples)
459  numSamps = node->m_length;
460 
461  for (size_t i = 0; i < numSamps; i++)
462  {
463  x[i] = node->m_left[i];
464  if (node->m_right)
465  y[i] = node->m_right[i];
466  else
467  y[i] = x[i];
468  }
469 
470  fft(x.data(), y.data());
471 
472  double energy = 0.0;
473 
474  for (size_t i = 0 + 1; i < NumSamples / 2; i++)
475  {
476  double x1 = x[m_bitReverse[i]];
477  double y1 = y[m_bitReverse[i]];
478  double x2 = x[m_bitReverse[NumSamples - i]];
479  double y2 = y[m_bitReverse[NumSamples - i]];
480  double aa = NAN;
481  double bb = NAN;
482  a[i] = sqrt(aa = (x1 + x2) * (x1 + x2) + (y1 - y2) * (y1 - y2));
483  b[i] = sqrt(bb = (x1 - x2) * (x1 - x2) + (y2 + y2) * (y1 + y2));
484  if (aa + bb != 0.0)
485  {
486  clarity[i] = (int)(((x1 + x2) * (x1 - x2) + (y1 + y2) * (y1 - y2)) /
487  (aa + bb) * 256);
488  }
489  else
490  {
491  clarity[i] = 0;
492  }
493 
494  energy += (aa + bb) * i * i;
495  }
496 
497  energy = sqrt(energy / NumSamples) / 65536.0;
498 
499  //int heightFactor = NumSamples / 2 / outHeight + 1;
500  //int actualHeight = NumSamples / 2 / heightFactor;
501  //int heightAdd = (outHeight + actualHeight) >> 1;
502 
503  double brightFactor2 = (brightFactor / 65536.0 / NumSamples) *
504  sqrt(m_outHeight * m_outWidth / (320.0 * 200.0));
505 
506  m_energyAvg = m_energyAvg * 0.95 + energy * 0.05;
507  if (m_energyAvg > 0.0)
508  brightFactor2 *= 80.0 / (m_energyAvg + 5.0);
509 
510  for (size_t i = 1; i < NumSamples / 2; i++)
511  {
512  if (a[i] > 0 || b[i] > 0)
513  {
514  int h = (int)(b[i] * m_outWidth / (a[i] + b[i]));
515  int br = (int)((a[i] + b[i]) * i * brightFactor2);
516  int br1 = br * (clarity[i] + 128) >> 8;
517  int br2 = br * (128 - clarity[i]) >> 8;
518  if (br1 < 0) br1 = 0; else if (br1 > 255) br1 = 255;
519  if (br2 < 0) br2 = 0; else if (br2 > 255) br2 = 255;
520 
521  int px = h;
522  int py = m_outHeight - i * m_outHeight / (NumSamples / 2);
523 
525  {
526  addPixel(px, py, br1, br2);
527  br1 = m_scaleDown[br1];
528  br2 = m_scaleDown[br2];
529 
530  for(int j = 1; br1 > 0 || br2 > 0;
531  j++, br1 = m_scaleDown[br1], br2 = m_scaleDown[br2])
532  {
533  for (int k = 0; k < j; k++)
534  {
535  addPixel(px - j + k,py - k, br1, br2);
536  addPixel(px + k, py - j + k, br1, br2);
537  addPixel(px + j - k, py + k, br1, br2);
538  addPixel(px - k, py + j - k, br1, br2);
539  }
540  }
541  }
542  else
543  {
544  if (px < m_maxStarRadius || py < m_maxStarRadius ||
545  px > m_outWidth - m_maxStarRadius ||
547  {
548  addPixel(px, py, br1, br2);
549  for(int j = 1; br1 > 0 || br2 > 0;
550  j++, br1 = m_scaleDown[br1], br2 = m_scaleDown[br2])
551  {
552  addPixel(px + j, py, br1, br2);
553  addPixel(px, py + j, br1, br2);
554  addPixel(px - j, py, br1, br2);
555  addPixel(px, py - j, br1, br2);
556  }
557  }
558  else
559  {
560  unsigned char *p = output + static_cast<ptrdiff_t>(px) * 2 +
561  static_cast<ptrdiff_t>(py) * m_outWidth * 2;
562  unsigned char *p1 = p;
563  unsigned char *p2 = p;
564  unsigned char *p3 = p;
565  unsigned char *p4 = p;
566  addPixelFast(p, br1, br2);
567  for (; br1 > 0 || br2 > 0;
568  br1 = m_scaleDown[br1], br2 = m_scaleDown[br2])
569  {
570  p1 += 2;
571  addPixelFast(p1, br1, br2);
572  p2 -= 2;
573  addPixelFast(p2, br1, br2);
574  p3 += static_cast<ptrdiff_t>(m_outWidth) * 2;
575  addPixelFast(p3, br1, br2);
576  p4 -= static_cast<ptrdiff_t>(m_outWidth) * 2;
577  addPixelFast(p4, br1, br2);
578  }
579  }
580  }
581  }
582  }
583 
584  return false;
585 }
586 
587 bool Synaesthesia::draw(QPainter *p, [[maybe_unused]] const QColor &back)
588 {
589  if (!m_outputImage)
590  return true;
591 
592  auto *ptrOutput = (uint32_t *)output;
593 
594  for (int j = 0; j < m_outHeight * 2; j += 2)
595  {
596  auto *ptrTop = (uint32_t *)(m_outputImage->scanLine(j));
597  auto *ptrBot = (uint32_t *)(m_outputImage->scanLine(j+1));
598 
599  int i = m_outWidth / 4;
600 
601  do
602  {
603  unsigned int const r1 = *(ptrOutput++);
604  unsigned int const r2 = *(ptrOutput++);
605 
606  unsigned int const v = ((r1 & 0x000000f0UL) >> 4) |
607  ((r1 & 0x0000f000UL) >> 8) |
608  ((r1 & 0x00f00000UL) >> 12) |
609  ((r1 & 0xf0000000UL) >> 16);
610 
611  *(ptrTop++) = v | (((r2 & 0x000000f0UL) << 12) |
612  ((r2 & 0x0000f000UL) << 8) |
613  ((r2 & 0x00f00000UL) << 4) |
614  ((r2 & 0xf0000000UL)));
615 
616  *(ptrBot++) = v | (((r2 & 0x000000f0UL) << 12) |
617  ((r2 & 0x0000f000UL) << 8) |
618  ((r2 & 0x00f00000UL) << 4) |
619  ((r2 & 0xf0000000UL)));
620  } while (--i > 0);
621  }
622 
623  p->drawImage(0, 0, *m_outputImage);
624 
625  return true;
626 }
627 
628 static class SynaesthesiaFactory : public VisFactory
629 {
630  public:
631  const QString &name(void) const override // VisFactory
632  {
633  static QString s_name = QCoreApplication::translate("Visualizers",
634  "Synaesthesia");
635  return s_name;
636  }
637 
638  uint plugins(QStringList *list) const override // VisFactory
639  {
640  *list << name();
641  return 1;
642  }
643 
644  VisualBase *create([[maybe_unused]] MainVisual *parent,
645  [[maybe_unused]] const QString &pluginName) const override // VisFactory
646  {
647  return new Synaesthesia();
648  }
Flame
@ Flame
Definition: synaesthesia.h:24
Synaesthesia::m_fgRedSlider
double m_fgRedSlider
Definition: synaesthesia.h:79
samp_dbl_array
std::array< double, NumSamples > samp_dbl_array
Definition: synaesthesia.h:20
Synaesthesia::m_outWidth
int m_outWidth
Definition: synaesthesia.h:70
Wave
@ Wave
Definition: synaesthesia.h:25
Synaesthesia::bitReverser
static int bitReverser(int i)
Definition: synaesthesia.cpp:154
Brightness
Definition: channelsettings.cpp:524
Synaesthesia::coreInit
void coreInit(void)
Definition: synaesthesia.cpp:210
Synaesthesia::m_lastOutputBmp
Bitmap< unsigned short > m_lastOutputBmp
Definition: synaesthesia.h:74
back
static guint32 * back
Definition: goom_core.cpp:25
VisualNode
Definition: videovisual.h:25
Bitmap::size
void size(int w, int h)
Definition: polygon.h:18
Synaesthesia::setStarSize
void setStarSize(double lsize)
Definition: synaesthesia.cpp:191
lastLastOutput
#define lastLastOutput
Definition: synaesthesia.cpp:222
x2
static int x2
Definition: mythsocket.cpp:51
NumSamples
static constexpr size_t NumSamples
Definition: synaesthesia.h:17
SynaesthesiaFactory
SynaesthesiaFactory SynaesthesiaFactory
Synaesthesia::resize
void resize(const QSize &size) override
Definition: synaesthesia.cpp:104
Synaesthesia::draw
bool draw(QPainter *p, const QColor &back) override
Definition: synaesthesia.cpp:587
VisualBase
Definition: visualize.h:62
Synaesthesia::Synaesthesia
Synaesthesia(void)
Definition: synaesthesia.cpp:29
Synaesthesia::m_starSize
double m_starSize
Definition: synaesthesia.h:68
Synaesthesia::m_pointsAreDiamonds
bool m_pointsAreDiamonds
Definition: synaesthesia.h:66
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
synaesthesia.h
Bitmap::data
Pixel * data
Definition: polygon.h:13
Synaesthesia
Definition: synaesthesia.h:29
Synaesthesia::m_bgGreenSlider
double m_bgGreenSlider
Definition: synaesthesia.h:82
VisualNode::m_left
short * m_left
Definition: videovisual.h:37
Synaesthesia::fadeFade
void fadeFade(void) const
Definition: synaesthesia.cpp:261
Synaesthesia::~Synaesthesia
~Synaesthesia() override
Definition: synaesthesia.cpp:38
Synaesthesia::m_outHeight
int m_outHeight
Definition: synaesthesia.h:71
Synaesthesia::m_bgRedSlider
double m_bgRedSlider
Definition: synaesthesia.h:81
Synaesthesia::addPixelFast
static void addPixelFast(unsigned char *p, int br1, int br2)
Definition: synaesthesia.cpp:241
Synaesthesia::fade
void fade(void)
Definition: synaesthesia.cpp:431
mythlogging.h
Synaesthesia::m_palette
std::array< uint8_t, 768 > m_palette
Definition: synaesthesia.h:78
hardwareprofile.config.p
p
Definition: config.py:33
VisualNode::m_right
short * m_right
Definition: videovisual.h:38
hardwareprofile.i18n.t
t
Definition: i18n.py:36
compat.h
Synaesthesia::m_outputImage
QImage * m_outputImage
Definition: synaesthesia.h:76
p2
static guint32 * p2
Definition: goom_core.cpp:26
x1
static int x1
Definition: mythsocket.cpp:50
samp_int_array
std::array< int, NumSamples > samp_int_array
Definition: synaesthesia.h:21
VisFactory
Definition: visualize.h:92
Synaesthesia::m_maxStarRadius
int m_maxStarRadius
Definition: synaesthesia.h:64
Synaesthesia::m_outputBmp
Bitmap< unsigned short > m_outputBmp
Definition: synaesthesia.h:73
Synaesthesia::m_size
QSize m_size
Definition: synaesthesia.h:58
Synaesthesia::m_negSinTable
samp_dbl_array m_negSinTable
Definition: synaesthesia.h:61
Synaesthesia::m_cosTable
samp_dbl_array m_cosTable
Definition: synaesthesia.h:60
Synaesthesia::setupPalette
void setupPalette(void)
Definition: synaesthesia.cpp:48
uint
unsigned int uint
Definition: compat.h:81
Synaesthesia::getPixel
unsigned char getPixel(int x, int y, int where) const
Definition: synaesthesia.cpp:253
p1
static guint32 * p1
Definition: goom_core.cpp:26
Stars
@ Stars
Definition: synaesthesia.h:26
MainVisual
Definition: mainvisual.h:34
VisualNode::m_length
long m_length
Definition: videovisual.h:39
VisualBase::m_fps
int m_fps
Definition: visualize.h:88
Synaesthesia::m_bitReverse
samp_int_array m_bitReverse
Definition: synaesthesia.h:62
LogSize
static constexpr size_t LogSize
Definition: synaesthesia.h:16
Synaesthesia::addPixel
void addPixel(int x, int y, int br1, int br2) const
Definition: synaesthesia.cpp:224
common.utilities.log
def log(debug, txt)
Definition: utilities.py:5
Synaesthesia::process
bool process(VisualNode *node) override
Definition: synaesthesia.cpp:442
mainvisual.h
Synaesthesia::m_energyAvg
double m_energyAvg
Definition: synaesthesia.h:84
Synaesthesia::fadeWave
void fadeWave(void)
Definition: synaesthesia.cpp:301
SynaesthesiaFactory::plugins
uint plugins(QStringList *list) const override
Definition: synaesthesia.cpp:638
lastOutput
#define lastOutput
Definition: synaesthesia.cpp:221
Synaesthesia::fadeHeat
void fadeHeat(void)
Definition: synaesthesia.cpp:377
Synaesthesia::m_brightnessTwiddler
double m_brightnessTwiddler
Definition: synaesthesia.h:67
Synaesthesia::m_scaleDown
std::array< int, 256 > m_scaleDown
Definition: synaesthesia.h:63
Synaesthesia::fadePixelHeat
void fadePixelHeat(int x, int y, int where, int step)
Definition: synaesthesia.cpp:356
Synaesthesia::fadePixelWave
void fadePixelWave(int x, int y, int where, int step)
Definition: synaesthesia.cpp:279
output
#define output
Definition: synaesthesia.cpp:220
Synaesthesia::m_fadeMode
int m_fadeMode
Definition: synaesthesia.h:65
SynaesthesiaFactory
Definition: synaesthesia.cpp:628
Synaesthesia::m_fgGreenSlider
double m_fgGreenSlider
Definition: synaesthesia.h:80
Synaesthesia::m_lastLastOutputBmp
Bitmap< unsigned short > m_lastLastOutputBmp
Definition: synaesthesia.h:75
SynaesthesiaFactory::create
VisualBase * create([[maybe_unused]] MainVisual *parent, [[maybe_unused]] const QString &pluginName) const override
Definition: synaesthesia.cpp:644
Synaesthesia::fft
void fft(double *x, double *y)
Definition: synaesthesia.cpp:166
SynaesthesiaFactory::name
const QString & name(void) const override
Definition: synaesthesia.cpp:631