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 #include "config.h"
10 
11 // C++
12 #include <cinttypes>
13 #include <cmath>
14 #include <cstdint>
15 #include <cstdlib>
16 #include <iostream>
17 
18 // Qt
19 #include <QCoreApplication>
20 #include <QPainter>
21 #include <QImage>
22 
23 // MythTV
24 #include <compat.h>
25 #include <mythlogging.h>
26 
27 // MythMusic
28 #include "mainvisual.h"
29 #include "synaesthesia.h"
30 
32 {
33  m_fps = 29;
34 
35  coreInit(); // init cosTable, negSinTable, bitReverse
36  setStarSize(m_starSize); // init scaleDown, maxStarRadius
37  setupPalette(); // init palette
38 }
39 
41 {
42  delete m_outputImage;
43 }
44 
46 {
47 #define sBOUND(x) ((x) > 255 ? 255 : (x))
48 #define sPEAKIFY(x) int(sBOUND((x) - (x)*(255-(x))/255/2))
49 #define sMAX(x,y) ((x) > (y) ? (x) : (y))
50  double fgRed = m_fgRedSlider;
51  double fgGreen = m_fgGreenSlider;
52  double fgBlue = 1.0 - sMAX(m_fgRedSlider,m_fgGreenSlider);
53  //double scale = sMAX(sMAX(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 - sMAX(m_bgRedSlider,m_bgGreenSlider);
62  //scale = sMAX(sMAX(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  //palette[i * 3 + 0] = sPEAKIFY(b*bgRed*16+f*fgRed*16);
72  //palette[i * 3 + 1] = sPEAKIFY(b*bgGreen*16+f*fgGreen*16);
73  //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] = sBOUND(int(red));
99  m_palette[i * 3 + 1] = sBOUND(int(green));
100  m_palette[i * 3 + 2] = sBOUND(int(blue));
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 (int 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 (int 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  int n2 = NumSamples;
169  for (int twoToTheK = 1; twoToTheK < NumSamples; twoToTheK *= 2)
170  {
171  int n1 = n2;
172  n2 /= 2;
173  for (int 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 (int i = j; i < NumSamples; i += n1)
178  {
179  int 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 (int 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 + x * 2 + y * m_outWidth * 2;
230  if (p[0] + br1 < 255)
231  p[0] += br1;
232  else
233  p[0] = 255;
234  if (p[1] + br2 < 255)
235  p[1] += br2;
236  else
237  p[1] = 255;
238 }
239 
240 void Synaesthesia::addPixelFast(unsigned char *p, int br1, int br2)
241 {
242  if (p[0] + br1 < 255)
243  p[0] += br1;
244  else
245  p[0] = 255;
246  if (p[1] + br2 < 255)
247  p[1] += br2;
248  else
249  p[1] = 255;
250 }
251 
252 unsigned char Synaesthesia::getPixel(int x, int y, int where) const
253 {
254  if (x < 0 || y < 0 || x >= m_outWidth || y >= m_outHeight)
255  return 0;
256 
257  return lastOutput[where];
258 }
259 
260 void Synaesthesia::fadeFade(void) const
261 {
262  auto *ptr = (uint32_t *)output;
263  int i = m_outWidth * m_outHeight * 2 / sizeof(uint32_t);
264  do {
265  uint32_t x = *ptr;
266  if (x)
267  {
268  *(ptr++) = x - ((x & (uintptr_t)0xf0f0f0f0) >> 4) -
269  ((x & (uintptr_t)0xe0e0e0e0) >> 5);
270  }
271  else
272  {
273  ptr++;
274  }
275  } while (--i > 0);
276 }
277 
278 void Synaesthesia::fadePixelWave(int x, int y, int where, int step)
279 {
280  short j = short((int(getPixel(x - 1, y, where - 2)) +
281  int(getPixel(x + 1, y, where + 2)) +
282  int(getPixel(x, y - 1, where - step)) +
283  int(getPixel(x, y + 1, where + step))) >> 2) +
284  lastOutput[where];
285 
286  if (!j)
287  {
288  output[where] = 0;
289  return;
290  }
291  j = j - lastLastOutput[where] - 1;
292  if (j < 0)
293  output[where] = 0;
294  else if (j & (255 * 256))
295  output[where] = 255;
296  else
297  output[where] = j;
298 }
299 
301 {
302  unsigned short *t = m_lastLastOutputBmp.data;
305  m_outputBmp.data = t;
306 
307  int step = m_outWidth*2;
308  for (int x = 0, i = 0, j = m_outWidth * (m_outHeight - 1) * 2;
309  x < m_outWidth; x++, i += 2, j += 2)
310  {
311  fadePixelWave(x, 0, i, step);
312  fadePixelWave(x, 0, i + 1, step);
313  fadePixelWave(x, m_outHeight - 1, j, step);
314  fadePixelWave(x, m_outHeight - 1, j + 1, step);
315  }
316 
317  for (int y = 1, i = m_outWidth * 2, j = m_outWidth * 4 - 2;
318  y < m_outHeight; y++, i += step, j += step)
319  {
320  fadePixelWave(0, y, i, step);
321  fadePixelWave(0, y, i + 1, step);
322  fadePixelWave(m_outWidth - 1, y, j, step);
323  fadePixelWave(m_outWidth - 1, y, j + 1, step);
324  }
325 
326  for (int y = 1, start = m_outWidth * 2 + 2, end = m_outWidth * 4 - 2;
327  y < m_outHeight - 1; y++, start += step, end += step)
328  {
329  int i2 = start;
330  do
331  {
332  short j2 = short((int(lastOutput[i2 - 2]) +
333  int(lastOutput[i2 + 2]) +
334  int(lastOutput[i2 - step]) +
335  int(lastOutput[i2 + step])) >> 2) +
336  lastOutput[i2];
337  if (!j2)
338  {
339  output[i2] = 0;
340  }
341  else
342  {
343  j2 = j2 - lastLastOutput[i2] - 1;
344  if (j2 < 0)
345  output[i2] = 0;
346  else if (j2 & (255*256))
347  output[i2] = 255;
348  else
349  output[i2] = j2;
350  }
351  } while(++i2 < end);
352  }
353 }
354 
355 void Synaesthesia::fadePixelHeat(int x, int y, int where, int step)
356 {
357  short j = short((int(getPixel(x - 1, y, where - 2)) +
358  int(getPixel(x + 1, y, where + 2)) +
359  int(getPixel(x, y - 1, where - step)) +
360  int(getPixel(x, y + 1, where + step))) >> 2) +
361  lastOutput[where];
362  if (!j)
363  {
364  output[where] = 0;
365  return;
366  }
367  j = j -lastLastOutput[where] - 1;
368  if (j < 0)
369  output[where] = 0;
370  else if (j & (255 * 256))
371  output[where] = 255;
372  else
373  output[where] = j;
374 }
375 
377 {
378  unsigned short *t = m_lastLastOutputBmp.data;
381  m_outputBmp.data = t;
382 
383  int step = m_outWidth * 2;
384  for (int x = 0, i = 0, j = m_outWidth * (m_outHeight - 1) * 2;
385  x < m_outWidth; x++, i += 2, j += 2)
386  {
387  fadePixelHeat(x, 0, i, step);
388  fadePixelHeat(x, 0, i + 1, step);
389  fadePixelHeat(x, m_outHeight - 1, j, step);
390  fadePixelHeat(x, m_outHeight - 1, j + 1, step);
391  }
392 
393  for(int y = 1, i = m_outWidth * 2, j = m_outWidth * 4 - 2; y < m_outHeight;
394  y++, i += step, j += step)
395  {
396  fadePixelHeat(0, y, i, step);
397  fadePixelHeat(0, y, i + 1, step);
398  fadePixelHeat(m_outWidth - 1, y, j, step);
399  fadePixelHeat(m_outWidth - 1, y, j + 1, step);
400  }
401 
402  for(int y = 1, start = m_outWidth * 2 + 2, end = m_outWidth * 4 - 2;
403  y < m_outHeight - 1; y++, start += step, end += step)
404  {
405  int i2 = start;
406  do
407  {
408  short j2 = short((int(lastOutput[i2 - 2]) +
409  int(lastOutput[i2 + 2]) +
410  int(lastOutput[i2 - step]) +
411  int(lastOutput[i2 + step])) >> 2) +
412  lastOutput[i2];
413  if (!j2)
414  output[i2] = 0;
415  else
416  {
417  j2 = j2 - lastLastOutput[i2] +
418  ((lastLastOutput[i2] - lastOutput[i2]) >> 2) - 1;
419  if (j2 < 0)
420  output[i2] = 0;
421  else if (j2 & (255*256))
422  output[i2] = 255;
423  else
424  output[i2] = j2;
425  }
426  } while(++i2 < end);
427  }
428 }
429 
431 {
432  switch(m_fadeMode)
433  {
434  case Stars: fadeFade(); break;
435  case Flame: fadeHeat(); break;
436  case Wave: fadeWave(); break;
437  default: break;
438  }
439 }
440 
442 {
443  fade();
444 
445  if (!node)
446  return false;
447 
448  samp_dbl_array x {};
449  samp_dbl_array y {};
450  samp_dbl_array a {};
451  samp_dbl_array b {};
452  samp_int_array clarity {};
453 
454  int brightFactor = int(Brightness * m_brightnessTwiddler / (m_starSize + 0.01));
455 
456  int numSamps = NumSamples;
457  if (node->m_length < NumSamples)
458  numSamps = node->m_length;
459 
460  for (int i = 0; i < numSamps; i++)
461  {
462  x[i] = node->m_left[i];
463  if (node->m_right)
464  y[i] = node->m_right[i];
465  else
466  y[i] = x[i];
467  }
468 
469  fft(x.data(), y.data());
470 
471  double energy = 0.0;
472 
473  for (int i = 0 + 1; i < NumSamples / 2; i++)
474  {
475  double x1 = x[m_bitReverse[i]];
476  double y1 = y[m_bitReverse[i]];
477  double x2 = x[m_bitReverse[NumSamples - i]];
478  double y2 = y[m_bitReverse[NumSamples - i]];
479  double aa = NAN;
480  double bb = NAN;
481  a[i] = sqrt(aa = (x1 + x2) * (x1 + x2) + (y1 - y2) * (y1 - y2));
482  b[i] = sqrt(bb = (x1 - x2) * (x1 - x2) + (y2 + y2) * (y1 + y2));
483  if (aa + bb != 0.0)
484  {
485  clarity[i] = (int)(((x1 + x2) * (x1 - x2) + (y1 + y2) * (y1 - y2)) /
486  (aa + bb) * 256);
487  }
488  else
489  {
490  clarity[i] = 0;
491  }
492 
493  energy += (aa + bb) * i * i;
494  }
495 
496  energy = sqrt(energy / NumSamples) / 65536.0;
497 
498  //int heightFactor = NumSamples / 2 / outHeight + 1;
499  //int actualHeight = NumSamples / 2 / heightFactor;
500  //int heightAdd = (outHeight + actualHeight) >> 1;
501 
502  double brightFactor2 = (brightFactor / 65536.0 / NumSamples) *
503  sqrt(m_outHeight * m_outWidth / (320.0 * 200.0));
504 
505  m_energyAvg = m_energyAvg * 0.95 + energy * 0.05;
506  if (m_energyAvg > 0.0)
507  brightFactor2 *= 80.0 / (m_energyAvg + 5.0);
508 
509  for (int i = 1; i < NumSamples / 2; i++)
510  {
511  if (a[i] > 0 || b[i] > 0)
512  {
513  int h = (int)(b[i] * m_outWidth / (a[i] + b[i]));
514  int br = (int)((a[i] + b[i]) * i * brightFactor2);
515  int br1 = br * (clarity[i] + 128) >> 8;
516  int br2 = br * (128 - clarity[i]) >> 8;
517  if (br1 < 0) br1 = 0; else if (br1 > 255) br1 = 255;
518  if (br2 < 0) br2 = 0; else if (br2 > 255) br2 = 255;
519 
520  int px = h;
521  int py = m_outHeight - i * m_outHeight / (NumSamples / 2);
522 
524  {
525  addPixel(px, py, br1, br2);
526  br1 = m_scaleDown[br1];
527  br2 = m_scaleDown[br2];
528 
529  for(int j = 1; br1 > 0 || br2 > 0;
530  j++, br1 = m_scaleDown[br1], br2 = m_scaleDown[br2])
531  {
532  for (int k = 0; k < j; k++)
533  {
534  addPixel(px - j + k,py - k, br1, br2);
535  addPixel(px + k, py - j + k, br1, br2);
536  addPixel(px + j - k, py + k, br1, br2);
537  addPixel(px - k, py + j - k, br1, br2);
538  }
539  }
540  }
541  else
542  {
543  if (px < m_maxStarRadius || py < m_maxStarRadius ||
544  px > m_outWidth - m_maxStarRadius ||
546  {
547  addPixel(px, py, br1, br2);
548  for(int j = 1; br1 > 0 || br2 > 0;
549  j++, br1 = m_scaleDown[br1], br2 = m_scaleDown[br2])
550  {
551  addPixel(px + j, py, br1, br2);
552  addPixel(px, py + j, br1, br2);
553  addPixel(px - j, py, br1, br2);
554  addPixel(px, py - j, br1, br2);
555  }
556  }
557  else
558  {
559  unsigned char *p = output + px * 2 + py * m_outWidth * 2;
560  unsigned char *p1 = p;
561  unsigned char *p2 = p;
562  unsigned char *p3 = p;
563  unsigned char *p4 = p;
564  addPixelFast(p, br1, br2);
565  for (; br1 > 0 || br2 > 0;
566  br1 = m_scaleDown[br1], br2 = m_scaleDown[br2])
567  {
568  p1 += 2;
569  addPixelFast(p1, br1, br2);
570  p2 -= 2;
571  addPixelFast(p2, br1, br2);
572  p3 += m_outWidth * 2;
573  addPixelFast(p3, br1, br2);
574  p4 -= m_outWidth*2;
575  addPixelFast(p4, br1, br2);
576  }
577  }
578  }
579  }
580  }
581 
582  return false;
583 }
584 
585 bool Synaesthesia::draw(QPainter *p, const QColor &back)
586 {
587  if (!m_outputImage)
588  return true;
589 
590  (void)back;
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(MainVisual *parent, const QString &pluginName) const override // VisFactory
645  {
646  (void)parent;
647  (void)pluginName;
648  return new Synaesthesia();
649  }
LogSize
#define LogSize
Definition: synaesthesia.h:12
Synaesthesia::m_fgRedSlider
double m_fgRedSlider
Definition: synaesthesia.h:74
samp_dbl_array
std::array< double, NumSamples > samp_dbl_array
Definition: synaesthesia.h:16
Synaesthesia::m_outWidth
int m_outWidth
Definition: synaesthesia.h:65
Synaesthesia::bitReverser
static int bitReverser(int i)
Definition: synaesthesia.cpp:154
Brightness
Definition: channelsettings.cpp:483
Synaesthesia::coreInit
void coreInit(void)
Definition: synaesthesia.cpp:210
Synaesthesia::m_lastOutputBmp
Bitmap< unsigned short > m_lastOutputBmp
Definition: synaesthesia.h:69
back
static guint32 * back
Definition: goom_core.cpp:30
VisualNode
Definition: videovisual.h:23
Bitmap::size
void size(int w, int h)
Definition: polygon.h:18
SynaesthesiaFactory::create
VisualBase * create(MainVisual *parent, const QString &pluginName) const override
Definition: synaesthesia.cpp:644
Synaesthesia::setStarSize
void setStarSize(double lsize)
Definition: synaesthesia.cpp:191
lastLastOutput
#define lastLastOutput
Definition: synaesthesia.cpp:222
x2
static int x2
Definition: mythsocket.cpp:61
Wave
#define Wave
Definition: synaesthesia.h:20
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:585
VisualBase
Definition: visualize.h:73
Flame
#define Flame
Definition: synaesthesia.h:19
Synaesthesia::Synaesthesia
Synaesthesia(void)
Definition: synaesthesia.cpp:31
Synaesthesia::m_starSize
double m_starSize
Definition: synaesthesia.h:63
Synaesthesia::m_pointsAreDiamonds
bool m_pointsAreDiamonds
Definition: synaesthesia.h:61
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
synaesthesia.h
Bitmap::data
Pixel * data
Definition: polygon.h:13
Synaesthesia
Definition: synaesthesia.h:24
Stars
#define Stars
Definition: synaesthesia.h:21
Synaesthesia::m_bgGreenSlider
double m_bgGreenSlider
Definition: synaesthesia.h:77
VisualNode::m_left
short * m_left
Definition: videovisual.h:34
Synaesthesia::fadeFade
void fadeFade(void) const
Definition: synaesthesia.cpp:260
Synaesthesia::~Synaesthesia
~Synaesthesia() override
Definition: synaesthesia.cpp:40
Synaesthesia::m_outHeight
int m_outHeight
Definition: synaesthesia.h:66
Synaesthesia::m_bgRedSlider
double m_bgRedSlider
Definition: synaesthesia.h:76
Synaesthesia::addPixelFast
static void addPixelFast(unsigned char *p, int br1, int br2)
Definition: synaesthesia.cpp:240
Synaesthesia::fade
void fade(void)
Definition: synaesthesia.cpp:430
mythlogging.h
Synaesthesia::m_palette
std::array< uint8_t, 768 > m_palette
Definition: synaesthesia.h:73
hardwareprofile.config.p
p
Definition: config.py:33
VisualNode::m_right
short * m_right
Definition: videovisual.h:35
hardwareprofile.i18n.t
t
Definition: i18n.py:36
compat.h
Synaesthesia::m_outputImage
QImage * m_outputImage
Definition: synaesthesia.h:71
p2
static guint32 * p2
Definition: goom_core.cpp:31
x1
static int x1
Definition: mythsocket.cpp:60
samp_int_array
std::array< int, NumSamples > samp_int_array
Definition: synaesthesia.h:17
VisFactory
Definition: visualize.h:102
Synaesthesia::m_maxStarRadius
int m_maxStarRadius
Definition: synaesthesia.h:59
Synaesthesia::m_outputBmp
Bitmap< unsigned short > m_outputBmp
Definition: synaesthesia.h:68
Synaesthesia::m_size
QSize m_size
Definition: synaesthesia.h:53
Synaesthesia::m_negSinTable
samp_dbl_array m_negSinTable
Definition: synaesthesia.h:56
Synaesthesia::m_cosTable
samp_dbl_array m_cosTable
Definition: synaesthesia.h:55
f
QTextStream t & f
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:603
Synaesthesia::setupPalette
void setupPalette(void)
Definition: synaesthesia.cpp:45
uint
unsigned int uint
Definition: compat.h:141
Synaesthesia::getPixel
unsigned char getPixel(int x, int y, int where) const
Definition: synaesthesia.cpp:252
p1
static guint32 * p1
Definition: goom_core.cpp:31
MainVisual
Definition: mainvisual.h:33
VisualNode::m_length
long m_length
Definition: videovisual.h:36
NumSamples
#define NumSamples
Definition: synaesthesia.h:14
VisualBase::m_fps
int m_fps
Definition: visualize.h:97
Synaesthesia::m_bitReverse
samp_int_array m_bitReverse
Definition: synaesthesia.h:57
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:7
Synaesthesia::process
bool process(VisualNode *node) override
Definition: synaesthesia.cpp:441
mainvisual.h
Synaesthesia::m_energyAvg
double m_energyAvg
Definition: synaesthesia.h:79
sMAX
#define sMAX(x, y)
sBOUND
#define sBOUND(x)
Synaesthesia::fadeWave
void fadeWave(void)
Definition: synaesthesia.cpp:300
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:376
Synaesthesia::m_brightnessTwiddler
double m_brightnessTwiddler
Definition: synaesthesia.h:62
Synaesthesia::m_scaleDown
std::array< int, 256 > m_scaleDown
Definition: synaesthesia.h:58
Synaesthesia::fadePixelHeat
void fadePixelHeat(int x, int y, int where, int step)
Definition: synaesthesia.cpp:355
Synaesthesia::fadePixelWave
void fadePixelWave(int x, int y, int where, int step)
Definition: synaesthesia.cpp:278
output
#define output
Definition: synaesthesia.cpp:220
Synaesthesia::m_fadeMode
int m_fadeMode
Definition: synaesthesia.h:60
SynaesthesiaFactory
Definition: synaesthesia.cpp:629
Synaesthesia::m_fgGreenSlider
double m_fgGreenSlider
Definition: synaesthesia.h:75
Synaesthesia::m_lastLastOutputBmp
Bitmap< unsigned short > m_lastLastOutputBmp
Definition: synaesthesia.h:70
Synaesthesia::fft
void fft(double *x, double *y)
Definition: synaesthesia.cpp:166
SynaesthesiaFactory::name
const QString & name(void) const override
Definition: synaesthesia.cpp:631