summaryrefslogtreecommitdiff
path: root/src/viewport.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/viewport.h')
-rwxr-xr-xsrc/viewport.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/viewport.h b/src/viewport.h
index 9d2b72c..7ab1477 100755
--- a/src/viewport.h
+++ b/src/viewport.h
@@ -2,6 +2,7 @@
#define VIEWPORT_H
#include "ofMain.h"
+#include "ofxXmlSettings.h"
class vpcontrol {
public:
@@ -12,11 +13,27 @@ class vpcontrol {
yshift=0;
fscale=1.0f;
}
+ void loadpalette(string &filename){
+ ofxXmlSettings XML;
+ if( !XML.loadFile(filename) ){
+ printf("unable to load palette file\n");
+ }else{
+ palette.clear();
+ palettename=XML.getAttribute("palette","name","",0);
+ if(XML.pushTag("palette")) {
+ int numCols=XML.getNumTags("colour");
+ for (int i=0;i<numCols;i++) {
+ palette.push_back(ofColor.fromHex(ofFromHex(XML.getAttribute("colour","hex",0x00,0))));
+ }
+ }
+ }
+ }
bool fillgrey;
float fillgreyfreq;
int xshift,yshift;
float fscale,scale;
-
+ vector<ofColor> palette;
+ string palettename;
};
class viewport