From 74be885fc585d3865116e353ac13de94a5d688c7 Mon Sep 17 00:00:00 2001 From: tim Date: Sat, 25 Mar 2017 01:11:08 +0000 Subject: add ec2 --- freemium.pem | 23 +++++++++++ menuApp/addons.make | 1 + menuApp/src/ofApp.cpp | 109 +++++++------------------------------------------- menuApp/src/ofApp.h | 4 ++ notes | 3 +- 5 files changed, 44 insertions(+), 96 deletions(-) create mode 100644 freemium.pem diff --git a/freemium.pem b/freemium.pem new file mode 100644 index 0000000..49057e8 --- /dev/null +++ b/freemium.pem @@ -0,0 +1,23 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAnH/nHK4i2OTUfzP22GCcfeXtNPwS9jDWccSR2YO908mgmKd+aMOhx9fVUByi +xlOsJpd27jtfjGk7LHyEXE5EREto1GBB3w1yKtIh44NuVLVKD5vQXTVYWn0xGzutubU9LUVuZL8o +CHNoVvfIqf5G2ZmGdPeQSa9EO7+tF2b9gGc+5A3SkDYbsOksCTB4O5NUYhATV77PCurxSJ9mq+0o +8HBU8ea2i+uHUrCU8xXXuK7rU2n8GQnwRkgsKBMM2ZMO74F8Cw4buarNPctBhaes4wST7kiZkQtp +kcS0Tq65GN6eHeDuZ0HlMsIEw11bVdruQWTVf70ohsmFlSra2knBewIDAQABAoIBADuHh4DoWEcK +nC4atR3PeheFu3o5HHlbUGcML7J+o1mJS7Zll/b/220qE3Eaw2wPbd9sJAgwu4KskJ62ap62As+7 +o4+NYeEXu0LAlbV2TCSapSZUzah23znkfyZtyAJpB3FOBNT7xZ2ZUKosLL9FAuxIstWRSehNa/YS +TiQlv+30PBq+Ywc0yukEL9jX3lqlEG/O8EneIyBCZ9lROCbT45PF2RH9o2jKZedUzBlFOWnZYbGm +1YjPtiSLpT+/1bPkBV4Gbv7tG+gij/G9vGfKpduzXl73vxf5whjuVr7lacd8l1snFu+Km4Zh6Soj +234LcpTAJhLRsCcFgT79vGqnAeECgYEA+MneLIzgGPsuxw2r2wHPqCCDGe+1KGBpm534D/yzLe5D +pQ2D4lUwpTWI9Mwp4HxSccP91U2nYa7ogcCBha6mKu8GAFeofcviTHUz3iM8NfgCra0koXpqyvLP +bGHcfeT7qsN43K1gI12UU8WkRE34rQFdtEejHe3trc8vsRzXqmsCgYEAoQk0xm/cwujWNGtXhS4l +R8tMIj0T0UyuQDeY5TWwxSExfqHykpbkd1vCOTP109ESM+I1ARRYSc5I+7DzeHxPsqh3pxBSUAZC +lQK9GFedtxN/FG5yZOH9PIh21Gzlh8VGB3PZU7Lx0URzX09FLOe2DMsN+Ih127iqd0oat0vlKTEC +gYEA9wbyDMhAh215D/qaJpaQyv6lTi5+cT3x/quGsNEYVMXc8tkNl8FA0PnsKC1Ec3reHcoekxpM +1ahngtZThRpaMg0tp09ipK254HMLckkIMwo0FqDx20iDG0qm/JXa6kJgRTlcG7om2FbFvbxkE9Jb +1eSiVyw+YaxqsIclcrYRyksCgYEAhQ5cQtHOsGU+CBXhPLOCLi31/BxHMZqQJ5NIi6qvIlJo2N7q +1OBEabKxah5ased/iMsRTJEI2gLOHth4c0cTeuTj6G/98w0ZGpImt+Q89jXvvGv9rQlk+g0vUhmg +FWyUjjfUi+nBEE3kng2bdJ0HuM5V/tKRvzh38RSTunvFHyECgYEA4co18EhSvvM8qvME6F8TbMRb +BX/fcEhwHdyFFh9gWAQL9rX4tjYBMOBax+12woMJZH48LaLAXepjNij7UtztFHHRLC+C4BEWPZHA +l6C08/uSO4yi4u0ZbOjpFfGlYfyhJtyvqrH2cFe1QkKoh85H4VqcsSLUG+yPqNofE8K9cqg= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/menuApp/addons.make b/menuApp/addons.make index 5aa4842..3ce7b92 100644 --- a/menuApp/addons.make +++ b/menuApp/addons.make @@ -1,3 +1,4 @@ ofxInstagram ofxJSON ofxThreadedImageLoader +ofxTextSuite diff --git a/menuApp/src/ofApp.cpp b/menuApp/src/ofApp.cpp index b1da2ff..d65e7e2 100644 --- a/menuApp/src/ofApp.cpp +++ b/menuApp/src/ofApp.cpp @@ -14,6 +14,7 @@ void ofApp::loadimages(){ { for ( int i = 0; i < min(IMAGE_SLOTS,(int)instagram.getImageURL().size()); i++) { + //if (instagram.getImageURL()!=) getImages.loadFromURL(images[i], instagram.getImageURL()[i]); ofLog(OF_LOG_NOTICE) << instagram.getImageURL()[i]; //images[i].load("images/"+ofToString(i)+".jpg"); @@ -35,31 +36,12 @@ void ofApp::loadimages(){ void ofApp::setup(){ - ofTrueTypeFont::setGlobalDpi(180); - - type14.load("American Typewriter Regular.ttf", 14*FACTOR, true, true); - type14.setLineHeight(18.0f*FACTOR); - type14.setLetterSpacing(1.037*FACTOR); - - /* - bikers.load("images/bikers.jpg"); - gears.load("images/gears.gif"); - tdf.load("images/tdf_1972_poster.jpg"); - - tdfSmall.load("images/tdf_1972_poster.jpg"); - tdfSmall.resize(tdfSmall.getWidth() / 4, tdfSmall.getHeight() / 4); - tdfSmall.setImageType(OF_IMAGE_GRAYSCALE); - - transparency.load("images/transparency.png"); - bikeIcon.load("images/bike_icon.png"); - bikeIcon.setImageType(OF_IMAGE_GRAYSCALE); - */ - + ofTrueTypeFont::setGlobalDpi(150); + myText.init("American Typewriter Regular.ttf", 14*FACTOR, 'i'); background.load("images/background1080.png"); overlay.load("images/overlay1080.png"); - //overlay.setImageType(OF_IMAGE_GRAYSCALE); instagram.setup(hangdaitoken,"self"); instagram.setCertFileLocation(ofToDataPath("ca-bundle.crt",false)); @@ -78,6 +60,7 @@ void ofApp::setup(){ */ //load + ofSetFrameRate(5); } //-------------------------------------------------------------- @@ -88,23 +71,13 @@ void ofApp::update(){ //-------------------------------------------------------------- void ofApp::draw(){ - ofSetColor(255); + ofSetColor(255,255,255); ofPushMatrix(); //Store the coordinate system nexessary for some reason background.draw(0,0,ofGetWidth(),ofGetHeight()); ofPopMatrix(); //Restore the coordinate system - //ofLog(OF_LOG_NOTICE,"background is %fx%f",background.getWidth(),background.getHeight()); -/* - int rowinitialoffset=40; - int colinitialoffset=60; - int rowoffset=520; - int imgsize=480; - int coloffset=603; - int col=0; - int row=0; - int rows=2; -*/ + int colinitialoffset=40; int rowinitialoffset=60; int coloffset=520; @@ -113,9 +86,11 @@ ofPopMatrix(); //Restore the coordinate system int col=0; int row=0; int cols=2; - int textcolinset=40; + int textcolinset=20; int textrowinset=50; + + //some kind of rendering bug with textsuite means it has to go last or everything is dim if (!images.empty()) { for (int i = 0; i < images.size(); i++) { @@ -126,21 +101,11 @@ ofPopMatrix(); //Restore the coordinate system int imgy=(rowinitialoffset+(row*rowoffset))*FACTOR; images[i].draw(imgx,imgy,imgsize*FACTOR,imgsize*FACTOR); std::string caption=instagram.getImageCaption()[i]; - int captionend = caption.find("#"); - if (captionend == std::string::npos){ - captionend=caption.size(); - } - float width=type14.stringWidth(caption.substr(0,captionend)); - ofLog(OF_LOG_NOTICE) << caption.substr(0,captionend) << " <<<<:width: " << width; + myText.setText(caption); + myText.wrapTextX(imgsize*FACTOR); + myText.setColor(255,255,255,255); + myText.drawCenter(imgx+((imgsize*FACTOR)/2),imgy+((imgsize+textcolinset)*FACTOR),2); - vector captions = ofSplitString(caption.substr(0,captionend), " "); - - if (width