diff options
Diffstat (limited to 'gui/src/chainImage.h')
| -rw-r--r-- | gui/src/chainImage.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gui/src/chainImage.h b/gui/src/chainImage.h index ac78bd3..6fa5bca 100644 --- a/gui/src/chainImage.h +++ b/gui/src/chainImage.h @@ -1,6 +1,7 @@ #pragma once #include "ofMain.h" +#include "ofxJSON.h" #define THUMB_BORDER_RATIO 0.8 @@ -17,7 +18,15 @@ class chainImage : public ofImage{ void start(); bool load(std::string _filename){ filename=_filename; - return ofImage::load(filename); + if (ofImage::load(filename)){ + makeThumbnail(); + + //could there be a way to load without committing the texture + setUseTexture(false); + return true; + } + + return false; } bool update(float decayRatio); @@ -29,17 +38,23 @@ class chainImage : public ofImage{ ofImage thumbnail; void makeThumbnail(); + Json::Value toJson(); + bool fromJson(Json::Value json); + chainImage *link; + ofPoint linkPos; float linkScale; float linkRot; + std::string filename; + float transition; float fadeIn; float speed; float time; float scale; - std::string filename; + }; @@ -56,8 +71,8 @@ class chainImageSet{ void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); - saveJson(std::string filename); - loadJson(std::string filename); + bool saveJson(std::string filename); + bool loadJson(std::string filename); std::list <chainImage> images; float currentDefaultImageRatio; |
