diff options
Diffstat (limited to 'gui/src/chainImage.h')
| -rw-r--r-- | gui/src/chainImage.h | 20 |
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; |
