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