summaryrefslogtreecommitdiff
path: root/gui/src/chainImage.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2017-08-30 01:31:57 +0100
committerTim Redfern <tim@getdrop.com>2017-08-30 01:31:57 +0100
commit52f12dfc10edfc4dd063b610f65dd2e901d3080c (patch)
tree93fb5618c6776b077251013da65e0ccea5c39d40 /gui/src/chainImage.h
parent603d1a2a94a1263a85c353997eb3276d120d0822 (diff)
load save
Diffstat (limited to 'gui/src/chainImage.h')
-rw-r--r--gui/src/chainImage.h23
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;