summaryrefslogtreecommitdiff
path: root/rotord/src/graph.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/graph.h')
-rw-r--r--rotord/src/graph.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/rotord/src/graph.h b/rotord/src/graph.h
index b2132b9..6ade53e 100644
--- a/rotord/src/graph.h
+++ b/rotord/src/graph.h
@@ -1,6 +1,8 @@
#ifndef GRAPH_H
#define GRAPH_H
+#include "Poco/StringTokenizer.h"
+
#include "rotor.h"
#include "nodes_audio_analysis.h"
@@ -31,7 +33,7 @@ namespace Rotor {
for (auto n: nodes) {
delete n.second;
}
- nodes.clear();
+ nodes.clear();
}
string uid; //every version of a graph has a UUID, no particular need to actually read its data(?)
//?? is it faster than using strings??
@@ -64,5 +66,22 @@ namespace Rotor {
int outW,outH;
};
+ class Thumbnailer{
+ public:
+ bool make(const string &inputfilename,int w,int h,const string &outputfilename) {
+ if (player.open(inputfilename)){
+ if (player.fetchFrame(w,h,player.getNumberOfFrames()/4)) {
+ Image i;
+ i.setup_fromRGB(w,h,player.frame->Data[0],player.frame->Linesize[0]-(w*3));
+ cv::imwrite(outputfilename.c_str(),i.rgb);
+ return true;
+
+ }
+ }
+ return false;
+ }
+ private:
+ libav::ffms2_decoder player;
+ };
}
#endif