2
2
// libavg - Media Playback Engine.
3
// Copyright (C) 2003-2008 Ulrich von Zadow
3
// Copyright (C) 2003-2011 Ulrich von Zadow
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
36
class ImagingProjection;
37
typedef boost::shared_ptr<ImagingProjection> ImagingProjectionPtr;
36
39
class AVG_API GPUFilter: public Filter
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,
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;
51
static void glContextGone();
56
const IntRect& getDestRect() const;
57
const IntPoint& getSrcSize() const;
58
DRect getRelDestRect() const;
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;
70
unsigned m_NumTextures;
60
73
GLTexturePtr m_pSrcTex;
64
static boost::thread_specific_ptr<PBOPtr> s_pFilterKernelPBO;
78
ImagingProjectionPtr m_pProjection;
67
81
typedef boost::shared_ptr<GPUFilter> GPUFilterPtr;