#pragma once #include "ofMain.h" #include "ofxJSON.h" #include "ofxEasing.h" #include "ofxGpuRemapBlend.h" #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) #define THUMB_BORDER_RATIO 0.8 #define THUMB_SIZE 160 #define DEFAULT_FADEIN 1.0 #define BEZIER_OUT 0.25 #define BEZIER_IN 0.25 #define ROTATION_BEZIER_FRACTION 0.0 #define ROTATION_EASE_POWER 4.0 #define SWITCH_NONE 0 #define SWITCH_FORWARD 1 #define SWITCH_REVERSE 2 //#define GPU_ALGORITHM //so annoying 1: menubar //so annoying 2: dialogue stops screen template int sgn(T val) { return (T(0) < val) - (val < T(0)); } class chainImage : public ofImage{ public: chainImage(){ link=NULL; ofImage(); isLoaded=false; colour=ofColor(255,255,255); } void init(ofPoint _linkPos,float _linkScale,float _linkRot); void start(bool reverse=false); bool tload(std::string _filename){ printf("tload : %s\n",_filename.c_str()); 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); isLoaded=true; return true; } else printf("could not load : %s\n",_filename.c_str()); return false; } void setAlpha(uint8_t a){ if (isAllocated()){ ofPixelsRef pixels = getPixels(); //uint8_t *im=(uint8_t *)&getPixels(); for (int i=0;i