summaryrefslogtreecommitdiff
path: root/rotord/src/nodes_drawing.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/nodes_drawing.h')
-rw-r--r--rotord/src/nodes_drawing.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h
index db1d934..370c0fb 100644
--- a/rotord/src/nodes_drawing.h
+++ b/rotord/src/nodes_drawing.h
@@ -9,6 +9,7 @@ namespace Rotor {
public:
Draw_node(){
create_image_input("image input","Image input");
+ create_attribute("colour","Colour to fill","Colour","FFFFFF");
//no title or description as it isn't intended for the user
};
Draw_node(map<string,string> &settings):Draw_node() {
@@ -39,7 +40,10 @@ namespace Rotor {
cairo_surface_destroy(cs);
return &image;
}
+ protected:
+ Colour colour;
private:
+
};
class Text: public Draw_node {
public:
@@ -51,6 +55,7 @@ namespace Rotor {
};
Text(map<string,string> &settings):Text() {
base_settings(settings);
+ colour=Colour(attributes["colour"]->value);
};
~Text(){};
Text* clone(map<string,string> &_settings) { return new Text(_settings);};
@@ -61,7 +66,7 @@ namespace Rotor {
}
else text=attributes["text"]->value;
cairo_text_extents_t te;
- cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ cairo_set_source_rgb(cr, colour.Rfloat(),colour.Gfloat(),colour.Bfloat());
cairo_select_font_face (cr, "Georgia",
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 120);
@@ -84,7 +89,6 @@ namespace Rotor {
create_parameter("y","number","Y coordinate","Y",0.0f);
create_parameter("scale","number","Scale","Scale",1.0f);
create_parameter("rotation","number","Rotation","Rotation",0.0f);
- create_attribute("colour","Colour to fill","Colour","FFFFFF");
create_attribute("shape","Shape to draw","Shape","square",{"circle","square","triangle"});
};
Shape(map<string,string> &settings):Shape() {
@@ -119,7 +123,6 @@ namespace Rotor {
cairo_fill(cr);
}
private:
- Colour colour;
};
class Audio_viz: public Draw_node {
public: