3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "threads/CriticalSection.h"
23 #include "guilib/gui3d.h"
24 #include "utils/StdString.h"
25 #include "guilib/DirtyRegion.h"
27 typedef uint32_t color_t;
34 enum DISPLAY_EFFECT { EFFECT_NONE = 0, EFFECT_FLOAT, EFFECT_ZOOM, EFFECT_RANDOM, EFFECT_PANORAMA, EFFECT_NO_TIMEOUT };
35 enum TRANSISTION_EFFECT { TRANSISTION_NONE = 0, FADEIN_FADEOUT, CROSSFADE, TRANSISTION_ZOOM, TRANSISTION_ROTATE };
39 TRANSISTION_EFFECT type;
47 void SetTexture(int iSlideNumber, CBaseTexture* pTexture, DISPLAY_EFFECT dispEffect = EFFECT_RANDOM, TRANSISTION_EFFECT transEffect = FADEIN_FADEOUT);
48 void UpdateTexture(CBaseTexture* pTexture);
50 bool IsLoaded() const { return m_bIsLoaded;};
51 void UnLoad() {m_bIsLoaded = false;};
52 void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
55 bool IsFinished() const { return m_bIsFinished;};
56 bool DrawNextImage() const { return m_bDrawNextImage;};
58 int GetWidth() const { return (int)m_fWidth;};
59 int GetHeight() const { return (int)m_fHeight;};
62 bool StartTransistion();
63 int GetTransistionTime(int iType) const;
64 void SetTransistionTime(int iType, int iTime);
66 int SlideNumber() const { return m_iSlideNumber;};
68 void Zoom(float fZoomAmount, bool immediate = false);
69 void Rotate(float fRotateAngle, bool immediate = false);
70 void Pause(bool bPause);
71 void SetInSlideshow(bool slideshow);
72 void SetOriginalSize(int iOriginalWidth, int iOriginalHeight, bool bFullSize);
73 bool FullSize() const { return m_bFullSize;};
74 int GetOriginalWidth();
75 int GetOriginalHeight();
77 void Move(float dX, float dY);
78 float GetZoom() const { return m_fZoomAmount;};
81 bool m_bCanMoveHorizontally;
83 void UpdateVertices(float cur_x[4], float cur_y[4], const float new_x[4], const float new_y[4], CDirtyRegionList &dirtyregions);
84 void Render(float *x, float *y, CBaseTexture* pTexture, color_t color);
85 CBaseTexture *m_pImage;
88 int m_iOriginalHeight;
92 bool m_bDrawNextImage;
94 CStdString m_strFileName;
98 // stuff relative to middle position
108 float m_ax[4], m_ay[4];
109 float m_sx[4], m_sy[4];
110 float m_bx[4], m_by[4];
111 float m_ox[4], m_oy[4];
113 // transistion and display effects
114 DISPLAY_EFFECT m_displayEffect;
115 TRANSISTION m_transistionStart;
116 TRANSISTION m_transistionEnd;
117 TRANSISTION m_transistionTemp; // used for rotations + zooms
118 float m_fAngle; // angle (between 0 and 2pi to display the image)
119 float m_fTransistionAngle;
120 float m_fTransistionZoom;
126 bool m_bTransistionImmediately;
128 CCriticalSection m_textureAccess;