From 6ef14b732971507794ceda70b8a067b874098b9c Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 24 Jan 2014 10:42:38 +0000 Subject: clamp mosaic pixels --- rotord/src/nodes_drawing.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h index f428fd8..0f8eb76 100644 --- a/rotord/src/nodes_drawing.h +++ b/rotord/src/nodes_drawing.h @@ -215,26 +215,29 @@ namespace Rotor { ~Mosaic(){}; Mosaic* clone(map &_settings) { return new Mosaic(_settings);}; void vector_output(cairo_t * cr,const Frame_spec &frame){ - double vpix=min((double)frame.h,max(parameters["pixels"]->value,1.0)); + double vpix=max(parameters["pixels"]->value,1.0); double pixel_size=frame.h/vpix; int h_padded=ceil(vpix/2)*2; int w_padded=ceil((((vpix/frame.h)*frame.w))/2)*2; Image *in1=image_inputs[0]->get(frame); if (in1){ - Image in=*(in1); - in.crop(w_padded*pixel_size,h_padded*pixel_size); - in.resize(w_padded,h_padded); - cairo_translate(cr,-((w_padded*pixel_size)/2),-((h_padded*pixel_size)/2)); - for (int i=0;i