summaryrefslogtreecommitdiff
path: root/gui/src/chainImage.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-09-10 23:24:49 +0100
committerTim Redfern <tim@getdrop.com>2018-09-10 23:24:49 +0100
commita0b504d11542097843db77653d3e26516a892593 (patch)
tree5bec9beb2a84a831059ada24c5523f27193ee8e2 /gui/src/chainImage.h
parentfa5fc1eeaf7925024575f7154be1684534a62071 (diff)
lut blend
Diffstat (limited to 'gui/src/chainImage.h')
-rw-r--r--gui/src/chainImage.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/gui/src/chainImage.h b/gui/src/chainImage.h
index 30ea55a..3763aab 100644
--- a/gui/src/chainImage.h
+++ b/gui/src/chainImage.h
@@ -3,7 +3,7 @@
#include "ofMain.h"
#include "ofxJSON.h"
#include "ofxEasing.h"
-#include "ofxGpuLut.h"
+#include "ofxGpuLutBlend.h"
#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))
@@ -47,7 +47,7 @@ class chainImage : public ofImage{
filename=_filename;
if (ofImage::load(filename)){
makeThumbnail();
-
+ //setImageType(OF_IMAGE_COLOR_ALPHA);
//could there be a way to load without committing the texture
//setUseTexture(false);
setAnchorPoint(getWidth()/2,getHeight()/2);
@@ -59,6 +59,20 @@ class chainImage : public ofImage{
return false;
}
+ void setAlpha(uint8_t a){
+ if (isAllocated()){
+ ofPixelsRef pixels = getPixels();
+ //uint8_t *im=(uint8_t *)&getPixels();
+ for (int i=0;i<getWidth()*getHeight();i++){
+ pixels[i]|=a;
+ }
+ }
+ }
+
+ void setAlpha(float a){
+ setAlpha((uint8_t)(a*255.0f));
+ }
+
int updateOutput(float decayRatio);
ofVec3f getTransform();
float getScale();
@@ -111,7 +125,7 @@ class chainImage : public ofImage{
bool isLoaded;
ofShader shader;
- ofxGpuLut lut;
+ ofxGpuLutBlend lut;
//int totalframes,framecount;