summaryrefslogtreecommitdiff
path: root/rotord/src
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-01-23 14:03:07 +0000
committerTim Redfern <tim@eclectronics.org>2014-01-23 14:03:07 +0000
commitefebf20348daca798c22cbac770d47e9151f941f (patch)
tree05c1a4148047d89271b2566c8924d872ad023938 /rotord/src
parenta897d2e0ba7744c818eed46441347cfb4f384613 (diff)
NT logging structure
Diffstat (limited to 'rotord/src')
-rw-r--r--rotord/src/cvimage.h6
-rw-r--r--rotord/src/nodes_drawing.h39
2 files changed, 45 insertions, 0 deletions
diff --git a/rotord/src/cvimage.h b/rotord/src/cvimage.h
index 2374e5b..b356f82 100644
--- a/rotord/src/cvimage.h
+++ b/rotord/src/cvimage.h
@@ -82,6 +82,7 @@ namespace Rotor {
};
static pixeltables pixels;
class Image{
+ //transform should be a method of image
public:
Image(){
zero();
@@ -217,6 +218,11 @@ namespace Rotor {
*/
return t;
}
+ void crop(int _w,int _h){ //change borders, crop/ extend
+ if ( _w<w||_h<h){
+
+ }
+ }
Image & operator=(const Image &other);
//believe these still work, don't know if these optimisations are better than opencvs..
Image & operator+=(const Image &other);
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h
index 5a8937f..f4ddbf7 100644
--- a/rotord/src/nodes_drawing.h
+++ b/rotord/src/nodes_drawing.h
@@ -198,6 +198,45 @@ namespace Rotor {
}
private:
};
+ class Mosaic: public Draw_node {
+ //the difficulty here is in keeping the pixels centred
+ //the center of the screen should remain in between pixels
+ //this implies that the
+ public:
+ Mosaic(){
+ title="Mosaic";
+ description="Increases size of pixels";
+ create_image_input("Image to mosaic","Image input");
+ create_parameter("pixels","number","Height of scrren in pixels","Pixels",20.0,0.0,1.0);
+ NODEID="a33a1a6a-8420-11e3-831b-74d02b29f6a6";
+ };
+ Mosaic(map<string,string> &settings):Shape() {
+ base_settings(settings);
+ };
+ ~Mosaic(){};
+ Mosaic* clone(map<string,string> &_settings) { return new Mosaic(_settings);};
+ void vector_output(cairo_t * cr,const Frame_spec &frame){
+ colour=Colour(attributes["colour"]->value);
+ cairo_set_source_rgb(cr, colour.Rdouble(),colour.Gdouble(),colour.Bdouble());
+ switch(attributes["shape"]->intVal) {
+ case SHAPE_square:
+ cairo_rectangle(cr,-frame.w/2,-frame.w/2,frame.w,frame.w);
+ break;
+ case SHAPE_circle:
+ cairo_arc(cr,0,0,frame.w/2,0.0, 2 * M_PI);
+ break;
+ case SHAPE_triangle:
+ //subtracting PI/2 =(1.5*PI)/3 so the triangle is pointing up
+ cairo_line_to(cr,0,-frame.w/2);
+ cairo_line_to(cr,cos((0.5 * M_PI)/3)*frame.w/2,sin((0.5 * M_PI)/3)*frame.w/2);
+ cairo_line_to(cr,cos((2.5 * M_PI)/3)*frame.w/2,sin((2.5 * M_PI)/3)*frame.w/2);
+ cairo_close_path(cr);
+ break;
+ }
+ cairo_fill(cr);
+ }
+ private:
+ };
class Audio_viz: public Draw_node {
public:
Audio_viz(){}