Lines Matching refs:RNG
26 static Scalar randomColor( RNG& rng );
27 int Drawing_Random_Lines( Mat image, char* window_name, RNG rng );
28 int Drawing_Random_Rectangles( Mat image, char* window_name, RNG rng );
29 int Drawing_Random_Ellipses( Mat image, char* window_name, RNG rng );
30 int Drawing_Random_Polylines( Mat image, char* window_name, RNG rng );
31 int Drawing_Random_Filled_Polygons( Mat image, char* window_name, RNG rng );
32 int Drawing_Random_Circles( Mat image, char* window_name, RNG rng );
33 int Displaying_Random_Text( Mat image, char* window_name, RNG rng );
34 int Displaying_Big_End( Mat image, char* window_name, RNG rng );
47 /// Also create a random object (RNG)
48 RNG rng( 0xFFFFFFFF );
57 c = Drawing_Random_Lines(image, window_name, rng);
61 c = Drawing_Random_Rectangles(image, window_name, rng);
65 c = Drawing_Random_Ellipses( image, window_name, rng );
69 c = Drawing_Random_Polylines( image, window_name, rng );
73 c = Drawing_Random_Filled_Polygons( image, window_name, rng );
77 c = Drawing_Random_Circles( image, window_name, rng );
81 c = Displaying_Random_Text( image, window_name, rng );
85 c = Displaying_Big_End( image, window_name, rng );
98 static Scalar randomColor( RNG& rng )
100 int icolor = (unsigned) rng;
108 int Drawing_Random_Lines( Mat image, char* window_name, RNG rng )
114 pt1.x = rng.uniform( x_1, x_2 );
115 pt1.y = rng.uniform( y_1, y_2 );
116 pt2.x = rng.uniform( x_1, x_2 );
117 pt2.y = rng.uniform( y_1, y_2 );
119 line( image, pt1, pt2, randomColor(rng), rng.uniform(1, 10), 8 );
131 int Drawing_Random_Rectangles( Mat image, char* window_name, RNG rng )
135 int thickness = rng.uniform( -3, 10 );
139 pt1.x = rng.uniform( x_1, x_2 );
140 pt1.y = rng.uniform( y_1, y_2 );
141 pt2.x = rng.uniform( x_1, x_2 );
142 pt2.y = rng.uniform( y_1, y_2 );
144 rectangle( image, pt1, pt2, randomColor(rng), MAX( thickness, -1 ), lineType );
157 int Drawing_Random_Ellipses( Mat image, char* window_name, RNG rng )
164 center.x = rng.uniform(x_1, x_2);
165 center.y = rng.uniform(y_1, y_2);
168 axes.width = rng.uniform(0, 200);
169 axes.height = rng.uniform(0, 200);
171 double angle = rng.uniform(0, 180);
174 randomColor(rng), rng.uniform(-1,9), lineType );
188 int Drawing_Random_Polylines( Mat image, char* window_name, RNG rng )
195 pt[0][0].x = rng.uniform(x_1, x_2);
196 pt[0][0].y = rng.uniform(y_1, y_2);
197 pt[0][1].x = rng.uniform(x_1, x_2);
198 pt[0][1].y = rng.uniform(y_1, y_2);
199 pt[0][2].x = rng.uniform(x_1, x_2);
200 pt[0][2].y = rng.uniform(y_1, y_2);
201 pt[1][0].x = rng.uniform(x_1, x_2);
202 pt[1][0].y = rng.uniform(y_1, y_2);
203 pt[1][1].x = rng.uniform(x_1, x_2);
204 pt[1][1].y = rng.uniform(y_1, y_2);
205 pt[1][2].x = rng.uniform(x_1, x_2);
206 pt[1][2].y = rng.uniform(y_1, y_2);
211 polylines(image, ppt, npt, 2, true, randomColor(rng), rng.uniform(1,10), lineType);
223 int Drawing_Random_Filled_Polygons( Mat image, char* window_name, RNG rng )
230 pt[0][0].x = rng.uniform(x_1, x_2);
231 pt[0][0].y = rng.uniform(y_1, y_2);
232 pt[0][1].x = rng.uniform(x_1, x_2);
233 pt[0][1].y = rng.uniform(y_1, y_2);
234 pt[0][2].x = rng.uniform(x_1, x_2);
235 pt[0][2].y = rng.uniform(y_1, y_2);
236 pt[1][0].x = rng.uniform(x_1, x_2);
237 pt[1][0].y = rng.uniform(y_1, y_2);
238 pt[1][1].x = rng.uniform(x_1, x_2);
239 pt[1][1].y = rng.uniform(y_1, y_2);
240 pt[1][2].x = rng.uniform(x_1, x_2);
241 pt[1][2].y = rng.uniform(y_1, y_2);
246 fillPoly( image, ppt, npt, 2, randomColor(rng), lineType );
258 int Drawing_Random_Circles( Mat image, char* window_name, RNG rng )
265 center.x = rng.uniform(x_1, x_2);
266 center.y = rng.uniform(y_1, y_2);
268 circle( image, center, rng.uniform(0, 300), randomColor(rng),
269 rng.uniform(-1, 9), lineType );
282 int Displaying_Random_Text( Mat image, char* window_name, RNG rng )
289 org.x = rng.uniform(x_1, x_2);
290 org.y = rng.uniform(y_1, y_2);
292 putText( image, "Testing text rendering", org, rng.uniform(0,8),
293 rng.uniform(0,100)*0.05+0.1, randomColor(rng), rng.uniform(1, 10), lineType);
306 int Displaying_Big_End( Mat image, char* window_name, RNG )