From ca22cb2d85cb1136840e692e0c708df562885fe2 Mon Sep 17 00:00:00 2001 From: Darren Mothersele Date: Mon, 15 Sep 2014 20:01:29 +0100 Subject: [PATCH 1/3] adding getter/setter for resolution in pixelate effect --- src/PixelatePass.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PixelatePass.h b/src/PixelatePass.h index 87f2865..bce262a 100644 --- a/src/PixelatePass.h +++ b/src/PixelatePass.h @@ -43,7 +43,11 @@ namespace itg PixelatePass(const ofVec2f& aspect, bool arb, const ofVec2f& resolution = ofVec2f(100.f, 100.f)); void render(ofFbo& readFbo, ofFbo& writeFbo); - + + ofVec2f getResolution() const { return resolution; } + void setResolution(ofVec2f) { this->resolution = resolution; } + void setResolution(float _w, float _h) { this->resolution = ofVec2f(_w, _h); } + private: ofShader shader; ofVec2f resolution; From 1fe386963dfc31dbb7a606b6dee7b4f116fd69e4 Mon Sep 17 00:00:00 2001 From: Darren Mothersele Date: Mon, 15 Sep 2014 20:06:53 +0100 Subject: [PATCH 2/3] add setters for width/height --- src/PostProcessing.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PostProcessing.h b/src/PostProcessing.h index 8c62f04..80b380b 100644 --- a/src/PostProcessing.h +++ b/src/PostProcessing.h @@ -51,7 +51,9 @@ namespace itg void draw(float x, float y, float w, float h); float getWidth() { return width; } float getHeight() { return height; } - + void setWidth(float _w) { width = _w; } + void setHeight(float _h) { height = _h; } + void debugDraw(); template From c6824283767ce140dc96ef4f372aacbf160788c3 Mon Sep 17 00:00:00 2001 From: Darren Mothersele Date: Thu, 18 Sep 2014 16:34:21 +0100 Subject: [PATCH 3/3] add setter for bloom/convolution params --- .../xcshareddata/xcschemes/example Release.xcscheme | 9 +++++---- src/BloomPass.h | 5 +++++ src/ConvolutionPass.h | 7 ++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/example/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme b/example/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme index 3662c48..020d193 100644 --- a/example/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme +++ b/example/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme @@ -22,8 +22,8 @@ @@ -39,11 +39,12 @@ diff --git a/src/BloomPass.h b/src/BloomPass.h index 59816e8..046a3f8 100644 --- a/src/BloomPass.h +++ b/src/BloomPass.h @@ -48,6 +48,11 @@ namespace itg void allocateSelectiveGlow(unsigned w, unsigned h); void beginSelectiveGlow(bool clear = true); void endSelectiveGlow(); + + void setIncrements(float _x1, float _y1, float _x2, float _y2) { + xConv->setIncrement(_x1, _y1); + yConv->setIncrement(_x2, _y2); + } void debugDraw(); diff --git a/src/ConvolutionPass.h b/src/ConvolutionPass.h index d56ee3e..49ab5d7 100644 --- a/src/ConvolutionPass.h +++ b/src/ConvolutionPass.h @@ -47,7 +47,12 @@ namespace itg typedef shared_ptr Ptr; ConvolutionPass(const ofVec2f& aspect, bool arb, const ofVec2f& imageIncrement = ofVec2f(0.001953125, 0), float sigma = 4, unsigned kernelSize = 25); - + + void setIncrement(float _x, float _y) { + imageIncrement.x = _x; + imageIncrement.y = _y; + } + void render(ofFbo& readFbo, ofFbo& writeFbo); bool hasArbShader() { return true; }