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