MythTV  master
glsingleview.cpp
Go to the documentation of this file.
1 /* ============================================================
2  * File : glsingleview.cpp
3  * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
4  * Date : 2004-01-13
5  * Description :
6  *
7  * Copyright 2004 by Renchi Raju
8  *
9  * This program is free software; you can redistribute it
10  * and/or modify it under the terms of the GNU General
11  * Public License as published bythe Free Software Foundation;
12  * either version 2, or (at your option)
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * ============================================================ */
21 
22 // Include own header first to catch missing includes
23 #include "glsingleview.h"
24 
25 // ANSI C headers
26 #include <cmath>
27 
28 // C++ headers
29 #include <algorithm>
30 using namespace std;
31 
32 // Qt headers
33 #include <QDir>
34 #include <QImage>
35 #include <QPainter>
36 #include <QTimer>
37 #include <qbuffer.h>
38 #include <utility>
39 
40 // MythTV plugin headers
41 #include <mythcontext.h>
42 #include <mythdate.h>
43 #include <mythuihelper.h>
44 #include "mythlogging.h"
45 #if defined _MSC_VER || defined __MINGW32__
46 # include "compat.h" // for random
47 #endif
48 
49 // MythGallery headers
50 #include "galleryutil.h"
51 
52 #define LOC QString("GLView: ")
53 
55  int *pos, int slideShow, int sortOrder,
56  MythMainWindow *parent, const char *name)
57  : MythDialog(parent, name)
58 {
59  QBoxLayout *l = new QVBoxLayout(this);
60  l->setContentsMargins(0, 0, 0, 0);
61  m_view = new GLSingleView(itemList, pos, slideShow, sortOrder, this);
62  l->addWidget(m_view);
63 
64  setFocusProxy(m_view);
65  m_view->setFocus();
66 }
67 
68 // Have to clean up with this dirty hack because
69 // qglwidget segfaults with a destructive close
70 
71 void GLSDialog::closeEvent(QCloseEvent *e)
72 {
73  m_view->CleanUp();
74  e->accept();
75 
76  accept();
77 }
78 
79 GLSingleView::GLSingleView(const ThumbList& itemList, int *pos, int slideShow,
80  int sortorder, QWidget *parent)
81  : QGLWidget(parent),
82  ImageView(itemList, pos, slideShow, sortorder)
83 {
84  m_scaleMax = (ScaleMax) gCoreContext->GetNumSetting("GalleryScaleMax", 0);
85 
89 
90  m_slideshow_timer = new QTimer(this);
92 
93  // --------------------------------------------------------------------
94 
95  setFocusPolicy(Qt::WheelFocus);
96 
97  // --------------------------------------------------------------------
98 
99  QString transType = gCoreContext->GetSetting("SlideshowOpenGLTransition");
100  if (!transType.isEmpty() && m_effect_map.contains(transType))
101  m_effect_method = m_effect_map[transType];
102 
103  if (m_effect_method.isEmpty() || transType == QString("random (gl)"))
104  {
106  m_effect_random = true;
107  }
108 
110  "SlideshowOpenGLTransitionLength", 2000));
111 
112  // --------------------------------------------------------------------
113 
114  connect(m_slideshow_timer, SIGNAL(timeout()), this, SLOT(SlideTimeout()));
115 
116  // --------------------------------------------------------------------
117 
118  if (slideShow)
119  {
121  m_slideshow_running = true;
122  m_slideshow_timer->stop();
123  m_slideshow_timer->setSingleShot(true);
126  }
127 }
128 
130 {
131  // save the current m_scaleMax setting so we can restore it later
132  gCoreContext->SaveSetting("GalleryScaleMax", m_scaleMax);
133  CleanUp();
134 }
135 
137 {
138  makeCurrent();
139 
141  {
144  }
145 
146  if (m_slideshow_timer)
147  {
148  m_slideshow_timer->stop();
149  m_slideshow_timer->deleteLater();
150  m_slideshow_timer = nullptr;
151  }
152 
153  m_texItem[0].Deinit();
154  m_texItem[1].Deinit();
155 
156  if (m_texInfo)
157  glDeleteTextures(1, &m_texInfo);
158 }
159 
161 {
162  // Enable Texture Mapping
163  glEnable(GL_TEXTURE_2D);
164  // Clear The Background Color
165  glClearColor(0.0, 0.0, 0.0, 1.0F);
166 
167  // Turn Blending On
168  glEnable(GL_BLEND);
169  // Blending Function For Translucency Based On Source Alpha Value
170  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
171 
172  // Enable perspective vision
173  glClearDepth(1.0F);
174 
175  GLint param;
176  glGetIntegerv(GL_MAX_TEXTURE_SIZE, &param);
177  m_texMaxDim = param;
178 
179  Load();
180 }
181 
182 void GLSingleView::resizeGL(int w, int h)
183 {
184  // Reset The Current Viewport And Perspective Transformation
185  glViewport(0, 0, w, h);
186 
187  glMatrixMode(GL_PROJECTION);
188  glLoadIdentity();
189 }
190 
192 {
193  if (1 == m_movieState)
194  {
195  m_movieState = 2;
196 
197  ThumbItem *item = getCurrentItem();
198 
199  if (item)
200  {
202  makeCurrent();
203  }
204 
205  if (!m_slideshow_running && item)
206  {
207  QImage image;
208  GetScreenShot(image, item);
209  if (image.isNull())
210  return;
211 
212  image = image.scaled(800, 600);
213 
214  // overlay "Press SELECT to play again" text
215  QPainter p(&image);
216  QRect rect = QRect(20, image.height() - 100,
217  image.width() - 40, 80);
218  p.fillRect(rect, QBrush(QColor(0,0,0,100)));
219  p.setFont(QFont("Arial", 25, QFont::Bold));
220  p.setPen(QColor(255,255,255));
221  p.drawText(rect, Qt::AlignCenter, tr("Press SELECT to play again"));
222  p.end();
223 
224  m_texSize = QSize(
225  GetNearestGLTextureSize(image.size().width()),
226  GetNearestGLTextureSize(image.size().height()));
227  int a = m_tex1First ? 0 : 1;
228  m_texItem[a].SetItem(item, image.size());
230  m_texItem[a].Init(convertToGLFormat(
231  image.scaled(m_texSize,
232  Qt::IgnoreAspectRatio,
233  Qt::SmoothTransformation)));
234  }
235  }
236 
237  glDisable(GL_DEPTH_TEST);
238 
239  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
240  glLoadIdentity();
241 
242  glMatrixMode(GL_PROJECTION);
243  glLoadIdentity();
244 
245  glMatrixMode(GL_MODELVIEW);
246  glLoadIdentity();
247 
248  if (m_effect_running && !m_effect_method.isEmpty())
249  {
251  }
252  else
253  {
254  paintTexture();
255  }
256 
257  if (glGetError())
258  LOG(VB_GENERAL, LOG_ERR, LOC + "OpenGL error detected");
259 }
260 
261 void GLSingleView::keyPressEvent(QKeyEvent *e)
262 {
263  bool handled = false;
264 
267  bool wasRunning = m_slideshow_running;
268  if (m_slideshow_timer)
269  m_slideshow_timer->stop();
270  m_slideshow_running = false;
272  m_effect_running = false;
274 
275  bool wasInfo = m_info_show;
276  m_info_show = false;
277  bool wasInfoShort = m_info_show_short;
278  m_info_show_short = false;
279 
280  QStringList actions;
281  handled = GetMythMainWindow()->TranslateKeyPress("Gallery", e, actions);
282 
283  float scrollX = 0.2F;
284  float scrollY = 0.2F;
285 
286  for (int i = 0; i < actions.size() && !handled; i++)
287  {
288  QString action = actions[i];
289  handled = true;
290 
291  if (action == "LEFT" || action == "UP")
292  {
293  m_info_show = wasInfo;
294  m_slideshow_running = wasRunning;
295  DisplayPrev(true, true);
296  }
297  else if (action == "RIGHT" || action == "DOWN")
298  {
299  m_info_show = wasInfo;
300  m_slideshow_running = wasRunning;
301  DisplayNext(true, true);
302  }
303  else if (action == "ZOOMOUT")
304  {
305  if (m_zoom > 0.5F)
306  {
307  SetZoom(m_zoom - 0.5F);
308  if (m_zoom > 1.0F)
309  {
310  m_source_x -= m_source_x / ((m_zoom + 0.5F) * 2.0F);
311  m_source_y -= m_source_y / ((m_zoom + 0.5F) * 2.0F);
312 
313  checkPosition();
314  }
315  else
316  {
317  m_source_x = 0;
318  m_source_y = 0;
319  }
320  }
321  }
322  else if (action == "ZOOMIN")
323  {
324  if (m_zoom < 4.0F)
325  {
326  SetZoom(m_zoom + 0.5F);
327  if (m_zoom > 1.0F)
328  {
329  m_source_x += m_source_x / (m_zoom * 2.0F);
330  m_source_y += m_source_y / (m_zoom * 2.0F);
331 
332  checkPosition();
333  }
334  else
335  {
336  m_source_x = 0;
337  m_source_y = 0;
338  }
339  }
340  }
341  else if (action == "FULLSIZE")
342  {
343  m_source_x = 0;
344  m_source_y = 0;
345  if (m_zoom != 1)
346  SetZoom(1.0F);
347  }
348  else if (action == "SCROLLLEFT")
349  {
350  if (m_zoom > 1.0F && m_source_x < m_zoom - 1.0F)
351  {
352  m_source_x += scrollX;
353  m_source_x = min(m_source_x, m_zoom - 1.0F);
354  }
355  }
356  else if (action == "SCROLLRIGHT")
357  {
358  if (m_zoom > 1.0F && m_source_x > -m_zoom + 1.0F)
359  {
360  m_source_x -= scrollX;
361  m_source_x = max(m_source_x, -m_zoom + 1.0F);
362  }
363  }
364  else if (action == "SCROLLDOWN")
365  {
366  if (m_zoom > 1.0F && m_source_y < m_zoom - 1.0F)
367  {
368  m_source_y += scrollY;
369  m_source_y = min(m_source_y, m_zoom - 1.0F);
370  }
371  }
372  else if (action == "SCROLLUP")
373  {
374  if (m_zoom > 1.0F && m_source_y > -m_zoom + 1.0F)
375  {
376  m_source_y -= scrollY;
377  m_source_y = max(m_source_y, -m_zoom + 1.0F);
378  }
379  }
380  else if (action == "RECENTER")
381  {
382  if (m_zoom > 1.0F)
383  {
384  m_source_x = 0.0F;
385  m_source_y = 0.0F;
386  }
387  }
388  else if (action == "UPLEFT")
389  {
390  if (m_zoom > 1.0F)
391  {
392  m_source_x = 1.0F;
393  m_source_y = -1.0F;
394  }
395  }
396  else if (action == "LOWRIGHT")
397  {
398  if (m_zoom > 1.0F)
399  {
400  m_source_x = -1.0F;
401  m_source_y = 1.0F;
402  }
403  }
404  else if (action == "ROTRIGHT")
405  {
406  m_source_x = 0;
407  m_source_y = 0;
408  Rotate(90);
409  }
410  else if (action == "ROTLEFT")
411  {
412  m_source_x = 0;
413  m_source_y = 0;
414  Rotate(-90);
415  }
416  else if (action == "DELETE")
417  {
418  ThumbItem *item = getCurrentItem();
419  if (item && GalleryUtil::Delete(item->GetPath()))
420  {
421  item->SetPixmap(nullptr);
422  DisplayNext(true, true);
423  }
424  m_info_show = wasInfo;
425  m_slideshow_running = wasRunning;
426  }
427  else if ((action == "PLAY" || action == "SELECT") && m_movieState == 2)
428  {
429  m_movieState = 1;
430  }
431  else if (action == "PLAY" || action == "SLIDESHOW" ||
432  action == "RANDOMSHOW" || action == "SEASONALSHOW")
433  {
434  m_source_x = 0;
435  m_source_y = 0;
436  SetZoom(1.0F);
437  m_info_show = wasInfo;
438  m_info_show_short = true;
439  m_slideshow_running = !wasRunning;
440  }
441  else if (action == "INFO")
442  {
443  m_info_show = !wasInfo && !wasInfoShort;
444  m_slideshow_running = wasRunning;
445  }
446  else if (action == "FULLSCREEN")
447  {
449  m_source_x = 0;
450  m_source_y = 0;
451  SetZoom(1.0F);
452 
453  int a = m_tex1First ? 0 : 1;
455  }
456  else
457  {
458  handled = false;
459  }
460  }
461 
463  {
464  m_slideshow_timer->stop();
465  m_slideshow_timer->setSingleShot(true);
467  }
468 
470  {
473  }
474 
475  updateGL();
476 
477  if (handled)
478  {
479  e->accept();
480  }
481  else {
482  e->ignore();
483  }
484 }
485 
487 {
488  m_source_x = max(m_source_x, -m_zoom + 1.0F);
489  m_source_y = max(m_source_y, -m_zoom + 1.0F);
490  m_source_x = min(m_source_x, m_zoom - 1.0F);
491  m_source_y = min(m_source_y, m_zoom - 1.0F);
492 }
493 
495 {
496  glMatrixMode(GL_MODELVIEW);
497  glLoadIdentity();
498 
499  glTranslatef(m_source_x, m_source_y, 0.0F);
500  glScalef(m_zoom, m_zoom, 1.0F);
501 
503 
505  {
506  createTexInfo();
507 
508  glMatrixMode(GL_MODELVIEW);
509  glLoadIdentity();
510 
511  glMatrixMode(GL_TEXTURE);
512  glLoadIdentity();
513 
514  glBindTexture(GL_TEXTURE_2D, m_texInfo);
515  glBegin(GL_QUADS);
516  {
517  glColor4f(1.0F, 1.0F, 1.0F, 0.72F);
518  glTexCoord2f(0.0F, 0.0F);
519  glVertex3f(-0.75F, -0.75F, 0.0F);
520 
521  glTexCoord2f(1.0F, 0.0F);
522  glVertex3f(+0.75F, -0.75F, 0.0F);
523 
524  glTexCoord2f(1.0F, 1.0F);
525  glVertex3f(+0.75F, +0.75F, 0.0F);
526 
527  glTexCoord2f(0.0F, 1.0F);
528  glVertex3f(-0.75F, +0.75F, 0.0F);
529  }
530  glEnd();
531  }
532 }
533 
534 void GLSingleView::DisplayNext(bool reset, bool loadImage)
535 {
536  if (reset)
537  {
538  m_zoom = 1.0F;
539  m_source_x = 0.0F;
540  m_source_y = 0.0F;
541  }
542 
543  // Search for next item that hasn't been deleted.
544  // Close viewer if none remain.
545  int oldpos = m_pos;
546 
547  while (true)
548  {
549  ThumbItem *item = advanceItem();
550  if (item)
551  {
552  if (QFile::exists(item->GetPath()))
553  {
554  break;
555  }
556  }
557  if (m_pos == oldpos)
558  {
559  // No valid items!!!
560  close();
561  }
562  }
563 
565  m_texCur = (m_texCur) ? 0 : 1;
566 
567  if (loadImage)
568  Load();
569 }
570 
571 void GLSingleView::DisplayPrev(bool reset, bool loadImage)
572 {
573  if (reset)
574  {
575  m_zoom = 1.0F;
576  m_source_x = 0.0F;
577  m_source_y = 0.0F;
578  }
579 
580  // Search for next item that hasn't been deleted.
581  // Close viewer in none remain.
582  int oldpos = m_pos;
583  while (true)
584  {
585  ThumbItem *item = retreatItem();
586  if (item && QFile::exists(item->GetPath()))
587  break;
588 
589  if (m_pos == oldpos)
590  {
591  // No valid items!!!
592  close();
593  }
594  };
595 
597  m_texCur = (m_texCur) ? 0 : 1;
598 
599  if (loadImage)
600  Load();
601 }
602 
604 {
605  m_movieState = 0;
606  ThumbItem *item = getCurrentItem();
607  if (!item)
608  {
609  LOG(VB_GENERAL, LOG_ERR, LOC + QString("No item at %1").arg(m_pos));
610  return;
611  }
612 
613  if (GalleryUtil::IsMovie(item->GetPath()))
614  {
615  m_movieState = 1;
616  return;
617  }
618 
619  QImage image(item->GetPath());
620  if (image.isNull())
621  return;
622 
623  m_texSize = QSize(GetNearestGLTextureSize(image.size().width()),
624  GetNearestGLTextureSize(image.size().height()));
625  int a = m_tex1First ? 0 : 1;
626  m_texItem[a].SetItem(item, image.size());
628  m_texItem[a].Init(convertToGLFormat(
629  image.scaled(m_texSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
630 
631  UpdateLCD(item);
632 }
633 
634 void GLSingleView::Rotate(int angle)
635 {
636  int ang = m_texItem[m_texCur].GetAngle() + angle;
637 
638  ang = (ang >= 360) ? ang - 360 : ang;
639  ang = (ang < 0) ? ang + 360 : ang;
640 
642 
643  ThumbItem *item = getCurrentItem();
644  if (item)
645  item->SetRotationAngle(ang);
646 
649 }
650 
651 void GLSingleView::SetZoom(float zoom)
652 {
653  m_zoom = zoom;
654 }
655 
657 {
660  if (timeout)
662 }
663 
665 {
666  int n = 0, last = 0;
667  int s;
668 
669  for (s = 0; s < 32; ++s)
670  {
671  if (((v >> s) & 1) == 1)
672  {
673  ++n;
674  last = s;
675  }
676  }
677 
678  if (n > 1 && last < 31)
679  s = 1 << (last + 1);
680  else
681  s = 1 << last;
682 
683  return min(s, m_texMaxDim);
684 }
685 
687 {
688  m_effect_map.insert("none", "EffectNone");
689  m_effect_map.insert("blend (gl)", "EffectBlend");
690  m_effect_map.insert("zoom blend (gl)", "EffectZoomBlend");
691  m_effect_map.insert("fade (gl)", "EffectFade");
692  m_effect_map.insert("rotate (gl)", "EffectRotate");
693  m_effect_map.insert("bend (gl)", "EffectBend");
694  m_effect_map.insert("inout (gl)", "EffectInOut");
695  m_effect_map.insert("slide (gl)", "EffectSlide");
696  m_effect_map.insert("flutter (gl)", "EffectFlutter");
697  m_effect_map.insert("cube (gl)", "EffectCube");
698  m_effect_map.insert("Ken Burns (gl)", "EffectKenBurns");
699 }
700 
701 void GLSingleView::RunEffect(const QString &effect)
702 {
703  if (effect == "EffectBlend")
704  EffectBlend();
705  else if (effect == "EffectZoomBlend")
706  EffectZoomBlend();
707  else if (effect == "EffectFade")
708  EffectFade();
709  else if (effect == "EffectRotate")
710  EffectRotate();
711  else if (effect == "EffectBend")
712  EffectBend();
713  else if (effect == "EffectInOut")
714  EffectInOut();
715  else if (effect == "EffectSlide")
716  EffectSlide();
717  else if (effect == "EffectFlutter")
718  EffectFlutter();
719  else if (effect == "EffectCube")
720  EffectCube();
721  else if (effect == "EffectKenBurns")
722  EffectKenBurns();
723  else //if (effect == "EffectNone")
724  EffectNone();
725 }
726 
728 {
729  paintTexture();
730  m_effect_running = false;
732 }
733 
735 {
737  {
738  paintTexture();
739  m_effect_running = false;
741  return;
742  }
743 
745 
746  m_texItem[(m_texCur) ? 0 : 1].MakeQuad();
747 
748  glBegin(GL_QUADS);
749  {
750  glColor4f(0.0F, 0.0F, 0.0F, 1.0F * t);
751  glVertex3f(-1.0F, -1.0F, 0.0F);
752  glVertex3f(+1.0F, -1.0F, 0.0F);
753  glVertex3f(+1.0F, +1.0F, 0.0F);
754  glVertex3f(-1.0F, +1.0F, 0.0F);
755  }
756  glEnd();
757 
759 
761 }
762 
764 {
766  {
767  paintTexture();
768  m_effect_running = false;
770  return;
771  }
772 
774 
775  m_texItem[m_texCur ? 0 : 1].MakeQuad(1.0F - t, 1.0F + (0.75F * t));
777 
779 }
780 
782 {
784  {
785  paintTexture();
786  m_effect_running = false;
788  return;
789  }
790 
791  if (m_effect_current_frame == 0)
792  m_effect_rotate_direction = (int)((2.0*random()/(RAND_MAX+1.0)));
793 
795 
797 
798  glMatrixMode(GL_MODELVIEW);
799  glLoadIdentity();
800  float rotate = 360.0F * t;
801  glRotatef(((m_effect_rotate_direction == 0) ? -1 : 1) * rotate,
802  0.0F, 0.0F, 1.0F);
803  float scale = 1.0F * (1.0F - t);
804  glScalef(scale, scale, 1.0F);
805 
806  m_texItem[(m_texCur) ? 0 : 1].MakeQuad();
807 
809 }
810 
812 {
814  {
815  paintTexture();
816  m_effect_running = false;
818  return;
819  }
820 
821  if (m_effect_current_frame == 0)
822  m_effect_rotate_direction = (int)((2.0F*random()/(RAND_MAX+1.0F)));
823 
825 
827 
828  glMatrixMode(GL_MODELVIEW);
829  glLoadIdentity();
830  glRotatef(90.0F * t,
831  (m_effect_rotate_direction == 0) ? 1.0F : 0.0F,
832  (m_effect_rotate_direction == 1) ? 1.0F : 0.0F,
833  0.0F);
834 
835  m_texItem[(m_texCur) ? 0 : 1].MakeQuad();
836 
838 }
839 
841 {
843  {
844  paintTexture();
845  m_effect_running = false;
847  return;
848  }
849 
851 
853  m_texItem[(m_texCur) ? 0 : 1].MakeQuad(1.0F - (2.0F * t));
854  else
855  m_texItem[m_texCur].MakeQuad(2.0F * (t - 0.5F));
856 
858 }
859 
861 {
863  {
864  paintTexture();
865  m_effect_running = false;
867  return;
868  }
869 
870  if (m_effect_current_frame == 0)
871  {
872  m_effect_rotate_direction = 1 + (int)((4.0F*random()/(RAND_MAX+1.0F)));
873  }
874 
875  int texnum = m_texCur;
876  bool fadeout = false;
877  float const elapsed = m_effect_frame_time.elapsed();
878  if (elapsed <= m_effect_transition_timeout / 2.0F)
879  {
880  texnum = (m_texCur) ? 0 : 1;
881  fadeout = true;
882  }
883 
884  glMatrixMode(GL_MODELVIEW);
885  glLoadIdentity();
886 
887  float tt = elapsed * m_effect_transition_timeout_inv;
888  float t = 2.0F * ((fadeout) ? (0.5F - tt) : (tt - 0.5F));
889 
890  glScalef(t, t, 1);
891  t = 1.0F - t;
892  glTranslatef((m_effect_rotate_direction % 2 == 0) ? ((m_effect_rotate_direction == 2)? t : -t) : 0,
893  (m_effect_rotate_direction % 2 == 1) ? ((m_effect_rotate_direction == 1)? t : -t) : 0,
894  0);
895 
896  m_texItem[texnum].MakeQuad();
897 
899 }
900 
902 {
904  {
905  paintTexture();
906  m_effect_running = false;
908  return;
909  }
910 
911  if (m_effect_current_frame == 0)
912  m_effect_rotate_direction = 1 + (int)((4.0F * random() / (RAND_MAX + 1.0F)));
913 
915 
916  glMatrixMode(GL_MODELVIEW);
917  glLoadIdentity();
919  float trans = 2.0F * t;
920  glTranslatef((m_effect_rotate_direction % 2 == 0) ? ((m_effect_rotate_direction == 2)? 1 : -1) * trans : 0.0F,
921  (m_effect_rotate_direction % 2 == 1) ? ((m_effect_rotate_direction == 1)? 1 : -1) * trans : 0.0F,
922  0.0F);
923 
924  m_texItem[(m_texCur) ? 0 : 1].MakeQuad();
925 
927 }
928 
930 {
932  {
933  paintTexture();
934  m_effect_running = false;
936  return;
937  }
938 
939  GLTexture &ta = m_texItem[(m_texCur) ? 0 : 1];
940 
941  if (m_effect_current_frame == 0)
942  {
943  for (int x = 0; x < 40; x++)
944  {
945  for (int y = 0; y < 40; y++)
946  {
947  m_effect_flutter_points[x][y][0] =
948  (x / 20.0F - 1.0F) * ta.GetTextureX();
949  m_effect_flutter_points[x][y][1] =
950  (y / 20.0F - 1.0F) * ta.GetTextureY();
951  m_effect_flutter_points[x][y][2] =
952  sin((x / 20.0F - 1.0F) * static_cast<float>(M_PI) * 2.0F) / 5.0F;
953  }
954  }
955  }
956 
958 
960  float rotate = 60.0F * t;
961  float scale = 1.0F - t;
962 
963  glMatrixMode(GL_MODELVIEW);
964  glLoadIdentity();
965  glRotatef(rotate, 1.0F, 0.0F, 0.0F);
966  glScalef(scale, scale, scale);
967  glTranslatef(t, t, 0.0F);
968 
969  ta.Bind();
970 
971  glBegin(GL_QUADS);
972  {
973  glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
974 
975  float float_x, float_y, float_xb, float_yb;
976  int x, y;
977 
978  for (x = 0; x < 39; x++)
979  {
980  for (y = 0; y < 39; y++)
981  {
982  float_x = (float) x / 40.0F;
983  float_y = (float) y / 40.0F;
984  float_xb = (float) (x + 1) / 40.0F;
985  float_yb = (float) (y + 1) / 40.0F;
986  glTexCoord2f(float_x, float_y);
987  glVertex3f(m_effect_flutter_points[x][y][0],
988  m_effect_flutter_points[x][y][1],
989  m_effect_flutter_points[x][y][2]);
990  glTexCoord2f(float_x, float_yb);
991  glVertex3f(m_effect_flutter_points[x][y + 1][0],
992  m_effect_flutter_points[x][y + 1][1],
993  m_effect_flutter_points[x][y + 1][2]);
994  glTexCoord2f(float_xb, float_yb);
995  glVertex3f(m_effect_flutter_points[x + 1][y + 1][0],
996  m_effect_flutter_points[x + 1][y + 1][1],
997  m_effect_flutter_points[x + 1][y + 1][2]);
998  glTexCoord2f(float_xb, float_y);
999  glVertex3f(m_effect_flutter_points[x + 1][y][0],
1000  m_effect_flutter_points[x + 1][y][1],
1001  m_effect_flutter_points[x + 1][y][2]);
1002  }
1003  }
1004  }
1005  glEnd();
1006 
1007  // wave every two iterations
1008  if (m_effect_current_frame%2 == 0)
1009  {
1010  for (int y = 0; y < 40; y++)
1011  {
1012  float hold = m_effect_flutter_points[0][y][2];
1013  for (int x = 0; x < 39; x++)
1014  {
1015  m_effect_flutter_points[x][y][2] = m_effect_flutter_points[x + 1][y][2];
1016  }
1017  m_effect_flutter_points[39][y][2] = hold;
1018  }
1019  }
1021 }
1022 
1024 {
1026  float const rotStart = 0.25 * m_effect_transition_timeout;
1027 
1029  {
1030  paintTexture();
1031  m_effect_running = false;
1033  return;
1034  }
1035 
1036  // Enable perspective vision
1037  glEnable(GL_DEPTH_TEST);
1038  glDepthFunc(GL_LEQUAL);
1039  glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
1040 
1041  GLTexture &ta = m_texItem[(m_texCur) ? 0 : 1];
1042  GLTexture &tb = m_texItem[m_texCur];
1043 
1044  glMatrixMode(GL_PROJECTION);
1045  glLoadIdentity();
1046 
1047 // float PI = 4.0F * atan(1.0F);
1048  float const znear = 3.0F;
1049 // float theta = 2.0F * atan2(2.0F / 2.0F, znear);
1050 // theta = theta * 180.0F/PI;
1051 
1052  glFrustum(-1, 1, -1, 1, znear, 10);
1053 
1054  if (m_effect_current_frame == 0)
1055  {
1056  m_effect_cube_xrot = 0;
1057  m_effect_cube_yrot = 0;
1058  m_effect_cube_zrot = 0;
1059  }
1060 
1061  glMatrixMode(GL_MODELVIEW);
1062  glLoadIdentity();
1063 
1064  float const elapsed = static_cast<float>(m_effect_frame_time.elapsed());
1065  float const tmp = (elapsed <= tot * 0.5F) ? elapsed : tot - elapsed;
1066  float const trans = 5.0F * tmp / tot;
1067 
1068  glTranslatef(0, 0, -znear - 1.0F - trans);
1069 
1070  glRotatef(m_effect_cube_xrot, 1, 0, 0);
1071  glRotatef(m_effect_cube_yrot, 0, 1, 0);
1072 
1073  glBindTexture(GL_TEXTURE_2D, 0);
1074 
1075  glBegin(GL_QUADS);
1076  {
1077  GLfloat const v = 0.999F; // <1 to avoid conflicts along edges
1078 
1079  glColor4f(0, 0, 0, 1);
1080 
1081  /* Front Face */
1082  glVertex3f(-1, -1, v);
1083  glVertex3f( 1, -1, v);
1084  glVertex3f( 1, 1, v);
1085  glVertex3f(-1, 1, v);
1086 
1087  /* Back Face */
1088  glVertex3f(-1, -1, -v);
1089  glVertex3f(-1, 1, -v);
1090  glVertex3f( 1, 1, -v);
1091  glVertex3f( 1, -1, -v);
1092 
1093  /* Top Face */
1094  glVertex3f(-1, v, -1);
1095  glVertex3f(-1, v, 1);
1096  glVertex3f( 1, v, 1);
1097  glVertex3f( 1, v, -1);
1098 
1099  /* Bottom Face */
1100  glVertex3f(-1, -v, -1);
1101  glVertex3f( 1, -v, -1);
1102  glVertex3f( 1, -v, 1);
1103  glVertex3f(-1, -v, 1);
1104 
1105  /* Right face */
1106  glVertex3f(v, -1, -1);
1107  glVertex3f(v, 1, -1);
1108  glVertex3f(v, 1, 1);
1109  glVertex3f(v, -1, 1);
1110 
1111  /* Left Face */
1112  glVertex3f(-v, -1, -1);
1113  glVertex3f(-v, -1, 1);
1114  glVertex3f(-v, 1, 1);
1115  glVertex3f(-v, 1, -1);
1116 
1117  }
1118  glEnd();
1119 
1120  ta.Bind();
1121 
1122  glBegin(GL_QUADS);
1123  {
1124  glColor4d(1, 1, 1, 1);
1125 
1126  // Front Face
1127  glTexCoord2f(0, 0);
1128  glVertex3f(-ta.GetTextureX(), -ta.GetTextureY(), 1);
1129  glTexCoord2f(1, 0);
1130  glVertex3f(+ta.GetTextureX(), -ta.GetTextureY(), 1);
1131  glTexCoord2f(1, 1);
1132  glVertex3f(+ta.GetTextureX(), +ta.GetTextureY(), 1);
1133  glTexCoord2f(0, 1);
1134  glVertex3f(-ta.GetTextureX(), +ta.GetTextureY(), 1);
1135 
1136  // Top Face
1137  glTexCoord2f(1, 1);
1138  glVertex3f(-ta.GetTextureX(), 1, -ta.GetTextureY());
1139  glTexCoord2f(1, 0);
1140  glVertex3f(-ta.GetTextureX(), 1, +ta.GetTextureY());
1141  glTexCoord2f(0, 0);
1142  glVertex3f(+ta.GetTextureX(), 1, +ta.GetTextureY());
1143  glTexCoord2f(0, 1);
1144  glVertex3f(+ta.GetTextureX(), 1, -ta.GetTextureY());
1145 
1146  // Bottom Face
1147  glTexCoord2f(0, 1);
1148  glVertex3f(-ta.GetTextureX(), -1, -ta.GetTextureY());
1149  glTexCoord2f(1, 1);
1150  glVertex3f(+ta.GetTextureX(), -1, -ta.GetTextureY());
1151  glTexCoord2f(1, 0);
1152  glVertex3f(+ta.GetTextureX(), -1, +ta.GetTextureY());
1153  glTexCoord2f(0, 0);
1154  glVertex3f(-ta.GetTextureX(), -1, +ta.GetTextureY());
1155 
1156  // Right face
1157  glTexCoord2f(0, 0);
1158  glVertex3f(1, -ta.GetTextureX(), -ta.GetTextureY());
1159  glTexCoord2f(0, 1);
1160  glVertex3f(1, -ta.GetTextureX(), +ta.GetTextureY());
1161  glTexCoord2f(1, 1);
1162  glVertex3f(1, +ta.GetTextureX(), +ta.GetTextureY());
1163  glTexCoord2f(1, 0);
1164  glVertex3f(1, +ta.GetTextureX(), -ta.GetTextureY());
1165 
1166  // Left Face
1167  glTexCoord2f(1, 0);
1168  glVertex3f(-1, -ta.GetTextureX(), -ta.GetTextureY());
1169  glTexCoord2f(0, 0);
1170  glVertex3f(-1, +ta.GetTextureX(), -ta.GetTextureY());
1171  glTexCoord2f(0, 1);
1172  glVertex3f(-1, +ta.GetTextureX(), +ta.GetTextureY());
1173  glTexCoord2f(1, 1);
1174  glVertex3f(-1, -ta.GetTextureX(), +ta.GetTextureY());
1175  }
1176  glEnd();
1177 
1178  tb.Bind();
1179 
1180  glBegin(GL_QUADS);
1181  {
1182  glColor4d(1, 1, 1, 1);
1183 
1184  // Back Face
1185  glTexCoord2f(1, 0);
1186  glVertex3f(-tb.GetTextureX(), -tb.GetTextureY(), -1);
1187  glTexCoord2f(1, 1);
1188  glVertex3f(-tb.GetTextureX(), +tb.GetTextureY(), -1);
1189  glTexCoord2f(0, 1);
1190  glVertex3f(+tb.GetTextureX(), +tb.GetTextureY(), -1);
1191  glTexCoord2f(0, 0);
1192  glVertex3f(+tb.GetTextureX(), -tb.GetTextureY(), -1);
1193  }
1194  glEnd();
1195 
1196  if (elapsed < rotStart)
1197  ;
1198  else if (elapsed < (tot - rotStart))
1199  {
1200  m_effect_cube_xrot = 360.0F * (elapsed - rotStart) / (tot - 2.0F * rotStart);
1202  }
1203  else
1204  {
1205  m_effect_cube_xrot = 0;
1206  m_effect_cube_yrot = 180.0F;
1207  }
1208 
1210 }
1211 
1213 {
1214 
1215  float single_image_pct = 0.75;
1216  float trans_pct = 1.0F - single_image_pct;
1217  float scale_max, x_loc, y_loc;
1218  float scale_factor = 0;
1219 
1220  //initialize effect
1222  {
1223 
1225  m_effect_kenBurns_item = nullptr;
1226  // Need to load images in the background to keep effect smooth
1228  //Since total image time is longer/different than effect time, create image timers
1230  // Pan image to a random location
1232  // Since first two images are preloaded, hardcode them to zoom in
1236  (m_effect_transition_timeout * trans_pct);
1237  }
1238 
1240  {
1241  // Effect timed out, move new image to old image but don't load new image yet...
1243  m_texCur = (m_texCur) ? 0 : 1;
1246 
1248 
1249  // Find next image to be loaded
1250  int oldpos = m_pos;
1251 
1252  while (true)
1253  {
1256  {
1257  // Skip movies
1259  {
1260  break;
1261  }
1262  }
1263  if (m_pos == oldpos)
1264  {
1265  // No valid items!!!
1266  close();
1267  }
1268  }
1270  }
1271 
1272  float t[2], elapsed[2], s[2], effect_pct;
1274  elapsed[m_texCur ? 0 : 1] = m_effect_kenBurns_image_time[m_texCur ? 0 : 1].elapsed();
1275  //progress linearly
1277  t[m_texCur ? 0 : 1] = elapsed[m_texCur ? 0 : 1] / m_effect_kenBurns_image_timeout;
1278  //progress faster initially then slowing down- this is needed to ensure images zoom faster than they pan and
1279  //therefore stay completely on the screen
1280  s[m_texCur] = sqrt(elapsed[m_texCur]) / sqrt(m_effect_kenBurns_image_timeout);
1281  s[m_texCur ? 0 : 1] = sqrt(elapsed[m_texCur ? 0 : 1]) / sqrt(m_effect_kenBurns_image_timeout);
1282 
1284 
1285  // Load new image if its ready
1286  if (effect_pct > single_image_pct && m_effect_kenBurns_image_ready)
1287  {
1289  {
1290  if (m_effect_kenBurns_item) //Do not create textures for first two images, since they are preloaded
1291  {
1296 
1297  //choose the location and projection (zoom in or out) randomly
1301  1 + (int)((2.0F * random() / (RAND_MAX + 1.0F)));
1302  }
1303  else //No item, must be 1 of the first two preloaded items
1304  {
1305  //start at random location and zoom out to face in center
1308  }
1309 
1312  }
1313  if (m_effect_kenBurns_projection[m_texCur] == 1) // Zoom in image
1314  {
1315  // Start in center and pan out
1318  scale_max = FindMaxScale(x_loc,y_loc);
1319  scale_factor = 1.0F + (scale_max * s[m_texCur]);
1320  }
1321  else // Zoom out image
1322  {
1323  // Start at random location and pan to center
1326  scale_max = FindMaxScale(x_loc,y_loc);
1327  scale_factor = 1.0F + scale_max - (scale_max * t[m_texCur]);
1328  }
1329 
1330  glMatrixMode(GL_MODELVIEW);
1331  glLoadIdentity();
1332  glTranslatef(x_loc, y_loc, 0.0F);
1333 
1334  m_texItem[m_texCur].MakeQuad((effect_pct-single_image_pct)*4, scale_factor);
1335  }
1336 
1337  //Load old picture
1338  if (m_effect_kenBurns_projection[m_texCur ? 0 : 1] == 1)// Zoom in image
1339  {
1340  x_loc = m_effect_kenBurns_location_x[m_texCur ? 0 : 1] * t[m_texCur ? 0 : 1];
1341  y_loc = m_effect_kenBurns_location_y[m_texCur ? 0 : 1] * t[m_texCur ? 0 : 1];
1342  scale_max = FindMaxScale(x_loc,y_loc);
1343  scale_factor = 1.0F + (scale_max * s[m_texCur ? 0 : 1]);
1344  }
1345  else // Zoom out image
1346  {
1347  x_loc = m_effect_kenBurns_location_x[m_texCur ? 0 : 1] -
1348  m_effect_kenBurns_location_x[m_texCur ? 0 : 1] * t[m_texCur ? 0 : 1];
1349  y_loc = m_effect_kenBurns_location_y[m_texCur ? 0 : 1] -
1350  m_effect_kenBurns_location_y[m_texCur ? 0 : 1] * t[m_texCur ? 0 : 1];
1351  scale_max = FindMaxScale(x_loc,y_loc);
1352  scale_factor = 1.0F + scale_max - (scale_max * t[m_texCur ? 0 : 1]);
1353  }
1354 
1355  glMatrixMode(GL_MODELVIEW);
1356  glLoadIdentity();
1357  glTranslatef(x_loc, y_loc, 0.0F);
1358 
1359  if (effect_pct<= single_image_pct)
1360  {
1362  m_texItem[m_texCur ? 0 : 1].MakeQuad(1.0F, scale_factor); //
1363  }
1364  else // Fade out image
1365  {
1366  m_texItem[m_texCur ? 0 : 1].MakeQuad(1.0F - ((effect_pct-single_image_pct)*4), scale_factor);
1367 
1368  }
1369 
1371 }
1372 
1374 {
1375  bool wasMovie = false, isMovie = false;
1376  if (m_effect_method.isEmpty())
1377  {
1378  LOG(VB_GENERAL, LOG_ERR, LOC + "No transition method");
1379  return;
1380  }
1381 
1382  if (m_effect_running)
1383  {
1385  }
1386  else
1387  {
1389  {
1390  // effect was running and is complete now
1391  // run timer while showing current image
1394  }
1395  else
1396  {
1397  // timed out after showing current image
1398  // load next image and start effect
1399 
1400  if (m_slideshow_running)
1401  {
1402  if (m_effect_random)
1404 
1405  DisplayNext(false, false);
1406 
1407  wasMovie = m_movieState > 0;
1408  Load();
1409  isMovie = m_movieState > 0;
1410  // If transitioning to/from a movie, don't do an effect,
1411  // and shorten timeout
1412  if (wasMovie || isMovie)
1413  {
1415  }
1416  else
1417  {
1419  m_effect_running = true;
1421  }
1423  }
1424  m_info_show_short = false;
1425  }
1426  }
1427 
1428  updateGL();
1430  {
1431  m_slideshow_timer->stop();
1432  m_slideshow_timer->setSingleShot(true);
1434 
1435  // If transitioning to/from a movie, no effect is running so
1436  // next timeout should trigger proper immage delay.
1437  if (wasMovie || isMovie)
1438  {
1440  }
1441  }
1442 }
1443 
1445 {
1446  if (m_texInfo)
1447  glDeleteTextures(1, &m_texInfo);
1448 
1450  if (info.isEmpty())
1451  return;
1452 
1453  QPixmap pix(512, 512);
1454 
1455  QPainter p(&pix);
1456  p.initFrom(this);
1457  p.fillRect(0, 0, pix.width(), pix.height(), Qt::black);
1458  p.setPen(Qt::white);
1459 
1460  p.drawText(10, 10, pix.width() - 20, pix.height() - 20,
1461  Qt::AlignLeft, info);
1462  p.end();
1463 
1464  QImage img = pix.toImage();
1465  img = img.convertToFormat(QImage::Format_ARGB32);
1466 
1467  QImage tex = convertToGLFormat(img);
1468 
1469  /* create the texture */
1470  glGenTextures(1, &m_texInfo);
1471  glBindTexture(GL_TEXTURE_2D, m_texInfo);
1472  /* actually generate the texture */
1473  glTexImage2D(GL_TEXTURE_2D, 0, 3, tex.width(), tex.height(), 0,
1474  GL_RGBA, GL_UNSIGNED_BYTE, tex.bits());
1475  /* enable linear filtering */
1476  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1477  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1478 }
1479 
1480 void GLSingleView::LoadImage(QImage image, QSize origSize)
1481 {
1482  m_effect_kenBurns_image = std::move(image);
1484 }
1485 
1486 float GLSingleView::FindMaxScale(float x_loc, float y_loc)
1487 {
1488  // Zoom big enough to keep the entire image on screen when we pan
1489  if (abs(x_loc) > abs(y_loc))
1490  return abs(x_loc) * 2;
1491  return abs(y_loc) * 2;
1492 }
1493 
1494 void GLSingleView::FindRandXY(float &x_loc, float &y_loc)
1495 {
1496  // Random number between .25 and .75
1497  x_loc = (0.5F * random() / (RAND_MAX + 1.0F)) + 0.25F;
1498  if ((int)(2.0F * random() / (RAND_MAX + 1.0F)) == 0)
1499  x_loc = -1 * x_loc;
1500  // Random number between .25 and .75
1501  y_loc = (0.5F * random() / (RAND_MAX + 1.0F)) + 0.25F;
1502  if ((int)(2.0F * random() / (RAND_MAX + 1.0F)) == 0)
1503  y_loc = -1 * y_loc;
1504 }
1505 
1507 {
1508  RunProlog();
1510  if (!item)
1511  {
1512  LOG(VB_GENERAL, LOG_ERR, LOC + QString("No item at current position"));
1513  RunEpilog();
1514  return;
1515  }
1516  QImage image(item->GetPath());
1517  if (image.isNull())
1518  {
1519  RunEpilog();
1520  return;
1521  }
1522 
1523  image = image.scaled(m_texSize, Qt::IgnoreAspectRatio,
1524  Qt::SmoothTransformation);
1525  QImage glimage = QGLWidget::convertToGLFormat(image);
1526 
1527  m_singleView->LoadImage(glimage, glimage.size());
1528  m_singleView->Ready();
1529 
1530  RunEpilog();
1531 }
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
Definition: mthread.cpp:215
QImage m_effect_kenBurns_image
Definition: glsingleview.h:153
GLSingleView(const ThumbList &itemList, int *pos, int slideShow, int sortorder, QWidget *parent)
void start(QThread::Priority=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
Definition: mthread.cpp:294
int restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
void GetScreenShot(QImage &image, const ThumbItem *item)
Definition: imageview.cpp:248
float m_zoom
Definition: imageview.h:99
int m_pos
Definition: imageview.h:96
GLTexture m_texItem[2]
Definition: glsingleview.h:128
struct exc__state * last
Definition: pxsup2dast.c:98
float m_source_x
Definition: glsingleview.h:121
float GetTextureY(void) const
Definition: gltexture.h:62
void SetAngle(int newangle)
Definition: gltexture.h:56
void FindRandXY(float &x_loc, float &y_loc)
void SetItem(ThumbItem *, const QSize &sz)
Definition: gltexture.cpp:98
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
void EffectNone(void)
void DisableScreensaver(void)
float m_source_y
Definition: glsingleview.h:122
bool m_effect_kenBurns_new_image_started
Definition: glsingleview.h:157
void createTexInfo(void)
void SaveSetting(const QString &key, int newValue)
void RegisterEffects(void) override
static void PlayVideo(const QString &filename)
bool m_info_show_short
Definition: imageview.h:102
void keyPressEvent(QKeyEvent *e) override
float m_effect_kenBurns_image_timeout
Definition: glsingleview.h:150
int m_movieState
Definition: imageview.h:98
void EffectCube(void)
int m_slideshow_frame_delay_state
Definition: imageview.h:108
void resizeGL(int w, int h) override
ThumbItem * getCurrentItem() const
Definition: imageview.cpp:292
GLuint m_texInfo
Definition: glsingleview.h:133
void CleanUp(void)
int m_slideshow_frame_delay
Definition: imageview.h:107
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void SetPixmap(QPixmap *pixmap)
Definition: thumbview.cpp:74
void RunEffect(const QString &effect) override
ThumbItem * m_effect_kenBurns_item
Definition: glsingleview.h:155
float GetTextureX(void) const
Definition: gltexture.h:61
QList< ThumbItem * > ThumbList
Definition: thumbview.h:78
void Bind(void)
Definition: gltexture.cpp:58
void UpdateLCD(const ThumbItem *item)
Definition: imageview.cpp:213
static guint32 * tmp
Definition: goom_core.c:35
void EffectInOut(void)
int m_effect_kenBurns_projection[2]
Definition: glsingleview.h:148
bool m_effect_kenBurns_image_ready
Definition: glsingleview.h:152
GLSDialog(const ThumbList &itemList, int *pos, int slideShow, int sortOrder, MythMainWindow *parent, const char *name="GLSDialog")
void SetZoom(float zoom) override
void MakeQuad(float alpha=1.0F, float scale=1.0F)
Definition: gltexture.cpp:66
QString GetDescriptionStatus(void) const
Definition: imageview.cpp:240
void SetTransitionTimeout(int timeout)
void paintTexture(void)
QSize m_effect_kenBurns_orig_image_size
Definition: glsingleview.h:154
QMap< QString, QString > m_effect_map
Definition: imageview.h:116
void closeEvent(QCloseEvent *e) override
static bool IsMovie(const QString &filePath)
void EffectRotate(void)
ThumbItem * retreatItem()
Definition: imageview.cpp:305
KenBurnsImageLoader * m_effect_kenBurns_imageLoadThread
Definition: glsingleview.h:151
int GetAngle(void) const
Definition: gltexture.h:63
int m_effect_current_frame
Definition: imageview.h:114
virtual QString GetRandomEffect(void) const
Definition: imageview.cpp:203
void checkPosition(void)
void EffectKenBurns(void)
#define close
Definition: compat.h:16
bool m_effect_random
Definition: imageview.h:117
void Ready()
Definition: glsingleview.h:70
static bool Delete(const QFileInfo &file)
float m_effect_kenBurns_location_y[2]
Definition: glsingleview.h:147
bool m_effect_kenBurns_initialized
Definition: glsingleview.h:156
void EffectFlutter(void)
QString GetSetting(const QString &key, const QString &defaultval="")
float FindMaxScale(float x_loc, float y_loc)
unsigned char t
Definition: ParseText.cpp:329
void EffectZoomBlend(void)
QString m_effect_method
Definition: imageview.h:115
virtual void accept()
void DisplayNext(bool reset, bool loadImage) override
void SlideTimeout(void)
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
QSize m_screenSize
Definition: imageview.h:93
void initializeGL(void) override
const char * name
Definition: ParseText.cpp:328
QTimer * m_slideshow_timer
Definition: imageview.h:109
void LoadImage(QImage image, QSize origSize)
GLSingleView * m_singleView
Definition: glsingleview.h:171
ScaleMax m_scaleMax
Definition: glsingleview.h:123
MythUIHelper * GetMythUI()
bool m_effect_running
Definition: imageview.h:113
int m_effect_rotate_direction
Definition: glsingleview.h:136
Base dialog for most dialogs in MythTV using the old UI.
Definition: mythdialogs.h:40
ScaleMax
Definition: galleryutil.h:28
MythMainWindow * GetMythMainWindow(void)
int elapsed(void) const
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:90
void Deinit(void)
Delete the texture.
Definition: gltexture.cpp:52
#define M_PI
Definition: goom_tools.h:5
QString GetPath(void) const
Definition: thumbview.h:59
void PauseIdleTimer(bool pause)
void RestoreScreensaver(void)
int GetNumSetting(const QString &key, int defaultval=0)
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
void SetRotationAngle(int angle)
Definition: thumbview.cpp:58
void EffectFade(void)
#define GL_RGBA
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
Definition: mthread.cpp:202
MythTimer m_effect_frame_time
Definition: glsingleview.h:137
void paintGL(void) override
int GetNearestGLTextureSize(int) const
int m_effect_transition_timeout
Definition: glsingleview.h:138
float m_effect_cube_zrot
Definition: glsingleview.h:145
void EffectSlide(void)
QString GetDescription(const QString &status) const
Definition: gltexture.cpp:111
void Rotate(int angle) override
GLSingleView * m_view
Definition: glsingleview.h:57
float m_effect_cube_xrot
Definition: glsingleview.h:143
static long int random(void)
Definition: compat.h:149
#define LOC
void ScaleTo(const QSize &dest, ScaleMax scaleMax)
Definition: gltexture.cpp:87
MythTimer m_effect_kenBurns_image_time[2]
Definition: glsingleview.h:149
ThumbItem * advanceItem()
Definition: imageview.cpp:298
void EffectBlend(void)
void Load(void) override
float m_effect_flutter_points[40][40][3]
Definition: glsingleview.h:142
void SwapWidthHeight(void)
Definition: gltexture.h:46
float m_effect_cube_yrot
Definition: glsingleview.h:144
float m_effect_transition_timeout_inv
Definition: glsingleview.h:139
bool m_slideshow_running
Definition: imageview.h:105
void DisplayPrev(bool reset, bool loadImage) override
float m_effect_kenBurns_location_x[2]
Definition: glsingleview.h:146
void EffectBend(void)
bool m_info_show
Definition: imageview.h:101
void Init(const QImage &image)
Create the texture initialized with QImage.
Definition: gltexture.cpp:34