~ubuntu-branches/ubuntu/trusty/libavg/trusty-proposed

« back to all changes in this revision

Viewing changes to src/graphics/GPUFilter.h

  • Committer: Package Import Robot
  • Author(s): OXullo Intersecans
  • Date: 2011-12-06 22:44:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111206224456-qc7250z3ya1vi8s9
Tags: 1.7.0-0ubuntu1
* New upstream release (LP: #899183)
* Remove patches 0002-libav-0.7.patch, 0003-fglrx-segfault-on-startup.patch
  now merged to upstream
* Remove unnecessary .la files
* Update debian/watch file
* Fix debian/copyright dep-5 compliancy
* Update standards to version 3.9.2
* Add man pages for avg_checktouch, avg_checkvsync, avg_showsvg
* Minor debian/rules enhancement
* Add librsvg2-dev, libgdk-pixbuf2.0-dev to Build-Depends
* Proper transition to dh_python2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
//  libavg - Media Playback Engine. 
3
 
//  Copyright (C) 2003-2008 Ulrich von Zadow
 
3
//  Copyright (C) 2003-2011 Ulrich von Zadow
4
4
//
5
5
//  This library is free software; you can redistribute it and/or
6
6
//  modify it under the terms of the GNU Lesser General Public
33
33
 
34
34
namespace avg {
35
35
 
 
36
class ImagingProjection;
 
37
typedef boost::shared_ptr<ImagingProjection> ImagingProjectionPtr;
 
38
 
36
39
class AVG_API GPUFilter: public Filter
37
40
{
38
41
public:
39
 
    GPUFilter(const IntPoint& size, PixelFormat pfSrc, PixelFormat pfDest, 
40
 
            bool bStandalone, unsigned numTextures=1);
 
42
    GPUFilter(PixelFormat pfSrc, PixelFormat pfDest, bool bStandalone,
 
43
            unsigned numTextures=1, bool bMipmap=false);
41
44
    virtual ~GPUFilter();
 
45
    void setDimensions(const IntPoint& srcSize);
 
46
    void setDimensions(const IntPoint& srcSize, const IntRect& destRect,
 
47
            unsigned texMode);
42
48
 
43
49
    virtual BitmapPtr apply(BitmapPtr pBmpSource);
44
50
    virtual void apply(GLTexturePtr pSrcTex);
45
51
    virtual void applyOnGPU(GLTexturePtr pSrcTex) = 0;
46
52
    GLTexturePtr getDestTex(int i=0) const;
47
53
    BitmapPtr getImage() const;
48
 
 
49
54
    FBOPtr getFBO();
50
55
 
51
 
    static void glContextGone();
52
 
 
 
56
    const IntRect& getDestRect() const;
 
57
    const IntPoint& getSrcSize() const;
 
58
    DRect getRelDestRect() const;
 
59
    
53
60
protected:
54
61
    void draw(GLTexturePtr pTex);
55
 
    const IntPoint& getSize() const;
56
62
    const std::string& getStdShaderCode() const;
57
 
    GLTexturePtr calcBlurKernelTex(double stdDev, double opacity=-1) const;
 
63
    int getBlurKernelRadius(double stdDev) const;
 
64
    GLTexturePtr calcBlurKernelTex(double stdDev, double opacity=1) const;
58
65
 
59
66
private:
 
67
    PixelFormat m_PFSrc;
 
68
    PixelFormat m_PFDest;
 
69
    bool m_bStandalone;
 
70
    unsigned m_NumTextures;
 
71
    bool m_bMipmap;
 
72
 
60
73
    GLTexturePtr m_pSrcTex;
61
74
    PBOPtr m_pSrcPBO;
62
75
    FBOPtr m_pFBO;
63
 
 
64
 
    static boost::thread_specific_ptr<PBOPtr> s_pFilterKernelPBO;
 
76
    IntPoint m_SrcSize;
 
77
    IntRect m_DestRect;
 
78
    ImagingProjectionPtr m_pProjection;
65
79
};
66
80
 
67
81
typedef boost::shared_ptr<GPUFilter> GPUFilterPtr;