00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _STELVIEWPORTEFFECT_HPP_
00021 #define _STELVIEWPORTEFFECT_HPP_
00022
00023 #include "VecMath.hpp"
00024 #include "StelProjector.hpp"
00025
00026 class QGLFramebufferObject;
00027
00030 class StelViewportEffect
00031 {
00032 public:
00033 StelViewportEffect() {;}
00034 virtual ~StelViewportEffect() {;}
00035 virtual QString getName() {return "framebufferOnly";}
00038 virtual void alterBuffer(QGLFramebufferObject* buf) const {;}
00042 virtual void paintViewportBuffer(const QGLFramebufferObject* buf) const;
00045 virtual void distortXY(float& x, float& y) const {;}
00046 };
00047
00048
00049 class StelViewportDistorterFisheyeToSphericMirror : public StelViewportEffect
00050 {
00051 public:
00052 StelViewportDistorterFisheyeToSphericMirror(int screen_w,int screen_h);
00053 ~StelViewportDistorterFisheyeToSphericMirror();
00054 virtual QString getName() {return "sphericMirrorDistorter";}
00055 virtual void paintViewportBuffer(const QGLFramebufferObject* buf) const;
00056 virtual void distortXY(float& x, float& y) const;
00057 private:
00058 const int screen_w;
00059 const int screen_h;
00060 const StelProjector::StelProjectorParams originalProjectorParams;
00061 StelProjector::StelProjectorParams newProjectorParams;
00062 int viewport_texture_offset[2];
00063 int texture_wh;
00064
00065 Vec2f *texture_point_array;
00066 int max_x,max_y;
00067 double step_x,step_y;
00068
00069 QVector<Vec2f> displayVertexList;
00070 QVector<Vec4f> displayColorList;
00071 QVector<Vec2f> displayTexCoordList;
00072 };
00073
00074 #endif // _STELVIEWPORTEFFECT_HPP_
00075