00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GLSINGLEVIEW_H
00023 #define GLSINGLEVIEW_H
00024 #ifdef USING_OPENGL
00025
00026
00027 #include <qgl.h>
00028 #include <qmap.h>
00029 #include <qsize.h>
00030
00031
00032 #include <mythtv/util.h>
00033
00034
00035 #include "imageview.h"
00036 #include "iconview.h"
00037 #include "sequence.h"
00038 #include "gltexture.h"
00039
00040 class QImage;
00041 class QTimer;
00042
00043 class GLSingleView;
00044
00045 class GLSDialog : public MythDialog
00046 {
00047 public:
00048 GLSDialog(const ThumbList& itemList,
00049 int pos, int slideShow, int sortOrder,
00050 MythMainWindow *parent, const char *name=0);
00051
00052 protected:
00053 void closeEvent(QCloseEvent *e);
00054
00055 private:
00056 GLSingleView *m_view;
00057 };
00058
00059 class GLSingleView : public QGLWidget, public ImageView
00060 {
00061 Q_OBJECT
00062
00063 public:
00064 GLSingleView(ThumbList itemList, int pos, int slideShow, int sordorder,
00065 QWidget *parent);
00066 ~GLSingleView();
00067
00068 void CleanUp(void);
00069
00070 protected:
00071 void initializeGL(void);
00072
00073
00074 virtual void Rotate(int angle);
00075 virtual void DisplayNext(bool reset, bool loadImage);
00076 virtual void DisplayPrev(bool reset, bool loadImage);
00077 virtual void Load(void);
00078 void resizeGL(int w, int h);
00079
00080 void paintGL(void);
00081 void paintTexture(void);
00082 void createTexInfo(void);
00083 virtual void keyPressEvent(QKeyEvent *e);
00084 void checkPosition(void);
00085
00086
00087 virtual void SetZoom(float zoom);
00088 void SetTransitionTimeout(int timeout);
00089
00090
00091 int GetNearestGLTextureSize(int) const;
00092
00093 virtual void RegisterEffects(void);
00094 virtual void RunEffect(const QString &effect);
00095
00096 void EffectNone(void);
00097 void EffectBlend(void);
00098 void EffectZoomBlend(void);
00099 void EffectFade(void);
00100 void EffectRotate(void);
00101 void EffectBend(void);
00102 void EffectInOut(void);
00103 void EffectSlide(void);
00104 void EffectFlutter(void);
00105 void EffectCube(void);
00106
00107 private slots:
00108 void SlideTimeout(void);
00109
00110 private:
00111
00112 float m_source_x;
00113 float m_source_y;
00114 bool m_scaleMax;
00115
00116
00117 int m_texMaxDim;
00118 QSize m_texSize;
00119 GLTexture m_texItem[2];
00120 int m_texCur;
00121 bool m_tex1First;
00122
00123
00124 GLuint m_texInfo;
00125
00126
00127 int m_effect_rotate_direction;
00128 MythTimer m_effect_frame_time;
00129 int m_effect_transition_timeout;
00130 float m_effect_transition_timeout_inv;
00131
00132
00133 float m_effect_flutter_points[40][40][3];
00134 float m_effect_cube_xrot;
00135 float m_effect_cube_yrot;
00136 float m_effect_cube_zrot;
00137 };
00138
00139 #endif // USING_OPENGL
00140 #endif // GLSINGLEVIEW_H