#pragma once #include "ofMain.h" #define THUMB_BORDER_RATIO 0.8 class chainImage : public ofImage{ //todo: threaded image loader public: chainImage(){ link=NULL; ofImage(); } void init(ofPoint _linkPos,float _linkScale,float _linkRot); void start(); bool load(std::string _filename){ filename=_filename; return ofImage::load(filename); } bool update(float decayRatio); ofVec3f getTransform(); float getScale(); void drawChain(float fadeIn); ofImage thumbnail; void makeThumbnail(); chainImage *link; ofPoint linkPos; float linkScale; float linkRot; float transition; float fadeIn; float speed; float time; float scale; std::string filename; }; class chainImageSet{ public: chainImageSet(){ currentDefaultImageRatio=0.3; filename=""; } void drawGui(); bool add(std::string filename,glm::vec2 pos); void keyPressed(ofKeyEventArgs &keyargs); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); saveJson(std::string filename); loadJson(std::string filename); std::list images; float currentDefaultImageRatio; std::list::iterator selected; ofPoint clickPoint; ofPoint dragPoint; float dragScale; float dragRotate; std::string filename; };