34#define BOOST_TEST_DYN_LINK
35#define BOOST_TEST_MODULE Main
36#include <boost/test/unit_test.hpp>
38#define BOOST_TEST_DYN_LINK
40# define BOOST_TEST_MODULE Main
42#include <boost/test/unit_test.hpp>
44#include "ramCanvas.hpp"
49BOOST_AUTO_TEST_CASE(draw_primatives_int) {
55 mjr::ramCanvasRGB8b aRamCanvas(BSIZE, BSIZE, 0, BSIZE-1, 0, BSIZE-1); mjr::ramCanvasRGB8b RaRamCanvas(BSIZE, BSIZE, 0, BSIZE-1, 0, BSIZE-1);
56 mjr::colorRGB8b aColor(mjr::colorRGB8b::cornerColorEnum::RED);
57 mjr::colorRGB8b bColor(mjr::colorRGB8b::cornerColorEnum::GREEN);
60 aRamCanvas.drawPoint(1, 1, aColor);
61 aRamCanvas.setDfltColor(bColor);
62 aRamCanvas.moveTo(2, 1);
63 aRamCanvas.drawPoint();
64 aRamCanvas.moveTo(3, 1);
65 aRamCanvas.drawPoint(aColor);
66 aRamCanvas.setDfltColor(bColor);
67 aRamCanvas.drawPoint(4, 1);
68 aRamCanvas.setDfltColor(aColor);
69 aRamCanvas.drawPoint(5.0, 2.0);
70 aRamCanvas.drawPoint(6.0, 2.0, bColor);
71 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType({7, 1}), aColor);
72 aRamCanvas.setDfltColor(bColor);
73 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType({8, 1}));
74 aRamCanvas.setDfltColor(aColor);
75 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType({9.0, 2.0}));
76 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType({10.0, 2.0}), bColor);
78 aRamCanvas.drawLine(1, 4, 1, 6, aColor);
79 aRamCanvas.setDfltColor(bColor);
80 aRamCanvas.moveTo(2, 4);
81 aRamCanvas.drawLine(2, 6);
82 aRamCanvas.setDfltColor(aColor);
83 aRamCanvas.moveTo(3.0, 5.0);
84 aRamCanvas.drawLine(3.0, 7.0);
85 aRamCanvas.moveTo(4, 4);
86 aRamCanvas.drawLine(4, 6, bColor);
87 aRamCanvas.moveTo(5.0, 5.0);
88 aRamCanvas.drawLine(5.0, 7.0, aColor);
89 aRamCanvas.setDfltColor(bColor);
90 aRamCanvas.drawLine(6, 4, 6, 6);
91 aRamCanvas.setDfltColor(aColor);
92 aRamCanvas.drawLine(7.0, 5.0, 7.0, 7.0);
93 aRamCanvas.drawLine(8.0, 5.0, 8.0, 7.0, bColor);
94 aRamCanvas.setDfltColor(aColor);
95 aRamCanvas.moveTo(mjr::ramCanvasRGB8b::pointFltType({9.0, 5.0}));
96 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointFltType({9.0, 7.0}));
97 aRamCanvas.moveTo(10.0, 5.0);
98 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointFltType({10.0, 7.0}), bColor);
99 aRamCanvas.setDfltColor(aColor);
100 aRamCanvas.moveTo(11, 4);
101 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointIntType({11, 6}));
102 aRamCanvas.setDfltColor(bColor);
103 aRamCanvas.moveTo(mjr::ramCanvasRGB8b::pointIntType({12, 4}));
104 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointIntType({12, 6}), aColor);
105 aRamCanvas.setDfltColor(bColor);
106 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointFltType({13, 5.0}),
107 mjr::ramCanvasRGB8b::pointFltType({13, 7.0}));
108 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointFltType({14, 5.0}),
109 mjr::ramCanvasRGB8b::pointFltType({14, 7.0}), aColor);
110 aRamCanvas.setDfltColor(bColor);
111 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointIntType({15, 4}),
112 mjr::ramCanvasRGB8b::pointIntType({15, 6}));
113 aRamCanvas.drawLine(mjr::ramCanvasRGB8b::pointIntType({16, 5}),
114 mjr::ramCanvasRGB8b::pointIntType({16, 6}), aColor);
116 aRamCanvas.drawTriangle(1, 9, 4, 9, 4, 12, aColor);
118 aRamCanvas.setDfltColor(bColor);
119 aRamCanvas.drawTriangle(6, 9, 9, 9, 9, 12);
120 aRamCanvas.drawTriangle(11.0, 10.0, 14.0, 10.0, 14.0, 13.0, aColor);
122 aRamCanvas.setDfltColor(bColor);
123 aRamCanvas.drawTriangle(16.0, 10.0, 19.0, 10.0, 19.0, 13.0);
124 aRamCanvas.drawTriangle(mjr::ramCanvasRGB8b::pointIntType({1, 14}),
125 mjr::ramCanvasRGB8b::pointIntType({4, 14}),
126 mjr::ramCanvasRGB8b::pointIntType({4, 17}), aColor);
127 aRamCanvas.setDfltColor(bColor);
128 aRamCanvas.drawTriangle(mjr::ramCanvasRGB8b::pointIntType({6, 14}),
129 mjr::ramCanvasRGB8b::pointIntType({9, 14}),
130 mjr::ramCanvasRGB8b::pointIntType({9, 17}));
131 aRamCanvas.drawTriangle(mjr::ramCanvasRGB8b::pointFltType({11.0, 15.0}),
132 mjr::ramCanvasRGB8b::pointFltType({14.0, 15.0}),
133 mjr::ramCanvasRGB8b::pointFltType({14.0, 18.0}), aColor);
134 aRamCanvas.setDfltColor(bColor);
135 aRamCanvas.drawTriangle(mjr::ramCanvasRGB8b::pointFltType({16.0, 15.0}),
136 mjr::ramCanvasRGB8b::pointFltType({19.0, 15.0}),
137 mjr::ramCanvasRGB8b::pointFltType({19.0, 18.0}));
138 mjr::ramCanvasRGB8b::pointIntType ptl1[3] = { {1, 19}, {4, 19}, {4, 22} };
139 aRamCanvas.drawTriangle(ptl1, aColor);
140 mjr::ramCanvasRGB8b::pointIntType ptl2[3] = { {6, 19}, {9, 19}, {9, 22} };
141 aRamCanvas.setDfltColor(bColor);
142 aRamCanvas.drawTriangle(ptl2);
143 mjr::ramCanvasRGB8b::pointFltType ptl3[3] = { {11.0, 20.0},
146 aRamCanvas.drawTriangle(ptl3, aColor);
147 mjr::ramCanvasRGB8b::pointFltType ptl4[3] = { {16.0, 20.0},
150 aRamCanvas.setDfltColor(bColor);
151 aRamCanvas.drawTriangle(ptl4);
153 aRamCanvas.drawFillTriangle(21, 9, 24, 9, 24, 12, aColor);
155 aRamCanvas.setDfltColor(bColor);
156 aRamCanvas.drawFillTriangle(26, 9, 29, 9, 29, 12);
157 aRamCanvas.drawFillTriangle(31.0, 10.0, 34.0, 10.0, 34.0, 13.0, aColor);
159 aRamCanvas.setDfltColor(bColor);
160 aRamCanvas.drawFillTriangle(36.0, 10.0, 39.0, 10.0, 39.0, 13.0);
161 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB8b::pointIntType({21, 14}),
162 mjr::ramCanvasRGB8b::pointIntType({24, 14}),
163 mjr::ramCanvasRGB8b::pointIntType({24, 17}), aColor);
164 aRamCanvas.setDfltColor(bColor);
165 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB8b::pointIntType({26, 14}),
166 mjr::ramCanvasRGB8b::pointIntType({29, 14}),
167 mjr::ramCanvasRGB8b::pointIntType({29, 17}));
168 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB8b::pointFltType({31.0, 15.0}),
169 mjr::ramCanvasRGB8b::pointFltType({34.0, 15.0}),
170 mjr::ramCanvasRGB8b::pointFltType({34.0, 18.0}), aColor);
171 aRamCanvas.setDfltColor(bColor);
172 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB8b::pointFltType({36.0, 15.0}),
173 mjr::ramCanvasRGB8b::pointFltType({39.0, 15.0}),
174 mjr::ramCanvasRGB8b::pointFltType({39.0, 18.0}));
175 mjr::ramCanvasRGB8b::pointIntType ptl5[3] = { {21, 19}, {24, 19}, {24, 22} };
176 aRamCanvas.drawFillTriangle(ptl5, aColor);
177 mjr::ramCanvasRGB8b::pointIntType ptl6[3] = { {26, 19}, {29, 19}, {29, 22} };
178 aRamCanvas.setDfltColor(bColor);
179 aRamCanvas.drawFillTriangle(ptl6);
180 mjr::ramCanvasRGB8b::pointFltType ptl7[3] = { {31.0, 20.0},
183 aRamCanvas.drawFillTriangle(ptl7, aColor);
184 mjr::ramCanvasRGB8b::pointFltType ptl8[3] = { {36.0, 20.0},
187 aRamCanvas.setDfltColor(bColor);
188 aRamCanvas.drawFillTriangle(ptl8);
190 aRamCanvas.drawCircle(3, 27, 2, aColor);
191 aRamCanvas.setDfltColor(bColor);
192 aRamCanvas.drawCircle(9, 27, 2);
193 aRamCanvas.moveTo(15, 27);
194 aRamCanvas.setDfltColor(aColor);
195 aRamCanvas.drawCircle(2);
196 aRamCanvas.drawCircle(21.0, 28.0, 2.0, bColor);
197 aRamCanvas.setDfltColor(aColor);
198 aRamCanvas.drawCircle(27.0, 28.0, 2.0);
199 aRamCanvas.moveTo(33.0, 28.0);
200 aRamCanvas.setDfltColor(bColor);
201 aRamCanvas.drawCircle(2.0);
202 aRamCanvas.drawCircle(mjr::ramCanvasRGB8b::pointIntType({39, 27}), 2, aColor);
203 aRamCanvas.setDfltColor(bColor);
204 aRamCanvas.drawCircle(mjr::ramCanvasRGB8b::pointIntType({45, 27}), 2);
205 aRamCanvas.drawCircle(mjr::ramCanvasRGB8b::pointFltType({51.0, 28.0}), 2.0, aColor);
206 aRamCanvas.setDfltColor(bColor);
207 aRamCanvas.drawCircle(mjr::ramCanvasRGB8b::pointFltType({57.0, 28.0}), 2.0);
209 aRamCanvas.drawFillCircle(3, 33, 2, aColor);
210 aRamCanvas.setDfltColor(bColor);
211 aRamCanvas.drawFillCircle(9, 33, 2);
212 aRamCanvas.moveTo(15, 33);
213 aRamCanvas.setDfltColor(aColor);
214 aRamCanvas.drawFillCircle(2);
215 aRamCanvas.drawFillCircle(21.0, 34.0, 2.0, bColor);
216 aRamCanvas.setDfltColor(aColor);
217 aRamCanvas.drawFillCircle(27.0, 34.0, 2.0);
218 aRamCanvas.moveTo(33.0, 34.0);
219 aRamCanvas.setDfltColor(bColor);
220 aRamCanvas.drawFillCircle(2.0);
221 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB8b::pointIntType({39, 33}), 2, aColor);
222 aRamCanvas.setDfltColor(bColor);
223 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB8b::pointIntType({45, 33}), 2);
224 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB8b::pointFltType({51.0, 34.0}), 2.0, aColor);
225 aRamCanvas.setDfltColor(bColor);
226 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB8b::pointFltType({57.0, 34.0}), 2.0);
228 aRamCanvas.drawRectangle(2, 38, 4, 40, aColor);
229 aRamCanvas.setDfltColor(bColor);
230 aRamCanvas.drawRectangle(6, 38, 8, 40);
231 aRamCanvas.drawRectangle(10.0, 39.0, 12.0, 41.0, aColor);
232 aRamCanvas.setDfltColor(bColor);
233 aRamCanvas.drawRectangle(14.0, 39.0, 16.0, 41.0);
234 aRamCanvas.drawRectangle(mjr::ramCanvasRGB8b::pointIntType({18, 38}),
235 mjr::ramCanvasRGB8b::pointIntType({20, 40}), aColor);
236 aRamCanvas.setDfltColor(bColor);
237 aRamCanvas.drawRectangle(mjr::ramCanvasRGB8b::pointIntType({22, 38}),
238 mjr::ramCanvasRGB8b::pointIntType({24, 40}));
239 aRamCanvas.drawRectangle(mjr::ramCanvasRGB8b::pointFltType({26.0, 39.0}),
240 mjr::ramCanvasRGB8b::pointFltType({28.0, 41.0}), aColor);
241 aRamCanvas.setDfltColor(bColor);
242 aRamCanvas.drawRectangle(mjr::ramCanvasRGB8b::pointFltType({30.0, 39.0}),
243 mjr::ramCanvasRGB8b::pointFltType({32.0, 41.0}));
244 mjr::ramCanvasRGB8b::pointIntType ptl9[2] = { {34, 38}, {36, 40} };
245 aRamCanvas.drawRectangle(ptl9, aColor);
246 mjr::ramCanvasRGB8b::pointIntType ptl10[2] = { {38, 38}, {40, 40} };
247 aRamCanvas.setDfltColor(bColor);
248 aRamCanvas.drawRectangle(ptl10);
249 mjr::ramCanvasRGB8b::pointFltType ptl11[2] = { {42.0, 39.0}, {44.0, 41.0} };
250 aRamCanvas.drawRectangle(ptl11, aColor);
251 mjr::ramCanvasRGB8b::pointFltType ptl12[2] = { {46.0, 39.0}, {48.0, 41.0} };
252 aRamCanvas.setDfltColor(bColor);
253 aRamCanvas.drawRectangle(ptl12);
255 aRamCanvas.drawFillRectangle(2, 42, 4, 44, aColor);
256 aRamCanvas.setDfltColor(bColor);
257 aRamCanvas.drawFillRectangle(6, 42, 8, 44);
258 aRamCanvas.drawFillRectangle(10.0, 43.0, 12.0, 45.0, aColor);
259 aRamCanvas.setDfltColor(bColor);
260 aRamCanvas.drawFillRectangle(14.0, 43.0, 16.0, 45.0);
261 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB8b::pointIntType({18, 42}),
262 mjr::ramCanvasRGB8b::pointIntType({20, 44}), aColor);
263 aRamCanvas.setDfltColor(bColor);
264 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB8b::pointIntType({22, 42}),
265 mjr::ramCanvasRGB8b::pointIntType({24, 44}));
266 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB8b::pointFltType({26.0, 43.0}),
267 mjr::ramCanvasRGB8b::pointFltType({28.0, 45.0}), aColor);
268 aRamCanvas.setDfltColor(bColor);
269 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB8b::pointFltType({30.0, 43.0}),
270 mjr::ramCanvasRGB8b::pointFltType({32.0, 45.0}));
271 mjr::ramCanvasRGB8b::pointIntType ptl13[2] = { {34, 42}, {36, 44} };
272 aRamCanvas.drawFillRectangle(ptl13, aColor);
273 mjr::ramCanvasRGB8b::pointIntType ptl14[2] = { {38, 42}, {40, 44} };
274 aRamCanvas.setDfltColor(bColor);
275 aRamCanvas.drawFillRectangle(ptl14);
276 mjr::ramCanvasRGB8b::pointFltType ptl15[2] = { {42.0, 43.0}, {44.0, 45.0} };
277 aRamCanvas.drawFillRectangle(ptl15, aColor);
278 mjr::ramCanvasRGB8b::pointFltType ptl16[2] = { {46.0, 43.0}, {48.0, 45.0} };
279 aRamCanvas.setDfltColor(bColor);
280 aRamCanvas.drawFillRectangle(ptl16);
282 mjr::ramCanvasRGB8b::coordIntType icx1[3] = { 2, 4, 4 };
283 mjr::ramCanvasRGB8b::coordIntType icy1[3] = { 46, 46, 48 };
284 aRamCanvas.drawPLCurve(3, icx1, icy1, aColor);
285 mjr::ramCanvasRGB8b::coordIntType icx2[3] = { 6, 8, 8 };
286 mjr::ramCanvasRGB8b::coordIntType icy2[3] = { 46, 46, 48 };
287 aRamCanvas.setDfltColor(bColor);
288 aRamCanvas.drawPLCurve(3, icx2, icy2);
289 mjr::ramCanvasRGB8b::coordFltType fcx1[3] = { 10.0, 12.0, 12.0 };
290 mjr::ramCanvasRGB8b::coordFltType fcy1[3] = { 47.0, 47.0, 49.0 };
291 aRamCanvas.drawPLCurve(3, fcx1, fcy1, aColor);
292 mjr::ramCanvasRGB8b::coordFltType fcx2[3] = { 14.0, 16.0, 16.0 };
293 mjr::ramCanvasRGB8b::coordFltType fcy2[3] = { 47.0, 47.0, 49.0 };
294 aRamCanvas.setDfltColor(bColor);
295 aRamCanvas.drawPLCurve(3, fcx2, fcy2);
296 mjr::ramCanvasRGB8b::pointIntType ptl17[3] = { {18, 46},
299 aRamCanvas.drawPLCurve(3, ptl17, aColor);
300 mjr::ramCanvasRGB8b::pointIntType ptl18[3] = { {22, 46},
303 aRamCanvas.setDfltColor(bColor);
304 aRamCanvas.drawPLCurve(3, ptl18);
305 mjr::ramCanvasRGB8b::pointFltType ptl19[3] = { {26.0, 47.0},
308 aRamCanvas.drawPLCurve(3, ptl19, aColor);
309 mjr::ramCanvasRGB8b::pointFltType ptl20[3] = { {30.0, 47.0},
312 aRamCanvas.setDfltColor(bColor);
313 aRamCanvas.drawPLCurve(3, ptl20);
316 aRamCanvas.writeRAWfile(
"ut-draw_primatives_int.mrw");
317 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-draw_primatives_int.mrw") == 0);
318 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
321 aRamCanvas.scaleUpProximal(5);
322 aRamCanvas.writeTIFFfile(
"ut-draw_primatives_int.tiff");
326BOOST_AUTO_TEST_CASE(draw_primatives_flt) {
330 const int BSIZE = 60;
332 mjr::ramCanvasRGB32F aRamCanvas(BSIZE, BSIZE, 0, BSIZE-1, 0, BSIZE-1); mjr::ramCanvasRGB32F RaRamCanvas(BSIZE, BSIZE, 0, BSIZE-1, 0, BSIZE-1);
333 mjr::colorRGB32F aColor(mjr::colorRGB32F::cornerColorEnum::RED);
334 mjr::colorRGB32F bColor(mjr::colorRGB32F::cornerColorEnum::GREEN);
337 aRamCanvas.drawPoint(1, 1, aColor);
338 aRamCanvas.setDfltColor(bColor);
339 aRamCanvas.moveTo(2, 1);
340 aRamCanvas.drawPoint();
341 aRamCanvas.moveTo(3, 1);
342 aRamCanvas.drawPoint(aColor);
343 aRamCanvas.setDfltColor(bColor);
344 aRamCanvas.drawPoint(4, 1);
345 aRamCanvas.setDfltColor(aColor);
346 aRamCanvas.drawPoint(5.0, 2.0);
347 aRamCanvas.drawPoint(6.0, 2.0, bColor);
348 aRamCanvas.drawPoint(mjr::ramCanvasRGB32F::pointIntType({7, 1}), aColor);
349 aRamCanvas.setDfltColor(bColor);
350 aRamCanvas.drawPoint(mjr::ramCanvasRGB32F::pointIntType({8, 1}));
351 aRamCanvas.setDfltColor(aColor);
352 aRamCanvas.drawPoint(mjr::ramCanvasRGB32F::pointFltType({9.0, 2.0}));
353 aRamCanvas.drawPoint(mjr::ramCanvasRGB32F::pointFltType({10.0, 2.0}), bColor);
355 aRamCanvas.drawLine(1, 4, 1, 6, aColor);
356 aRamCanvas.setDfltColor(bColor);
357 aRamCanvas.moveTo(2, 4);
358 aRamCanvas.drawLine(2, 6);
359 aRamCanvas.setDfltColor(aColor);
360 aRamCanvas.moveTo(3.0, 5.0);
361 aRamCanvas.drawLine(3.0, 7.0);
362 aRamCanvas.moveTo(4, 4);
363 aRamCanvas.drawLine(4, 6, bColor);
364 aRamCanvas.moveTo(5.0, 5.0);
365 aRamCanvas.drawLine(5.0, 7.0, aColor);
366 aRamCanvas.setDfltColor(bColor);
367 aRamCanvas.drawLine(6, 4, 6, 6);
368 aRamCanvas.setDfltColor(aColor);
369 aRamCanvas.drawLine(7.0, 5.0, 7.0, 7.0);
370 aRamCanvas.drawLine(8.0, 5.0, 8.0, 7.0, bColor);
371 aRamCanvas.setDfltColor(aColor);
372 aRamCanvas.moveTo(mjr::ramCanvasRGB32F::pointFltType({9.0, 5.0}));
373 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointFltType({9.0, 7.0}));
374 aRamCanvas.moveTo(10.0, 5.0);
375 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointFltType({10.0, 7.0}), bColor);
376 aRamCanvas.setDfltColor(aColor);
377 aRamCanvas.moveTo(11, 4);
378 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointIntType({11, 6}));
379 aRamCanvas.setDfltColor(bColor);
380 aRamCanvas.moveTo(mjr::ramCanvasRGB32F::pointIntType({12, 4}));
381 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointIntType({12, 6}), aColor);
382 aRamCanvas.setDfltColor(bColor);
383 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointFltType({13, 5.0}),
384 mjr::ramCanvasRGB32F::pointFltType({13, 7.0}));
385 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointFltType({14, 5.0}),
386 mjr::ramCanvasRGB32F::pointFltType({14, 7.0}), aColor);
387 aRamCanvas.setDfltColor(bColor);
388 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointIntType({15, 4}),
389 mjr::ramCanvasRGB32F::pointIntType({15, 6}));
390 aRamCanvas.drawLine(mjr::ramCanvasRGB32F::pointIntType({16, 5}),
391 mjr::ramCanvasRGB32F::pointIntType({16, 6}), aColor);
393 aRamCanvas.drawTriangle(1, 9, 4, 9, 4, 12, aColor);
395 aRamCanvas.setDfltColor(bColor);
396 aRamCanvas.drawTriangle(6, 9, 9, 9, 9, 12);
397 aRamCanvas.drawTriangle(11.0, 10.0, 14.0, 10.0, 14.0, 13.0, aColor);
399 aRamCanvas.setDfltColor(bColor);
400 aRamCanvas.drawTriangle(16.0, 10.0, 19.0, 10.0, 19.0, 13.0);
401 aRamCanvas.drawTriangle(mjr::ramCanvasRGB32F::pointIntType({1, 14}),
402 mjr::ramCanvasRGB32F::pointIntType({4, 14}),
403 mjr::ramCanvasRGB32F::pointIntType({4, 17}), aColor);
404 aRamCanvas.setDfltColor(bColor);
405 aRamCanvas.drawTriangle(mjr::ramCanvasRGB32F::pointIntType({6, 14}),
406 mjr::ramCanvasRGB32F::pointIntType({9, 14}),
407 mjr::ramCanvasRGB32F::pointIntType({9, 17}));
408 aRamCanvas.drawTriangle(mjr::ramCanvasRGB32F::pointFltType({11.0, 15.0}),
409 mjr::ramCanvasRGB32F::pointFltType({14.0, 15.0}),
410 mjr::ramCanvasRGB32F::pointFltType({14.0, 18.0}), aColor);
411 aRamCanvas.setDfltColor(bColor);
412 aRamCanvas.drawTriangle(mjr::ramCanvasRGB32F::pointFltType({16.0, 15.0}),
413 mjr::ramCanvasRGB32F::pointFltType({19.0, 15.0}),
414 mjr::ramCanvasRGB32F::pointFltType({19.0, 18.0}));
415 mjr::ramCanvasRGB32F::pointIntType ptl1[3] = { {1, 19}, {4, 19}, {4, 22} };
416 aRamCanvas.drawTriangle(ptl1, aColor);
417 mjr::ramCanvasRGB32F::pointIntType ptl2[3] = { {6, 19}, {9, 19}, {9, 22} };
418 aRamCanvas.setDfltColor(bColor);
419 aRamCanvas.drawTriangle(ptl2);
420 mjr::ramCanvasRGB32F::pointFltType ptl3[3] = { {11.0, 20.0},
423 aRamCanvas.drawTriangle(ptl3, aColor);
424 mjr::ramCanvasRGB32F::pointFltType ptl4[3] = { {16.0, 20.0},
427 aRamCanvas.setDfltColor(bColor);
428 aRamCanvas.drawTriangle(ptl4);
430 aRamCanvas.drawFillTriangle(21, 9, 24, 9, 24, 12, aColor);
432 aRamCanvas.setDfltColor(bColor);
433 aRamCanvas.drawFillTriangle(26, 9, 29, 9, 29, 12);
434 aRamCanvas.drawFillTriangle(31.0, 10.0, 34.0, 10.0, 34.0, 13.0, aColor);
436 aRamCanvas.setDfltColor(bColor);
437 aRamCanvas.drawFillTriangle(36.0, 10.0, 39.0, 10.0, 39.0, 13.0);
438 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB32F::pointIntType({21, 14}),
439 mjr::ramCanvasRGB32F::pointIntType({24, 14}),
440 mjr::ramCanvasRGB32F::pointIntType({24, 17}), aColor);
441 aRamCanvas.setDfltColor(bColor);
442 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB32F::pointIntType({26, 14}),
443 mjr::ramCanvasRGB32F::pointIntType({29, 14}),
444 mjr::ramCanvasRGB32F::pointIntType({29, 17}));
445 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB32F::pointFltType({31.0, 15.0}),
446 mjr::ramCanvasRGB32F::pointFltType({34.0, 15.0}),
447 mjr::ramCanvasRGB32F::pointFltType({34.0, 18.0}), aColor);
448 aRamCanvas.setDfltColor(bColor);
449 aRamCanvas.drawFillTriangle(mjr::ramCanvasRGB32F::pointFltType({36.0, 15.0}),
450 mjr::ramCanvasRGB32F::pointFltType({39.0, 15.0}),
451 mjr::ramCanvasRGB32F::pointFltType({39.0, 18.0}));
452 mjr::ramCanvasRGB32F::pointIntType ptl5[3] = { {21, 19}, {24, 19}, {24, 22} };
453 aRamCanvas.drawFillTriangle(ptl5, aColor);
454 mjr::ramCanvasRGB32F::pointIntType ptl6[3] = { {26, 19}, {29, 19}, {29, 22} };
455 aRamCanvas.setDfltColor(bColor);
456 aRamCanvas.drawFillTriangle(ptl6);
457 mjr::ramCanvasRGB32F::pointFltType ptl7[3] = { {31.0, 20.0},
460 aRamCanvas.drawFillTriangle(ptl7, aColor);
461 mjr::ramCanvasRGB32F::pointFltType ptl8[3] = { {36.0, 20.0},
464 aRamCanvas.setDfltColor(bColor);
465 aRamCanvas.drawFillTriangle(ptl8);
467 aRamCanvas.drawCircle(3, 27, 2, aColor);
468 aRamCanvas.setDfltColor(bColor);
469 aRamCanvas.drawCircle(9, 27, 2);
470 aRamCanvas.moveTo(15, 27);
471 aRamCanvas.setDfltColor(aColor);
472 aRamCanvas.drawCircle(2);
473 aRamCanvas.drawCircle(21.0, 28.0, 2.0, bColor);
474 aRamCanvas.setDfltColor(aColor);
475 aRamCanvas.drawCircle(27.0, 28.0, 2.0);
476 aRamCanvas.moveTo(33.0, 28.0);
477 aRamCanvas.setDfltColor(bColor);
478 aRamCanvas.drawCircle(2.0);
479 aRamCanvas.drawCircle(mjr::ramCanvasRGB32F::pointIntType({39, 27}), 2, aColor);
480 aRamCanvas.setDfltColor(bColor);
481 aRamCanvas.drawCircle(mjr::ramCanvasRGB32F::pointIntType({45, 27}), 2);
482 aRamCanvas.drawCircle(mjr::ramCanvasRGB32F::pointFltType({51.0, 28.0}), 2.0, aColor);
483 aRamCanvas.setDfltColor(bColor);
484 aRamCanvas.drawCircle(mjr::ramCanvasRGB32F::pointFltType({57.0, 28.0}), 2.0);
486 aRamCanvas.drawFillCircle(3, 33, 2, aColor);
487 aRamCanvas.setDfltColor(bColor);
488 aRamCanvas.drawFillCircle(9, 33, 2);
489 aRamCanvas.moveTo(15, 33);
490 aRamCanvas.setDfltColor(aColor);
491 aRamCanvas.drawFillCircle(2);
492 aRamCanvas.drawFillCircle(21.0, 34.0, 2.0, bColor);
493 aRamCanvas.setDfltColor(aColor);
494 aRamCanvas.drawFillCircle(27.0, 34.0, 2.0);
495 aRamCanvas.moveTo(33.0, 34.0);
496 aRamCanvas.setDfltColor(bColor);
497 aRamCanvas.drawFillCircle(2.0);
498 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB32F::pointIntType({39, 33}), 2, aColor);
499 aRamCanvas.setDfltColor(bColor);
500 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB32F::pointIntType({45, 33}), 2);
501 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB32F::pointFltType({51.0, 34.0}), 2.0, aColor);
502 aRamCanvas.setDfltColor(bColor);
503 aRamCanvas.drawFillCircle(mjr::ramCanvasRGB32F::pointFltType({57.0, 34.0}), 2.0);
505 aRamCanvas.drawRectangle(2, 38, 4, 40, aColor);
506 aRamCanvas.setDfltColor(bColor);
507 aRamCanvas.drawRectangle(6, 38, 8, 40);
508 aRamCanvas.drawRectangle(10.0, 39.0, 12.0, 41.0, aColor);
509 aRamCanvas.setDfltColor(bColor);
510 aRamCanvas.drawRectangle(14.0, 39.0, 16.0, 41.0);
511 aRamCanvas.drawRectangle(mjr::ramCanvasRGB32F::pointIntType({18, 38}),
512 mjr::ramCanvasRGB32F::pointIntType({20, 40}), aColor);
513 aRamCanvas.setDfltColor(bColor);
514 aRamCanvas.drawRectangle(mjr::ramCanvasRGB32F::pointIntType({22, 38}),
515 mjr::ramCanvasRGB32F::pointIntType({24, 40}));
516 aRamCanvas.drawRectangle(mjr::ramCanvasRGB32F::pointFltType({26.0, 39.0}),
517 mjr::ramCanvasRGB32F::pointFltType({28.0, 41.0}), aColor);
518 aRamCanvas.setDfltColor(bColor);
519 aRamCanvas.drawRectangle(mjr::ramCanvasRGB32F::pointFltType({30.0, 39.0}),
520 mjr::ramCanvasRGB32F::pointFltType({32.0, 41.0}));
521 mjr::ramCanvasRGB32F::pointIntType ptl9[2] = { {34, 38}, {36, 40} };
522 aRamCanvas.drawRectangle(ptl9, aColor);
523 mjr::ramCanvasRGB32F::pointIntType ptl10[2] = { {38, 38}, {40, 40} };
524 aRamCanvas.setDfltColor(bColor);
525 aRamCanvas.drawRectangle(ptl10);
526 mjr::ramCanvasRGB32F::pointFltType ptl11[2] = { {42.0, 39.0}, {44.0, 41.0} };
527 aRamCanvas.drawRectangle(ptl11, aColor);
528 mjr::ramCanvasRGB32F::pointFltType ptl12[2] = { {46.0, 39.0}, {48.0, 41.0} };
529 aRamCanvas.setDfltColor(bColor);
530 aRamCanvas.drawRectangle(ptl12);
532 aRamCanvas.drawFillRectangle(2, 42, 4, 44, aColor);
533 aRamCanvas.setDfltColor(bColor);
534 aRamCanvas.drawFillRectangle(6, 42, 8, 44);
535 aRamCanvas.drawFillRectangle(10.0, 43.0, 12.0, 45.0, aColor);
536 aRamCanvas.setDfltColor(bColor);
537 aRamCanvas.drawFillRectangle(14.0, 43.0, 16.0, 45.0);
538 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB32F::pointIntType({18, 42}),
539 mjr::ramCanvasRGB32F::pointIntType({20, 44}), aColor);
540 aRamCanvas.setDfltColor(bColor);
541 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB32F::pointIntType({22, 42}),
542 mjr::ramCanvasRGB32F::pointIntType({24, 44}));
543 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB32F::pointFltType({26.0, 43.0}),
544 mjr::ramCanvasRGB32F::pointFltType({28.0, 45.0}), aColor);
545 aRamCanvas.setDfltColor(bColor);
546 aRamCanvas.drawFillRectangle(mjr::ramCanvasRGB32F::pointFltType({30.0, 43.0}),
547 mjr::ramCanvasRGB32F::pointFltType({32.0, 45.0}));
548 mjr::ramCanvasRGB32F::pointIntType ptl13[2] = { {34, 42}, {36, 44} };
549 aRamCanvas.drawFillRectangle(ptl13, aColor);
550 mjr::ramCanvasRGB32F::pointIntType ptl14[2] = { {38, 42}, {40, 44} };
551 aRamCanvas.setDfltColor(bColor);
552 aRamCanvas.drawFillRectangle(ptl14);
553 mjr::ramCanvasRGB32F::pointFltType ptl15[2] = { {42.0, 43.0}, {44.0, 45.0} };
554 aRamCanvas.drawFillRectangle(ptl15, aColor);
555 mjr::ramCanvasRGB32F::pointFltType ptl16[2] = { {46.0, 43.0}, {48.0, 45.0} };
556 aRamCanvas.setDfltColor(bColor);
557 aRamCanvas.drawFillRectangle(ptl16);
559 mjr::ramCanvasRGB32F::coordIntType icx1[3] = { 2, 4, 4 };
560 mjr::ramCanvasRGB32F::coordIntType icy1[3] = { 46, 46, 48 };
561 aRamCanvas.drawPLCurve(3, icx1, icy1, aColor);
562 mjr::ramCanvasRGB32F::coordIntType icx2[3] = { 6, 8, 8 };
563 mjr::ramCanvasRGB32F::coordIntType icy2[3] = { 46, 46, 48 };
564 aRamCanvas.setDfltColor(bColor);
565 aRamCanvas.drawPLCurve(3, icx2, icy2);
566 mjr::ramCanvasRGB32F::coordFltType fcx1[3] = { 10.0, 12.0, 12.0 };
567 mjr::ramCanvasRGB32F::coordFltType fcy1[3] = { 47.0, 47.0, 49.0 };
568 aRamCanvas.drawPLCurve(3, fcx1, fcy1, aColor);
569 mjr::ramCanvasRGB32F::coordFltType fcx2[3] = { 14.0, 16.0, 16.0 };
570 mjr::ramCanvasRGB32F::coordFltType fcy2[3] = { 47.0, 47.0, 49.0 };
571 aRamCanvas.setDfltColor(bColor);
572 aRamCanvas.drawPLCurve(3, fcx2, fcy2);
573 mjr::ramCanvasRGB32F::pointIntType ptl17[3] = { {18, 46},
576 aRamCanvas.drawPLCurve(3, ptl17, aColor);
577 mjr::ramCanvasRGB32F::pointIntType ptl18[3] = { {22, 46},
580 aRamCanvas.setDfltColor(bColor);
581 aRamCanvas.drawPLCurve(3, ptl18);
582 mjr::ramCanvasRGB32F::pointFltType ptl19[3] = { {26.0, 47.0},
585 aRamCanvas.drawPLCurve(3, ptl19, aColor);
586 mjr::ramCanvasRGB32F::pointFltType ptl20[3] = { {30.0, 47.0},
589 aRamCanvas.setDfltColor(bColor);
590 aRamCanvas.drawPLCurve(3, ptl20);
593 aRamCanvas.writeRAWfile(
"ut-draw_primatives_flt.mrw");
594 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-draw_primatives_flt.mrw") == 0);
595 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
598 aRamCanvas.scaleUpProximal(5);
599 aRamCanvas.writeTIFFfile(
"ut-draw_primatives_flt.tiff");
603BOOST_AUTO_TEST_CASE(save_file) {
608 mjr::ramCanvasRGB8b aRamCanvas(WIDE, TALL); mjr::ramCanvasRGB8b::colorType aColor;
typedef mjr::ramCanvasRGB8b::colorChanType aCt; mjr::ramCanvasRGB8b RaRamCanvas(WIDE, TALL);
609 mjr::ramCanvasRGB16b bRamCanvas(WIDE, TALL); mjr::ramCanvasRGB16b::colorType bColor;
typedef mjr::ramCanvasRGB16b::colorChanType bCt; mjr::ramCanvasRGB16b RbRamCanvas(WIDE, TALL);
610 mjr::ramCanvasRGB32b cRamCanvas(WIDE, TALL); mjr::ramCanvasRGB32b::colorType cColor;
typedef mjr::ramCanvasRGB32b::colorChanType cCt; mjr::ramCanvasRGB32b RcRamCanvas(WIDE, TALL);
611 mjr::ramCanvasRGB64b dRamCanvas(WIDE, TALL); mjr::ramCanvasRGB64b::colorType dColor;
typedef mjr::ramCanvasRGB64b::colorChanType dCt; mjr::ramCanvasRGB64b RdRamCanvas(WIDE, TALL);
612 mjr::ramCanvasRGB32F eRamCanvas(WIDE, TALL); mjr::ramCanvasRGB32F::colorType eColor;
typedef mjr::ramCanvasRGB32F::colorChanType eCt; mjr::ramCanvasRGB32F ReRamCanvas(WIDE, TALL);
613 mjr::ramCanvasRGB64F fRamCanvas(WIDE, TALL); mjr::ramCanvasRGB64F::colorType fColor;
typedef mjr::ramCanvasRGB64F::colorChanType fCt; mjr::ramCanvasRGB64F RfRamCanvas(WIDE, TALL);
614 mjr::ramCanvas1c8b gRamCanvas(WIDE, TALL); mjr::ramCanvas1c8b::colorType gColor;
typedef mjr::ramCanvas1c8b::colorChanType gCt; mjr::ramCanvas1c8b RgRamCanvas(WIDE, TALL);
615 mjr::ramCanvas1c16b hRamCanvas(WIDE, TALL); mjr::ramCanvas1c16b::colorType hColor;
typedef mjr::ramCanvas1c16b::colorChanType hCt; mjr::ramCanvas1c16b RhRamCanvas(WIDE, TALL);
616 mjr::ramCanvas1c32b iRamCanvas(WIDE, TALL); mjr::ramCanvas1c32b::colorType iColor;
typedef mjr::ramCanvas1c32b::colorChanType iCt; mjr::ramCanvas1c32b RiRamCanvas(WIDE, TALL);
617 mjr::ramCanvas1c64b jRamCanvas(WIDE, TALL); mjr::ramCanvas1c64b::colorType jColor;
typedef mjr::ramCanvas1c64b::colorChanType jCt; mjr::ramCanvas1c64b RjRamCanvas(WIDE, TALL);
618 mjr::ramCanvas1c32F kRamCanvas(WIDE, TALL); mjr::ramCanvas1c32F::colorType kColor;
typedef mjr::ramCanvas1c32F::colorChanType kCt; mjr::ramCanvas1c32F RkRamCanvas(WIDE, TALL);
619 mjr::ramCanvas1c64F lRamCanvas(WIDE, TALL); mjr::ramCanvas1c64F::colorType lColor;
typedef mjr::ramCanvas1c64F::colorChanType lCt; mjr::ramCanvas1c64F RlRamCanvas(WIDE, TALL);
621 for(
int x=0;x<aRamCanvas.getNumPixX();x++)
622 for(
int y=0;y<aRamCanvas.getNumPixY();y++) {
623 aRamCanvas.drawPoint(x, y, aColor.setChansRGB((aCt)x, (aCt)y, (aCt)(x+y)));
624 bRamCanvas.drawPoint(x, y, bColor.setChansRGB((bCt)x, (bCt)y, (bCt)(x+y)));
625 cRamCanvas.drawPoint(x, y, cColor.setChansRGB((cCt)x, (cCt)y, (cCt)(x+y)));
626 dRamCanvas.drawPoint(x, y, dColor.setChansRGB((dCt)x, (dCt)y, (dCt)(x+y)));
627 eRamCanvas.drawPoint(x, y, eColor.setChansRGB((eCt)x, (eCt)y, (eCt)(x+y)));
628 fRamCanvas.drawPoint(x, y, fColor.setChansRGB((fCt)x, (fCt)y, (fCt)(x+y)));
629 gRamCanvas.drawPoint(x, y, gColor.setChans((gCt)(x+y)));
630 hRamCanvas.drawPoint(x, y, hColor.setChans((hCt)(x+y)));
631 iRamCanvas.drawPoint(x, y, iColor.setChans((iCt)(x+y)));
632 jRamCanvas.drawPoint(x, y, jColor.setChans((jCt)(x+y)));
633 kRamCanvas.drawPoint(x, y, kColor.setChans((kCt)(x+y)));
634 lRamCanvas.drawPoint(x, y, lColor.setChans((lCt)(x+y)));
639 aRamCanvas.writeTIFFfile(
"ut-save_file-a.tiff");
640 bRamCanvas.writeTIFFfile(
"ut-save_file-b.tiff");
641 cRamCanvas.writeTIFFfile(
"ut-save_file-c.tiff");
642 dRamCanvas.writeTIFFfile(
"ut-save_file-d.tiff");
643 eRamCanvas.writeTIFFfile(
"ut-save_file-e.tiff");
644 fRamCanvas.writeTIFFfile(
"ut-save_file-f.tiff");
645 gRamCanvas.writeTIFFfile(
"ut-save_file-g.tiff");
646 hRamCanvas.writeTIFFfile(
"ut-save_file-h.tiff");
647 iRamCanvas.writeTIFFfile(
"ut-save_file-i.tiff");
648 jRamCanvas.writeTIFFfile(
"ut-save_file-j.tiff");
649 kRamCanvas.writeTIFFfile(
"ut-save_file-k.tiff");
650 lRamCanvas.writeTIFFfile(
"ut-save_file-l.tiff");
655 aRamCanvas.writeRAWfile(
"ut-save_file-a.mrw");
656 bRamCanvas.writeRAWfile(
"ut-save_file-b.mrw");
657 cRamCanvas.writeRAWfile(
"ut-save_file-c.mrw");
658 dRamCanvas.writeRAWfile(
"ut-save_file-d.mrw");
659 eRamCanvas.writeRAWfile(
"ut-save_file-e.mrw");
660 fRamCanvas.writeRAWfile(
"ut-save_file-f.mrw");
661 gRamCanvas.writeRAWfile(
"ut-save_file-g.mrw");
662 hRamCanvas.writeRAWfile(
"ut-save_file-h.mrw");
663 iRamCanvas.writeRAWfile(
"ut-save_file-i.mrw");
664 jRamCanvas.writeRAWfile(
"ut-save_file-j.mrw");
665 kRamCanvas.writeRAWfile(
"ut-save_file-k.mrw");
666 lRamCanvas.writeRAWfile(
"ut-save_file-l.mrw");
674 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-save_file-a.mrw") == 0);
675 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
679 BOOST_TEST_CHECK(RbRamCanvas.readRAWfile(
"../data/utest/ut-save_file-b.mrw") == 0);
680 BOOST_TEST_CHECK(RbRamCanvas.isEqual(bRamCanvas) ==
true);
684 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-save_file-c.mrw") == 0);
685 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
689 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-save_file-d.mrw") == 0);
690 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
694 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-save_file-e.mrw") == 0);
695 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
700 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-save_file-f.mrw") == 0);
701 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
705 BOOST_TEST_CHECK(RgRamCanvas.readRAWfile(
"../data/utest/ut-save_file-g.mrw") == 0);
706 BOOST_TEST_CHECK(RgRamCanvas.isEqual(gRamCanvas) ==
true);
710 BOOST_TEST_CHECK(RhRamCanvas.readRAWfile(
"../data/utest/ut-save_file-h.mrw") == 0);
711 BOOST_TEST_CHECK(RhRamCanvas.isEqual(hRamCanvas) ==
true);
715 BOOST_TEST_CHECK(RiRamCanvas.readRAWfile(
"../data/utest/ut-save_file-i.mrw") == 0);
716 BOOST_TEST_CHECK(RiRamCanvas.isEqual(iRamCanvas) ==
true);
720 BOOST_TEST_CHECK(RjRamCanvas.readRAWfile(
"../data/utest/ut-save_file-j.mrw") == 0);
721 BOOST_TEST_CHECK(RjRamCanvas.isEqual(jRamCanvas) ==
true);
725 BOOST_TEST_CHECK(RkRamCanvas.readRAWfile(
"../data/utest/ut-save_file-k.mrw") == 0);
726 BOOST_TEST_CHECK(RkRamCanvas.isEqual(kRamCanvas) ==
true);
731 BOOST_TEST_CHECK(RlRamCanvas.readRAWfile(
"../data/utest/ut-save_file-l.mrw") == 0);
732 BOOST_TEST_CHECK(RlRamCanvas.isEqual(lRamCanvas) ==
true);
736BOOST_AUTO_TEST_CASE(lines_no_clip) {
740 const int WIDE = 16+16+16+1;
743 mjr::ramCanvas1c8b aRamCanvas(WIDE, TALL); mjr::ramCanvas1c8b RaRamCanvas(WIDE, TALL);
744 mjr::ramCanvas1c8b::colorType aColor;
746 std::vector<std::vector<int>> lns {{ 1, 1, 1, 11},
756 for(
auto pts : lns) {
757 aRamCanvas.drawLine( pts[2], pts[3], pts[0], pts[1], aColor);
758 aRamCanvas.drawLine(24+pts[0], pts[1], 24+pts[2], pts[3], aColor);
763 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-lines_no_clip.mrw") == 0);
764 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
768 aRamCanvas.writeRAWfile(
"ut-lines_no_clip.mrw");
769 aRamCanvas.scaleUpProximal(10);
770 aRamCanvas.writeTIFFfile(
"ut-lines_no_clip.tiff");
774BOOST_AUTO_TEST_CASE(lines_clip) {
778 std::vector<std::vector<int>> lns {{ -8, -16, 8, 16},
787 mjr::ramCanvas1c8b::colorType aColor;
792 mjr::ramCanvas1c8b bRamCanvas(40, 40); mjr::ramCanvas1c8b RbRamCanvas(40, 40);
793 mjr::ramCanvas1c8b cRamCanvas(40, 40);
795 for(
auto pts : lns) {
796 bRamCanvas.drawLine(19+pts[0], 19+pts[1], 19+pts[2], 19+pts[3], aColor);
797 cRamCanvas.drawLine(19+pts[2], 19+pts[3], 19+pts[0], 19+pts[1], aColor);
800 BOOST_CHECK_EQUAL_COLLECTIONS(bRamCanvas.begin(), bRamCanvas.end(), cRamCanvas.begin(), cRamCanvas.end());
803 BOOST_TEST_CHECK(RbRamCanvas.readRAWfile(
"../data/utest/ut-lines_clip-b.mrw") == 0);
804 BOOST_TEST_CHECK(RbRamCanvas.isEqual(bRamCanvas) ==
true);
807 bRamCanvas.writeRAWfile(
"ut-lines_clip-b.mrw");
808 bRamCanvas.scaleUpProximal(10);
809 bRamCanvas.writeTIFFfile(
"ut-lines_clip-b.tiff");
811 cRamCanvas.writeRAWfile(
"ut-lines_clip-c.mrw");
812 cRamCanvas.scaleUpProximal(10);
813 cRamCanvas.writeTIFFfile(
"ut-lines_clip-c.tiff");
817 mjr::ramCanvas1c8b dRamCanvas(25, 25); mjr::ramCanvas1c8b RdRamCanvas(25, 25);
818 mjr::ramCanvas1c8b eRamCanvas(25, 25);
820 for(
auto pts : lns) {
821 dRamCanvas.drawLine(7+pts[0], 7+pts[1], 7+pts[2], 7+pts[3], aColor);
822 eRamCanvas.drawLine(7+pts[2], 7+pts[3], 7+pts[0], 7+pts[1], aColor);
825 BOOST_CHECK_EQUAL_COLLECTIONS(dRamCanvas.begin(), dRamCanvas.end(), eRamCanvas.begin(), eRamCanvas.end());
828 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-lines_clip-d.mrw") == 0);
829 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
832 dRamCanvas.writeRAWfile(
"ut-lines_clip-d.mrw");
833 dRamCanvas.scaleUpProximal(10);
834 dRamCanvas.writeTIFFfile(
"ut-lines_clip-d.tiff");
836 eRamCanvas.writeRAWfile(
"ut-lines_clip-e.mrw");
837 eRamCanvas.scaleUpProximal(10);
838 eRamCanvas.writeTIFFfile(
"ut-lines_clip-e.tiff");
842 mjr::ramCanvas1c8b fRamCanvas(25, 25); mjr::ramCanvas1c8b RfRamCanvas(25, 25);
843 mjr::ramCanvas1c8b gRamCanvas(25, 25);
845 for(
auto pts : lns) {
846 fRamCanvas.drawLine(17+pts[0], 17+pts[1], 17+pts[2], 17+pts[3], aColor);
847 gRamCanvas.drawLine(17+pts[2], 17+pts[3], 17+pts[0], 17+pts[1], aColor);
850 BOOST_CHECK_EQUAL_COLLECTIONS(fRamCanvas.begin(), fRamCanvas.end(), gRamCanvas.begin(), gRamCanvas.end());
853 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-lines_clip-f.mrw") == 0);
854 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
857 fRamCanvas.writeRAWfile(
"ut-lines_clip-f.mrw");
858 fRamCanvas.scaleUpProximal(10);
859 fRamCanvas.writeTIFFfile(
"ut-lines_clip-f.tiff");
861 gRamCanvas.writeRAWfile(
"ut-lines_clip-g.mrw");
862 gRamCanvas.scaleUpProximal(10);
863 gRamCanvas.writeTIFFfile(
"ut-lines_clip-g.tiff");
867 mjr::ramCanvas1c8b hRamCanvas(15, 15); mjr::ramCanvas1c8b RhRamCanvas(15, 15);
868 mjr::ramCanvas1c8b iRamCanvas(15, 15);
870 for(
auto pts : lns) {
871 hRamCanvas.drawLine(7+pts[0], 7+pts[1], 7+pts[2], 7+pts[3], aColor);
872 iRamCanvas.drawLine(7+pts[2], 7+pts[3], 7+pts[0], 7+pts[1], aColor);
875 BOOST_CHECK_EQUAL_COLLECTIONS(hRamCanvas.begin(), hRamCanvas.end(), iRamCanvas.begin(), iRamCanvas.end());
878 BOOST_TEST_CHECK(RhRamCanvas.readRAWfile(
"../data/utest/ut-lines_clip-h.mrw") == 0);
879 BOOST_TEST_CHECK(RhRamCanvas.isEqual(hRamCanvas) ==
true);
882 hRamCanvas.writeRAWfile(
"ut-lines_clip-h.mrw");
883 hRamCanvas.scaleUpProximal(10);
884 hRamCanvas.writeTIFFfile(
"ut-lines_clip-h.tiff");
886 iRamCanvas.writeRAWfile(
"ut-lines_clip-i.mrw");
887 iRamCanvas.scaleUpProximal(10);
888 iRamCanvas.writeTIFFfile(
"ut-lines_clip-i.tiff");
892BOOST_AUTO_TEST_CASE(triangles) {
899 std::vector<std::vector<int>> tri {{ 0, 0, 16, 0, 8, 8},
900 { 0, 0, 16, 0, 8, 16},
901 { 0, 0, 16, 0, 8, 4},
903 { 0, 0, 8, 0, 0, 16},
906 { 0, 0, 8, 0, 8, 16},
908 { 0, 16, 16, 16, 8, 8},
909 { 0, 16, 16, 16, 8, 0},
910 { 0, 16, 16, 16, 8, 12},
911 { 0, 16, 8, 16, 0, 8},
912 { 0, 16, 8, 16, 0, 0},
913 { 0, 16, 8, 16, 0, 12},
914 { 0, 16, 8, 16, 8, 8},
915 { 0, 16, 8, 16, 8, 0},
916 { 0, 16, 8, 16, 8, 12},
917 { 0, 0, 0, 16, 8, 8},
918 { 0, 0, 0, 16, 16, 8},
919 { 0, 0, 0, 16, 4, 8},
921 { 0, 0, 0, 8, 16, 0},
924 { 0, 0, 0, 8, 16, 8},
926 {16, 0, 16, 16, 8, 8},
927 {16, 0, 16, 16, 0, 8},
928 {16, 0, 16, 16, 12, 8},
929 {16, 0, 16, 8, 8, 0},
930 {16, 0, 16, 8, 0, 0},
931 {16, 0, 16, 8, 12, 0},
932 {16, 0, 16, 8, 8, 8},
933 {16, 0, 16, 8, 0, 8},
934 {16, 0, 16, 8, 12, 8},
935 { 0, 0, 16, 0, 8, 0},
936 { 0, 0, 16, 0, 0, 0},
937 { 0, 0, 16, 0, 16, 0},
938 { 0, 0, 0, 16, 0, 8},
939 { 0, 0, 0, 16, 0, 0},
940 { 0, 0, 0, 16, 0, 16},
942 { 0, 0, 0, 0, 16, 16},
943 { 0, 16, 0, 16, 16, 0},
944 { 0, 0, 0, 0, 16, 4},
945 { 0, 0, 0, 0, 16, 8},
946 { 0, 16, 0, 16, 16, 8},
947 { 0, 16, 0, 16, 16, 12},
948 { 0, 0, 0, 0, 4, 16},
949 { 0, 0, 0, 0, 8, 16},
950 { 0, 16, 0, 16, 12, 0},
951 { 0, 16, 0, 16, 8, 0},
952 { 0, 0, 8, 8, 16, 16},
953 { 0, 0, 4, 8, 16, 16},
954 { 0, 0, 12, 8, 16, 16},
956 { 4, 0, 6, 8, 12, 16},
957 { 4, 0, 4, 8, 12, 16},
958 { 4, 0, 0, 8, 12, 16},
959 { 4, 0, 10, 8, 12, 16},
960 { 4, 0, 12, 8, 12, 16},
961 { 4, 0, 16, 8, 12, 16},
963 { 4, 16, 6, 8, 12, 0},
964 { 4, 16, 4, 8, 12, 0},
965 { 4, 16, 0, 8, 12, 0},
966 { 4, 16, 10, 8, 12, 0},
967 { 4, 16, 12, 8, 12, 0},
968 { 4, 16, 16, 8, 12, 0},
970 { 0, 4, 8, 6, 16, 12},
971 { 0, 4, 8, 4, 16, 12},
972 { 0, 4, 8, 0, 16, 12},
973 { 0, 4, 8, 10, 16, 12},
974 { 0, 4, 8, 12, 16, 12},
975 { 0, 4, 8, 16, 16, 12},
976 {16, 4, 8, 6, 0, 12},
977 {16, 4, 8, 4, 0, 12},
978 {16, 4, 8, 0, 0, 12},
979 {16, 4, 8, 10, 0, 12},
980 {16, 4, 8, 12, 0, 12},
981 {16, 4, 8, 16, 0, 12},
985 mjr::ramCanvas1c8b::colorType aColor(mjr::ramCanvas1c8b::colorType::cornerColorEnum::WHITE);
986 mjr::ramCanvas3c8b::colorType bColor(mjr::ramCanvas3c8b::colorType::cornerColorEnum::BLUE);
987 mjr::ramCanvas3c8b::colorType cColor(mjr::ramCanvas3c8b::colorType::cornerColorEnum::GREEN);
988 mjr::ramCanvas3c8b::colorType dColor(mjr::ramCanvas3c8b::colorType::cornerColorEnum::RED);
990 mjr::ramCanvas1c8b aRamCanvas(163, 163); mjr::ramCanvas1c8b RaRamCanvas(163, 163);
991 mjr::ramCanvas1c8b bRamCanvas(163, 163);
992 mjr::ramCanvas1c8b cRamCanvas(163, 163);
993 mjr::ramCanvas1c8b dRamCanvas(163, 163);
994 mjr::ramCanvas1c8b eRamCanvas(163, 163);
995 mjr::ramCanvas1c8b fRamCanvas(163, 163);
997 mjr::ramCanvas1c8b gRamCanvas(163, 163); mjr::ramCanvas1c8b RgRamCanvas(163, 163);
998 mjr::ramCanvas1c8b hRamCanvas(163, 163);
999 mjr::ramCanvas1c8b iRamCanvas(163, 163);
1000 mjr::ramCanvas1c8b jRamCanvas(163, 163);
1001 mjr::ramCanvas1c8b kRamCanvas(163, 163);
1002 mjr::ramCanvas1c8b lRamCanvas(163, 163);
1004 mjr::ramCanvas3c8b mRamCanvas(163, 163); mjr::ramCanvas3c8b RmRamCanvas(163, 163);
1005 mjr::ramCanvas3c8b nRamCanvas(163, 163);
1006 mjr::ramCanvas3c8b oRamCanvas(163, 163);
1007 mjr::ramCanvas3c8b pRamCanvas(163, 163);
1008 mjr::ramCanvas3c8b qRamCanvas(163, 163);
1009 mjr::ramCanvas3c8b rRamCanvas(163, 163);
1011 for(
int i=0; i<9; i++) {
1012 for(
int j=0; j<9; j++) {
1013 unsigned k = i + j * 9;
1014 if (k < tri.size()) {
1018 aRamCanvas.drawTriangle(xo+pts[0], yo+pts[1], xo+pts[2], yo+pts[3], xo+pts[4], yo+pts[5], aColor);
1019 bRamCanvas.drawTriangle(xo+pts[2], yo+pts[3], xo+pts[4], yo+pts[5], xo+pts[0], yo+pts[1], aColor);
1020 cRamCanvas.drawTriangle(xo+pts[4], yo+pts[5], xo+pts[0], yo+pts[1], xo+pts[2], yo+pts[3], aColor);
1021 dRamCanvas.drawTriangle(xo+pts[4], yo+pts[5], xo+pts[2], yo+pts[3], xo+pts[0], yo+pts[1], aColor);
1022 eRamCanvas.drawTriangle(xo+pts[2], yo+pts[3], xo+pts[0], yo+pts[1], xo+pts[4], yo+pts[5], aColor);
1023 fRamCanvas.drawTriangle(xo+pts[0], yo+pts[1], xo+pts[4], yo+pts[5], xo+pts[2], yo+pts[3], aColor);
1025 gRamCanvas.drawFillTriangle(xo+pts[0], yo+pts[1], xo+pts[2], yo+pts[3], xo+pts[4], yo+pts[5], aColor);
1026 hRamCanvas.drawFillTriangle(xo+pts[2], yo+pts[3], xo+pts[4], yo+pts[5], xo+pts[0], yo+pts[1], aColor);
1027 iRamCanvas.drawFillTriangle(xo+pts[4], yo+pts[5], xo+pts[0], yo+pts[1], xo+pts[2], yo+pts[3], aColor);
1028 jRamCanvas.drawFillTriangle(xo+pts[4], yo+pts[5], xo+pts[2], yo+pts[3], xo+pts[0], yo+pts[1], aColor);
1029 kRamCanvas.drawFillTriangle(xo+pts[2], yo+pts[3], xo+pts[0], yo+pts[1], xo+pts[4], yo+pts[5], aColor);
1030 lRamCanvas.drawFillTriangle(xo+pts[0], yo+pts[1], xo+pts[4], yo+pts[5], xo+pts[2], yo+pts[3], aColor);
1033 mRamCanvas.drawFillTriangle(xo+pts[0], yo+pts[1], xo+pts[2], yo+pts[3], xo+pts[4], yo+pts[5], bColor, cColor, dColor);
1034 nRamCanvas.drawFillTriangle(xo+pts[2], yo+pts[3], xo+pts[4], yo+pts[5], xo+pts[0], yo+pts[1], cColor, dColor, bColor);
1035 oRamCanvas.drawFillTriangle(xo+pts[4], yo+pts[5], xo+pts[0], yo+pts[1], xo+pts[2], yo+pts[3], dColor, bColor, cColor);
1036 pRamCanvas.drawFillTriangle(xo+pts[4], yo+pts[5], xo+pts[2], yo+pts[3], xo+pts[0], yo+pts[1], dColor, cColor, bColor);
1037 qRamCanvas.drawFillTriangle(xo+pts[2], yo+pts[3], xo+pts[0], yo+pts[1], xo+pts[4], yo+pts[5], cColor, bColor, dColor);
1038 rRamCanvas.drawFillTriangle(xo+pts[0], yo+pts[1], xo+pts[4], yo+pts[5], xo+pts[2], yo+pts[3], bColor, dColor, cColor);
1043 BOOST_CHECK_EQUAL_COLLECTIONS(aRamCanvas.begin(), aRamCanvas.end(), bRamCanvas.begin(), bRamCanvas.end());
1044 BOOST_CHECK_EQUAL_COLLECTIONS(aRamCanvas.begin(), aRamCanvas.end(), cRamCanvas.begin(), cRamCanvas.end());
1045 BOOST_CHECK_EQUAL_COLLECTIONS(aRamCanvas.begin(), aRamCanvas.end(), dRamCanvas.begin(), dRamCanvas.end());
1046 BOOST_CHECK_EQUAL_COLLECTIONS(aRamCanvas.begin(), aRamCanvas.end(), eRamCanvas.begin(), eRamCanvas.end());
1047 BOOST_CHECK_EQUAL_COLLECTIONS(aRamCanvas.begin(), aRamCanvas.end(), fRamCanvas.begin(), fRamCanvas.end());
1049 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-triangles-a.mrw") == 0);
1050 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1052 BOOST_CHECK_EQUAL_COLLECTIONS(gRamCanvas.begin(), gRamCanvas.end(), hRamCanvas.begin(), hRamCanvas.end());
1053 BOOST_CHECK_EQUAL_COLLECTIONS(gRamCanvas.begin(), gRamCanvas.end(), iRamCanvas.begin(), iRamCanvas.end());
1054 BOOST_CHECK_EQUAL_COLLECTIONS(gRamCanvas.begin(), gRamCanvas.end(), jRamCanvas.begin(), jRamCanvas.end());
1055 BOOST_CHECK_EQUAL_COLLECTIONS(gRamCanvas.begin(), gRamCanvas.end(), kRamCanvas.begin(), kRamCanvas.end());
1056 BOOST_CHECK_EQUAL_COLLECTIONS(gRamCanvas.begin(), gRamCanvas.end(), lRamCanvas.begin(), lRamCanvas.end());
1058 BOOST_TEST_CHECK(RgRamCanvas.readRAWfile(
"../data/utest/ut-triangles-g.mrw") == 0);
1059 BOOST_TEST_CHECK(RgRamCanvas.isEqual(gRamCanvas) ==
true);
1061 BOOST_CHECK_EQUAL_COLLECTIONS(mRamCanvas.begin(), mRamCanvas.end(), nRamCanvas.begin(), nRamCanvas.end());
1062 BOOST_CHECK_EQUAL_COLLECTIONS(mRamCanvas.begin(), mRamCanvas.end(), oRamCanvas.begin(), oRamCanvas.end());
1063 BOOST_CHECK_EQUAL_COLLECTIONS(mRamCanvas.begin(), mRamCanvas.end(), pRamCanvas.begin(), pRamCanvas.end());
1064 BOOST_CHECK_EQUAL_COLLECTIONS(mRamCanvas.begin(), mRamCanvas.end(), qRamCanvas.begin(), qRamCanvas.end());
1065 BOOST_CHECK_EQUAL_COLLECTIONS(mRamCanvas.begin(), mRamCanvas.end(), rRamCanvas.begin(), rRamCanvas.end());
1067 BOOST_TEST_CHECK(RmRamCanvas.readRAWfile(
"../data/utest/ut-triangles-m.mrw") == 0);
1068 BOOST_TEST_CHECK(RmRamCanvas.isEqual(mRamCanvas) ==
true);
1070 aRamCanvas.writeRAWfile(
"ut-triangles-a.mrw");
1071 bRamCanvas.writeRAWfile(
"ut-triangles-b.mrw");
1072 cRamCanvas.writeRAWfile(
"ut-triangles-c.mrw");
1073 dRamCanvas.writeRAWfile(
"ut-triangles-d.mrw");
1074 eRamCanvas.writeRAWfile(
"ut-triangles-e.mrw");
1075 fRamCanvas.writeRAWfile(
"ut-triangles-f.mrw");
1077 aRamCanvas.scaleUpProximal(8);
1078 bRamCanvas.scaleUpProximal(8);
1079 cRamCanvas.scaleUpProximal(8);
1080 dRamCanvas.scaleUpProximal(8);
1081 eRamCanvas.scaleUpProximal(8);
1082 fRamCanvas.scaleUpProximal(8);
1084 aRamCanvas.writeTIFFfile(
"ut-triangles-a.tiff");
1085 bRamCanvas.writeTIFFfile(
"ut-triangles-b.tiff");
1086 cRamCanvas.writeTIFFfile(
"ut-triangles-c.tiff");
1087 dRamCanvas.writeTIFFfile(
"ut-triangles-d.tiff");
1088 eRamCanvas.writeTIFFfile(
"ut-triangles-e.tiff");
1089 fRamCanvas.writeTIFFfile(
"ut-triangles-f.tiff");
1091 gRamCanvas.writeRAWfile(
"ut-triangles-g.mrw");
1092 hRamCanvas.writeRAWfile(
"ut-triangles-h.mrw");
1093 iRamCanvas.writeRAWfile(
"ut-triangles-i.mrw");
1094 jRamCanvas.writeRAWfile(
"ut-triangles-j.mrw");
1095 kRamCanvas.writeRAWfile(
"ut-triangles-k.mrw");
1096 lRamCanvas.writeRAWfile(
"ut-triangles-l.mrw");
1098 gRamCanvas.scaleUpProximal(8);
1099 hRamCanvas.scaleUpProximal(8);
1100 iRamCanvas.scaleUpProximal(8);
1101 jRamCanvas.scaleUpProximal(8);
1102 kRamCanvas.scaleUpProximal(8);
1103 lRamCanvas.scaleUpProximal(8);
1105 gRamCanvas.writeTIFFfile(
"ut-triangles-g.tiff");
1106 hRamCanvas.writeTIFFfile(
"ut-triangles-h.tiff");
1107 iRamCanvas.writeTIFFfile(
"ut-triangles-i.tiff");
1108 jRamCanvas.writeTIFFfile(
"ut-triangles-j.tiff");
1109 kRamCanvas.writeTIFFfile(
"ut-triangles-k.tiff");
1110 lRamCanvas.writeTIFFfile(
"ut-triangles-l.tiff");
1112 mRamCanvas.writeRAWfile(
"ut-triangles-m.mrw");
1113 nRamCanvas.writeRAWfile(
"ut-triangles-n.mrw");
1114 oRamCanvas.writeRAWfile(
"ut-triangles-o.mrw");
1115 pRamCanvas.writeRAWfile(
"ut-triangles-p.mrw");
1116 qRamCanvas.writeRAWfile(
"ut-triangles-q.mrw");
1117 rRamCanvas.writeRAWfile(
"ut-triangles-r.mrw");
1119 mRamCanvas.scaleUpProximal(8);
1120 nRamCanvas.scaleUpProximal(8);
1121 oRamCanvas.scaleUpProximal(8);
1122 pRamCanvas.scaleUpProximal(8);
1123 qRamCanvas.scaleUpProximal(8);
1124 rRamCanvas.scaleUpProximal(8);
1126 mRamCanvas.writeTIFFfile(
"ut-triangles-m.tiff");
1127 nRamCanvas.writeTIFFfile(
"ut-triangles-n.tiff");
1128 oRamCanvas.writeTIFFfile(
"ut-triangles-o.tiff");
1129 pRamCanvas.writeTIFFfile(
"ut-triangles-p.tiff");
1130 qRamCanvas.writeTIFFfile(
"ut-triangles-q.tiff");
1131 rRamCanvas.writeTIFFfile(
"ut-triangles-r.tiff");
1135BOOST_AUTO_TEST_CASE(circles) {
1137 mjr::color1c8b aColor(mjr::color1c8b::cornerColorEnum::WHITE);
1138 mjr::color1c8b bColor(mjr::color1c8b::cornerColorEnum::BLACK);
1140 mjr::ramCanvas1c8b aRamCanvas(63, 63); mjr::ramCanvas1c8b RaRamCanvas(63, 63);
1141 for(
int i=2; i<32; i+=2)
1142 aRamCanvas.drawCircle(31, 31, i, aColor);
1143 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-circles-a.mrw") == 0);
1144 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1146 mjr::ramCanvas1c8b bRamCanvas(63, 63); mjr::ramCanvas1c8b RbRamCanvas(63, 63);
1147 bRamCanvas.drawFillCircle(31, 31, 30, aColor);
1148 BOOST_TEST_CHECK(RbRamCanvas.readRAWfile(
"../data/utest/ut-circles-b.mrw") == 0);
1149 BOOST_TEST_CHECK(RbRamCanvas.isEqual(bRamCanvas) ==
true);
1151 mjr::ramCanvas1c8b cRamCanvas(32, 32); mjr::ramCanvas1c8b RcRamCanvas(32, 32);
1152 cRamCanvas.drawCircle(31, 31, 16, aColor);
1153 cRamCanvas.drawCircle(16, -5, 15, aColor);
1154 cRamCanvas.drawCircle(5, 20, 8, aColor);
1155 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-circles-c.mrw") == 0);
1156 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
1158 mjr::ramCanvas1c8b dRamCanvas(32, 32); mjr::ramCanvas1c8b RdRamCanvas(32, 32);
1159 dRamCanvas.drawFillCircle(31, 31, 16, aColor);
1160 dRamCanvas.drawFillCircle(16, -5, 15, aColor);
1161 dRamCanvas.drawFillCircle(5, 20, 8, aColor);
1162 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-circles-d.mrw") == 0);
1163 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
1165 mjr::ramCanvas1c8b eRamCanvas(32, 32); mjr::ramCanvas1c8b ReRamCanvas(32, 32);
1166 eRamCanvas.drawFillCircle(16, 16, 17, aColor);
1167 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-circles-e.mrw") == 0);
1168 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
1170 mjr::ramCanvas1c8b fRamCanvas(32, 32); mjr::ramCanvas1c8b RfRamCanvas(32, 32);
1171 fRamCanvas.drawFillCircle(16, 16, 50, aColor);
1172 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-circles-f.mrw") == 0);
1173 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
1175 aRamCanvas.writeRAWfile(
"ut-circles-a.mrw");
1176 aRamCanvas.scaleUpProximal(8);
1177 aRamCanvas.writeTIFFfile(
"ut-circles-a.tiff");
1179 bRamCanvas.writeRAWfile(
"ut-circles-b.mrw");
1180 bRamCanvas.scaleUpProximal(8);
1181 bRamCanvas.writeTIFFfile(
"ut-circles-b.tiff");
1183 cRamCanvas.writeRAWfile(
"ut-circles-c.mrw");
1184 cRamCanvas.scaleUpProximal(20);
1185 cRamCanvas.writeTIFFfile(
"ut-circles-c.tiff");
1187 dRamCanvas.writeRAWfile(
"ut-circles-d.mrw");
1188 dRamCanvas.scaleUpProximal(20);
1189 dRamCanvas.writeTIFFfile(
"ut-circles-d.tiff");
1191 eRamCanvas.writeRAWfile(
"ut-circles-e.mrw");
1192 eRamCanvas.scaleUpProximal(20);
1193 eRamCanvas.writeTIFFfile(
"ut-circles-e.tiff");
1195 fRamCanvas.writeRAWfile(
"ut-circles-f.mrw");
1196 fRamCanvas.scaleUpProximal(20);
1197 fRamCanvas.writeTIFFfile(
"ut-circles-f.tiff");
1201BOOST_AUTO_TEST_CASE(rectanglesO) {
1205 mjr::ramCanvas1c8b::colorType aColor(mjr::ramCanvas1c8b::colorType::cornerColorEnum::WHITE);
1208 mjr::ramCanvas1c8b aRamCanvas(9, 9); mjr::ramCanvas1c8b RaRamCanvas(9, 9);
1209 aRamCanvas.drawRectangle(1, 1, 7, 7, aColor);
1210 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-a.mrw") == 0);
1211 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1213 mjr::ramCanvas1c8b bRamCanvas(9, 9);
1214 bRamCanvas.clrCanvasToBlack();
1215 bRamCanvas.drawRectangle(1, 1, 7, 7, aColor);
1216 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1218 bRamCanvas.clrCanvasToBlack();
1219 bRamCanvas.drawRectangle(7, 1, 1, 7, aColor);
1220 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1222 bRamCanvas.clrCanvasToBlack();
1223 bRamCanvas.drawRectangle(1, 7, 7, 1, aColor);
1224 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1226 bRamCanvas.clrCanvasToBlack();
1227 bRamCanvas.drawRectangle(7, 7, 1, 1, aColor);
1228 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1231 mjr::ramCanvas1c8b cRamCanvas(9, 9); mjr::ramCanvas1c8b RcRamCanvas(9, 9);
1232 cRamCanvas.drawRectangle(-4, -2, 25, 12, aColor);
1233 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-c.mrw") == 0);
1234 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
1237 mjr::ramCanvas1c8b dRamCanvas(9, 9); mjr::ramCanvas1c8b RdRamCanvas(9, 9);
1238 dRamCanvas.drawRectangle(-9, 2, -4, 7, aColor);
1239 dRamCanvas.drawRectangle(16, 2, 24, 7, aColor);
1240 dRamCanvas.drawRectangle( 2, 12, 7, 17, aColor);
1241 dRamCanvas.drawRectangle( 2, -17, 7, -10, aColor);
1242 dRamCanvas.drawRectangle(-9, -15, -4, -7, aColor);
1243 dRamCanvas.drawRectangle(10, 15, 14, 17, aColor);
1244 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-d.mrw") == 0);
1245 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
1248 mjr::ramCanvas1c8b eRamCanvas(9, 9); mjr::ramCanvas1c8b ReRamCanvas(9, 9);
1249 eRamCanvas.drawRectangle( 6, 6, 12, 12, aColor);
1250 eRamCanvas.drawRectangle( 6, 2, 12, -12, aColor);
1251 eRamCanvas.drawRectangle(-6, 6, 2, 16, aColor);
1252 eRamCanvas.drawRectangle(-6, -6, 2, 2, aColor);
1253 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-e.mrw") == 0);
1254 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
1257 mjr::ramCanvas1c8b fRamCanvas(9, 9); mjr::ramCanvas1c8b RfRamCanvas(9, 9);
1258 fRamCanvas.drawRectangle( 2, 7, 6, 12, aColor);
1259 fRamCanvas.drawRectangle( 7, 2, 20, 6, aColor);
1260 fRamCanvas.drawRectangle(-6, 2, 1, 6, aColor);
1261 fRamCanvas.drawRectangle( 2, -27, 6, 1, aColor);
1262 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-f.mrw") == 0);
1263 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
1266 mjr::ramCanvas1c8b gRamCanvas(9, 9); mjr::ramCanvas1c8b RgRamCanvas(9, 9);
1267 gRamCanvas.drawRectangle(-3, 7, 26, 12, aColor);
1268 gRamCanvas.drawRectangle(-4, -27, 30, 1, aColor);
1269 BOOST_TEST_CHECK(RgRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-g.mrw") == 0);
1270 BOOST_TEST_CHECK(RgRamCanvas.isEqual(gRamCanvas) ==
true);
1273 mjr::ramCanvas1c8b hRamCanvas(9, 9); mjr::ramCanvas1c8b RhRamCanvas(9, 9);
1274 hRamCanvas.drawRectangle( 7, -2, 20, 36, aColor);
1275 hRamCanvas.drawRectangle(-6, -5, 1, 16, aColor);
1276 BOOST_TEST_CHECK(RhRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesO-h.mrw") == 0);
1277 BOOST_TEST_CHECK(RhRamCanvas.isEqual(hRamCanvas) ==
true);
1279 aRamCanvas.writeRAWfile(
"ut-rectanglesO-a.mrw");
1280 aRamCanvas.scaleUpProximal(20);
1281 aRamCanvas.writeTIFFfile(
"ut-rectanglesO-a.tiff");
1283 cRamCanvas.writeRAWfile(
"ut-rectanglesO-c.mrw");
1284 cRamCanvas.scaleUpProximal(20);
1285 cRamCanvas.writeTIFFfile(
"ut-rectanglesO-c.tiff");
1287 dRamCanvas.writeRAWfile(
"ut-rectanglesO-d.mrw");
1288 dRamCanvas.scaleUpProximal(20);
1289 dRamCanvas.writeTIFFfile(
"ut-rectanglesO-d.tiff");
1291 eRamCanvas.writeRAWfile(
"ut-rectanglesO-e.mrw");
1292 eRamCanvas.scaleUpProximal(20);
1293 eRamCanvas.writeTIFFfile(
"ut-rectanglesO-e.tiff");
1295 fRamCanvas.writeRAWfile(
"ut-rectanglesO-f.mrw");
1296 fRamCanvas.scaleUpProximal(20);
1297 fRamCanvas.writeTIFFfile(
"ut-rectanglesO-f.tiff");
1299 gRamCanvas.writeRAWfile(
"ut-rectanglesO-g.mrw");
1300 gRamCanvas.scaleUpProximal(20);
1301 gRamCanvas.writeTIFFfile(
"ut-rectanglesO-g.tiff");
1303 hRamCanvas.writeRAWfile(
"ut-rectanglesO-h.mrw");
1304 hRamCanvas.scaleUpProximal(20);
1305 hRamCanvas.writeTIFFfile(
"ut-rectanglesO-h.tiff");
1310BOOST_AUTO_TEST_CASE(rectanglesF) {
1314 mjr::ramCanvas1c8b::colorType aColor(mjr::ramCanvas1c8b::colorType::cornerColorEnum::WHITE);
1317 mjr::ramCanvas1c8b aRamCanvas(9, 9); mjr::ramCanvas1c8b RaRamCanvas(9, 9);
1318 aRamCanvas.drawFillRectangle(1, 1, 7, 7, aColor);
1319 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-a.mrw") == 0);
1320 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1322 mjr::ramCanvas1c8b bRamCanvas(9, 9);
1323 bRamCanvas.clrCanvasToBlack();
1324 bRamCanvas.drawFillRectangle(1, 1, 7, 7, aColor);
1325 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1327 bRamCanvas.clrCanvasToBlack();
1328 bRamCanvas.drawFillRectangle(7, 1, 1, 7, aColor);
1329 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1331 bRamCanvas.clrCanvasToBlack();
1332 bRamCanvas.drawFillRectangle(1, 7, 7, 1, aColor);
1333 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1335 bRamCanvas.clrCanvasToBlack();
1336 bRamCanvas.drawFillRectangle(7, 7, 1, 1, aColor);
1337 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1340 mjr::ramCanvas1c8b cRamCanvas(9, 9); mjr::ramCanvas1c8b RcRamCanvas(9, 9);
1341 cRamCanvas.drawFillRectangle(-4, -2, 25, 12, aColor);
1342 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-c.mrw") == 0);
1343 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
1346 mjr::ramCanvas1c8b dRamCanvas(9, 9); mjr::ramCanvas1c8b RdRamCanvas(9, 9);
1347 dRamCanvas.drawFillRectangle(-9, 2, -4, 7, aColor);
1348 dRamCanvas.drawFillRectangle(16, 2, 24, 7, aColor);
1349 dRamCanvas.drawFillRectangle( 2, 12, 7, 17, aColor);
1350 dRamCanvas.drawFillRectangle( 2, -17, 7, -10, aColor);
1351 dRamCanvas.drawFillRectangle(-9, -15, -4, -7, aColor);
1352 dRamCanvas.drawFillRectangle(10, 15, 14, 17, aColor);
1353 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-d.mrw") == 0);
1354 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
1357 mjr::ramCanvas1c8b eRamCanvas(9, 9); mjr::ramCanvas1c8b ReRamCanvas(9, 9);
1358 eRamCanvas.drawFillRectangle( 6, 6, 12, 12, aColor);
1359 eRamCanvas.drawFillRectangle( 6, 2, 12, -12, aColor);
1360 eRamCanvas.drawFillRectangle(-6, 6, 2, 16, aColor);
1361 eRamCanvas.drawFillRectangle(-6, -6, 2, 2, aColor);
1362 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-e.mrw") == 0);
1363 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
1366 mjr::ramCanvas1c8b fRamCanvas(9, 9); mjr::ramCanvas1c8b RfRamCanvas(9, 9);
1367 fRamCanvas.drawFillRectangle( 2, 7, 6, 12, aColor);
1368 fRamCanvas.drawFillRectangle( 7, 2, 20, 6, aColor);
1369 fRamCanvas.drawFillRectangle(-6, 2, 1, 6, aColor);
1370 fRamCanvas.drawFillRectangle( 2, -27, 6, 1, aColor);
1371 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-f.mrw") == 0);
1372 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
1375 mjr::ramCanvas1c8b gRamCanvas(9, 9); mjr::ramCanvas1c8b RgRamCanvas(9, 9);
1376 gRamCanvas.drawFillRectangle(-3, 7, 26, 12, aColor);
1377 gRamCanvas.drawFillRectangle(-4, -27, 30, 1, aColor);
1378 BOOST_TEST_CHECK(RgRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-g.mrw") == 0);
1379 BOOST_TEST_CHECK(RgRamCanvas.isEqual(gRamCanvas) ==
true);
1382 mjr::ramCanvas1c8b hRamCanvas(9, 9); mjr::ramCanvas1c8b RhRamCanvas(9, 9);
1383 hRamCanvas.drawFillRectangle( 7, -2, 20, 36, aColor);
1384 hRamCanvas.drawFillRectangle(-6, -5, 1, 16, aColor);
1385 BOOST_TEST_CHECK(RhRamCanvas.readRAWfile(
"../data/utest/ut-rectanglesF-h.mrw") == 0);
1386 BOOST_TEST_CHECK(RhRamCanvas.isEqual(hRamCanvas) ==
true);
1388 aRamCanvas.writeRAWfile(
"ut-rectanglesF-a.mrw");
1389 aRamCanvas.scaleUpProximal(20);
1390 aRamCanvas.writeTIFFfile(
"ut-rectanglesF-a.tiff");
1392 cRamCanvas.writeRAWfile(
"ut-rectanglesF-c.mrw");
1393 cRamCanvas.scaleUpProximal(20);
1394 cRamCanvas.writeTIFFfile(
"ut-rectanglesF-c.tiff");
1396 dRamCanvas.writeRAWfile(
"ut-rectanglesF-d.mrw");
1397 dRamCanvas.scaleUpProximal(20);
1398 dRamCanvas.writeTIFFfile(
"ut-rectanglesF-d.tiff");
1400 eRamCanvas.writeRAWfile(
"ut-rectanglesF-e.mrw");
1401 eRamCanvas.scaleUpProximal(20);
1402 eRamCanvas.writeTIFFfile(
"ut-rectanglesF-e.tiff");
1404 fRamCanvas.writeRAWfile(
"ut-rectanglesF-f.mrw");
1405 fRamCanvas.scaleUpProximal(20);
1406 fRamCanvas.writeTIFFfile(
"ut-rectanglesF-f.tiff");
1408 gRamCanvas.writeRAWfile(
"ut-rectanglesF-g.mrw");
1409 gRamCanvas.scaleUpProximal(20);
1410 gRamCanvas.writeTIFFfile(
"ut-rectanglesF-g.tiff");
1412 hRamCanvas.writeRAWfile(
"ut-rectanglesF-h.mrw");
1413 hRamCanvas.scaleUpProximal(20);
1414 hRamCanvas.writeTIFFfile(
"ut-rectanglesF-h.tiff");
1418BOOST_AUTO_TEST_CASE(draw_point) {
1420 mjr::ramCanvasRGB8b aRamCanvas(20, 20, 0.0, 19.0, 0.0, 19.0); mjr::ramCanvasRGB8b RaRamCanvas(20, 20, 0.0, 19.0, 0.0, 19.0);
1421 aRamCanvas.setRealAxOrientationY(mjr::ramCanvasRGB8b::realAxisOrientation::INVERTED);
1422 mjr::colorRGB8b aColor(mjr::colorRGB8b::cornerColorEnum::RED);
1423 mjr::colorRGB8b bColor(mjr::colorRGB8b::cornerColorEnum::BLUE);
1424 mjr::colorRGB8b cColor(mjr::colorRGB8b::cornerColorEnum::MAGENTA);
1425 mjr::colorRGB8b dColor(mjr::colorRGB8b::cornerColorEnum::CYAN);
1428 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType({2, 2}), aColor);
1429 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(4, 2), bColor);
1430 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(std::tuple<int,int>(6, 2)), aColor);
1431 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(std::tuple<int,short>(8, 2)), bColor);
1432 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(std::complex<int>(10, 2)), aColor);
1433 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(std::vector<int>({14, 2})), aColor);
1434 int aArI[2] = {16, 2};
1435 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(aArI), bColor);
1436 int aArS[2] = {18, 2};
1437 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointIntType(aArS), aColor);
1440 aRamCanvas.drawPoint(std::complex<int>(2, 4), bColor);
1441 aRamCanvas.drawPoint(std::tuple<int,int>(4, 4), aColor);
1442 aRamCanvas.drawPoint(std::vector<int>({6, 4}), bColor);
1445 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType({2, 2}), cColor);
1446 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(4, 2), dColor);
1447 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(std::tuple<int,int>(6, 2)), cColor);
1448 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(std::tuple<int,short>(8, 2)), dColor);
1449 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(std::complex<double>(10, 2)), cColor);
1450 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(std::complex<double>(12, 2)), dColor);
1451 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(std::vector<double>({14, 2})), cColor);
1452 double aArD[2] = {16, 2};
1453 aRamCanvas.drawPoint(mjr::ramCanvasRGB8b::pointFltType(aArD), dColor);
1456 aRamCanvas.drawPoint(std::complex<double>(2, 4), dColor);
1457 aRamCanvas.drawPoint(std::tuple<double,double>(4, 4), cColor);
1458 aRamCanvas.drawPoint(std::vector<double>({6, 4}), dColor);
1461 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-points-a.mrw") == 0);
1462 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1465 aRamCanvas.writeRAWfile(
"ut-points-a.mrw");
1466 aRamCanvas.scaleUpProximal(20);
1467 aRamCanvas.writeTIFFfile(
"ut-points-a.tiff");
1471BOOST_AUTO_TEST_CASE(lines_ep_swap) {
1475 mjr::ramCanvas1c8b aRamCanvas(16, 16);
1476 mjr::ramCanvas1c8b bRamCanvas(16, 16);
1477 mjr::ramCanvas1c8b::colorType aColor(mjr::ramCanvas1c8b::colorType::cornerColorEnum::WHITE);
1480 for(
int i=0; i<16; i++) {
1485 aRamCanvas.clrCanvasToBlack();
1486 aRamCanvas.drawLine(x1, y1, x2, y2, aColor);
1487 bRamCanvas.clrCanvasToBlack();
1488 bRamCanvas.drawLine(x2, y2, x1, y1, aColor);
1489 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1494 aRamCanvas.clrCanvasToBlack();
1495 aRamCanvas.drawLine(x1, y1, x2, y2, aColor);
1496 bRamCanvas.clrCanvasToBlack();
1497 bRamCanvas.drawLine(x2, y2, x1, y1, aColor);
1498 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1504 aRamCanvas.clrCanvasToBlack();
1505 aRamCanvas.drawLine(x1, y1, x2, y2, aColor);
1506 bRamCanvas.clrCanvasToBlack();
1507 bRamCanvas.drawLine(x2, y2, x1, y1, aColor);
1508 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1514 aRamCanvas.clrCanvasToBlack();
1515 aRamCanvas.drawLine(x1, y1, x2, y2, aColor);
1516 bRamCanvas.clrCanvasToBlack();
1517 bRamCanvas.drawLine(x2, y2, x1, y1, aColor);
1518 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1524 aRamCanvas.clrCanvasToBlack();
1525 aRamCanvas.drawLine(x1, y1, x2, y2, aColor);
1526 bRamCanvas.clrCanvasToBlack();
1527 bRamCanvas.drawLine(x2, y2, x1, y1, aColor);
1528 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1534 aRamCanvas.clrCanvasToBlack();
1535 aRamCanvas.drawLine(x1, y1, x2, y2, aColor);
1536 bRamCanvas.clrCanvasToBlack();
1537 bRamCanvas.drawLine(x2, y2, x1, y1, aColor);
1538 BOOST_TEST_CHECK(aRamCanvas.isEqual(bRamCanvas) ==
true);
1543BOOST_AUTO_TEST_CASE(btriangle) {
1545 mjr::ramCanvas3c8b aRamCanvas(153, 83); mjr::ramCanvas3c8b RaRamCanvas(153, 83);
1547 aRamCanvas.drawFillTriangle(81, 31, 1, 9, 51, 81,
"green",
"red",
"blue");
1548 aRamCanvas.drawTriangle (81, 31, 1, 9, 51, 81,
"white");
1550 aRamCanvas.drawFillTriangle(71, 1, 151, 31, 121, 81,
"red",
"green",
"blue");
1551 aRamCanvas.drawTriangle (71, 1, 151, 31, 121, 81,
"white");
1553 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-btriangle-a.mrw") == 0);
1554 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1556 aRamCanvas.writeRAWfile(
"ut-btriangle-a.mrw");
1557 aRamCanvas.scaleUpProximal(20);
1558 aRamCanvas.writeTIFFfile(
"ut-btriangle-a.tiff");
1562BOOST_AUTO_TEST_CASE(glyph_axis) {
1566 mjr::ramCanvas3c8b aRamCanvas(127, 127);
1567 aRamCanvas.drawLine(0, 63, 127, 63,
"blue");
1568 aRamCanvas.drawLine(63, 0, 63, 127,
"blue");
1569 aRamCanvas.setIntAxOrientationX(mjr::ramCanvas3c8b::intAxisOrientation::NATURAL);
1570 aRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::NATURAL);
1571 aRamCanvas.drawHersheyGlyph(505, 63, 63, 1, 1,
"red");
1572 aRamCanvas.drawHersheyGlyph(505, 63, 63, 2, 2,
"red");
1573 aRamCanvas.drawHersheyGlyph(505, 63, 63, 4, 4,
"red");
1575 aRamCanvas.writeRAWfile(
"ut-glyph_axis-a.mrw");
1576 aRamCanvas.scaleUpProximal(4);
1577 aRamCanvas.writeTIFFfile(
"ut-glyph_axis-a.tiff");
1579 mjr::ramCanvas3c8b bRamCanvas(127, 127);
1580 bRamCanvas.drawLine(0, 63, 127, 63,
"blue");
1581 bRamCanvas.drawLine(63, 0, 63, 127,
"blue");
1582 bRamCanvas.setIntAxOrientationX(mjr::ramCanvas3c8b::intAxisOrientation::NATURAL);
1583 bRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1584 bRamCanvas.drawHersheyGlyph(505, 63, 63, 1, 1,
"red");
1585 bRamCanvas.drawHersheyGlyph(505, 63, 63, 2, 2,
"red");
1586 bRamCanvas.drawHersheyGlyph(505, 63, 63, 4, 4,
"red");
1588 bRamCanvas.writeRAWfile(
"ut-glyph_axis-b.mrw");
1589 bRamCanvas.scaleUpProximal(4);
1590 bRamCanvas.writeTIFFfile(
"ut-glyph_axis-b.tiff");
1592 mjr::ramCanvas3c8b cRamCanvas(127, 127);
1593 cRamCanvas.drawLine(0, 63, 127, 63,
"blue");
1594 cRamCanvas.drawLine(63, 0, 63, 127,
"blue");
1595 cRamCanvas.setIntAxOrientationX(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1596 cRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::NATURAL);
1597 cRamCanvas.drawHersheyGlyph(505, 63, 63, 1, 1,
"red");
1598 cRamCanvas.drawHersheyGlyph(505, 63, 63, 2, 2,
"red");
1599 cRamCanvas.drawHersheyGlyph(505, 63, 63, 4, 4,
"red");
1601 cRamCanvas.writeRAWfile(
"ut-glyph_axis-c.mrw");
1602 cRamCanvas.scaleUpProximal(4);
1603 cRamCanvas.writeTIFFfile(
"ut-glyph_axis-c.tiff");
1605 mjr::ramCanvas3c8b dRamCanvas(127, 127);
1606 dRamCanvas.drawLine(0, 63, 127, 63,
"blue");
1607 dRamCanvas.drawLine(63, 0, 63, 127,
"blue");
1608 dRamCanvas.setIntAxOrientationX(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1609 dRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1610 dRamCanvas.drawHersheyGlyph(505, 63, 63, 1, 1,
"red");
1611 dRamCanvas.drawHersheyGlyph(505, 63, 63, 2, 2,
"red");
1612 dRamCanvas.drawHersheyGlyph(505, 63, 63, 4, 4,
"red");
1614 dRamCanvas.writeRAWfile(
"ut-glyph_axis-d.mrw");
1615 dRamCanvas.scaleUpProximal(4);
1616 dRamCanvas.writeTIFFfile(
"ut-glyph_axis-d.tiff");
1618 std::ifstream ifsag(
"ut-glyph_axis-a.mrw");
1619 std::ifstream ifsaar(
"../data/utest/ut-glyph_axis-a.mrw");
1620 std::istream_iterator<char> bag(ifsag), eag;
1621 std::istream_iterator<char> baar(ifsaar), eaar;
1622 BOOST_CHECK_EQUAL_COLLECTIONS(bag, eag, baar, eaar);
1624 std::ifstream ifsbg(
"ut-glyph_axis-b.mrw");
1625 std::ifstream ifsabr(
"../data/utest/ut-glyph_axis-a.mrw");
1626 std::istream_iterator<char> bbg(ifsbg), ebg;
1627 std::istream_iterator<char> babr(ifsabr), eabr;
1628 BOOST_CHECK_EQUAL_COLLECTIONS(bbg, ebg, babr, eabr);
1630 std::ifstream ifscg(
"ut-glyph_axis-c.mrw");
1631 std::ifstream ifsacr(
"../data/utest/ut-glyph_axis-a.mrw");
1632 std::istream_iterator<char> bcg(ifscg), ecg;
1633 std::istream_iterator<char> bacr(ifsacr), eacr;
1634 BOOST_CHECK_EQUAL_COLLECTIONS(bcg, ecg, bacr, eacr);
1636 std::ifstream ifsdg(
"ut-glyph_axis-d.mrw");
1637 std::ifstream ifsadr(
"../data/utest/ut-glyph_axis-a.mrw");
1638 std::istream_iterator<char> bdg(ifsdg), edg;
1639 std::istream_iterator<char> badr(ifsadr), eadr;
1640 BOOST_CHECK_EQUAL_COLLECTIONS(bdg, edg, badr, eadr);
1644BOOST_AUTO_TEST_CASE(strings) {
1646 mjr::ramCanvas3c8b aRamCanvas(450, 100); mjr::ramCanvas3c8b RaRamCanvas(450, 100);
1648 aRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1649 RaRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1650 aRamCanvas.drawLine(50, 0, 50, 512,
"blue");
1652 aRamCanvas.drawLine(0, y, 1024, y,
"blue");
1653 aRamCanvas.drawString(
"Hello, World!", mjr::hershey::font::ROMAN_SL_SANSERIF, 50, y,
"red", 1, 16);
1655 aRamCanvas.drawLine(0, y, 1024, y,
"blue");
1656 aRamCanvas.drawString(
"Hello, World!", mjr::hershey::font::ROMAN_SL_SANSERIF, 50, y,
"red", 2, 15);
1658 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-strings-a.mrw") == 0);
1659 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1661 mjr::ramCanvas3c8b bRamCanvas(450, 100); mjr::ramCanvas3c8b RbRamCanvas(450, 100);
1662 bRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1663 RbRamCanvas.setIntAxOrientationY(mjr::ramCanvas3c8b::intAxisOrientation::INVERTED);
1665 bRamCanvas.drawStringBox(
"Hello, World!", mjr::hershey::font::ROMAN_SL_SANSERIF, 50, y,
"red",
"green", 1, 16);
1666 bRamCanvas.drawLine(0, y, 1024, y,
"blue");
1668 bRamCanvas.drawStringBox(
"Hello, World!", mjr::hershey::font::ROMAN_SL_SANSERIF, 50, y,
"red",
"green", 2, 15);
1669 bRamCanvas.drawLine(0, y, 1024, y,
"blue");
1670 bRamCanvas.drawLine(50, 0, 50, 512,
"blue");
1672 BOOST_TEST_CHECK(RbRamCanvas.readRAWfile(
"../data/utest/ut-strings-b.mrw") == 0);
1673 BOOST_TEST_CHECK(RbRamCanvas.isEqual(bRamCanvas) ==
true);
1675 aRamCanvas.writeRAWfile(
"ut-strings-a.mrw");
1676 aRamCanvas.scaleUpProximal(4);
1677 aRamCanvas.writeTIFFfile(
"ut-strings-a.tiff");
1679 bRamCanvas.writeRAWfile(
"ut-strings-b.mrw");
1680 bRamCanvas.scaleUpProximal(4);
1681 bRamCanvas.writeTIFFfile(
"ut-strings-b.tiff");
1685BOOST_AUTO_TEST_CASE(geom_tfrm) {
1687 mjr::ramCanvas1c8b aRamCanvas(8, 8); mjr::ramCanvas1c8b RaRamCanvas(8, 8);
1690 aRamCanvas.drawLine(0, 0, 3, 0,
"white");
1691 aRamCanvas.drawLine(3, 7, 7, 7,
"white");
1692 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-a.mrw") == 0);
1693 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1696 mjr::ramCanvas1c8b bRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RbRamCanvas(8, 8);
1697 bRamCanvas.flipHorz();
1698 BOOST_TEST_CHECK(RbRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-b.mrw") == 0);
1699 BOOST_TEST_CHECK(RbRamCanvas.isEqual(bRamCanvas) ==
true);
1700 RbRamCanvas.flipHorz();
1701 BOOST_TEST_CHECK(RbRamCanvas.isEqual(aRamCanvas) ==
true);
1704 mjr::ramCanvas1c8b cRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RcRamCanvas(8, 8);
1705 cRamCanvas.flipVert();
1706 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-c.mrw") == 0);
1707 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
1708 RcRamCanvas.flipVert();
1709 BOOST_TEST_CHECK(RcRamCanvas.isEqual(aRamCanvas) ==
true);
1712 mjr::ramCanvas1c8b dRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RdRamCanvas(8, 8);
1713 dRamCanvas.flipTranspose();
1714 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-d.mrw") == 0);
1715 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
1716 RdRamCanvas.flipTranspose();
1717 BOOST_TEST_CHECK(RdRamCanvas.isEqual(aRamCanvas) ==
true);
1720 mjr::ramCanvas1c8b eRamCanvas(aRamCanvas); mjr::ramCanvas1c8b ReRamCanvas(8, 8);
1721 eRamCanvas.rotate90CW();
1722 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-e.mrw") == 0);
1723 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
1724 eRamCanvas.rotate90CCW();
1725 BOOST_TEST_CHECK(eRamCanvas.isEqual(aRamCanvas) ==
true);
1726 eRamCanvas.rotate90CW();
1727 eRamCanvas.rotate90CW();
1728 eRamCanvas.rotate90CW();
1729 eRamCanvas.rotate90CW();
1730 BOOST_TEST_CHECK(eRamCanvas.isEqual(aRamCanvas) ==
true);
1733 mjr::ramCanvas1c8b fRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RfRamCanvas(8, 8);
1734 fRamCanvas.rotate90CCW();
1735 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-f.mrw") == 0);
1736 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
1737 fRamCanvas.rotate90CW();
1738 BOOST_TEST_CHECK(fRamCanvas.isEqual(aRamCanvas) ==
true);
1739 fRamCanvas.rotate90CCW();
1740 fRamCanvas.rotate90CCW();
1741 fRamCanvas.rotate90CCW();
1742 fRamCanvas.rotate90CCW();
1743 BOOST_TEST_CHECK(fRamCanvas.isEqual(aRamCanvas) ==
true);
1746 mjr::ramCanvas1c8b gRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RgRamCanvas(8, 8);
1747 gRamCanvas.rotate180();
1748 BOOST_TEST_CHECK(RgRamCanvas.readRAWfile(
"../data/utest/ut-geom_tfrm-g.mrw") == 0);
1749 BOOST_TEST_CHECK(RgRamCanvas.isEqual(gRamCanvas) ==
true);
1750 gRamCanvas.rotate180();
1751 BOOST_TEST_CHECK(gRamCanvas.isEqual(aRamCanvas) ==
true);
1754 aRamCanvas.writeRAWfile(
"ut-geom_tfrm-a.mrw");
1755 aRamCanvas.scaleUpProximal(16);
1756 aRamCanvas.writeTIFFfile(
"ut-geom_tfrm-a.tiff");
1758 bRamCanvas.writeRAWfile(
"ut-geom_tfrm-b.mrw");
1759 bRamCanvas.scaleUpProximal(16);
1760 bRamCanvas.writeTIFFfile(
"ut-geom_tfrm-b.tiff");
1762 cRamCanvas.writeRAWfile(
"ut-geom_tfrm-c.mrw");
1763 cRamCanvas.scaleUpProximal(16);
1764 cRamCanvas.writeTIFFfile(
"ut-geom_tfrm-c.tiff");
1766 dRamCanvas.writeRAWfile(
"ut-geom_tfrm-d.mrw");
1767 dRamCanvas.scaleUpProximal(16);
1768 dRamCanvas.writeTIFFfile(
"ut-geom_tfrm-d.tiff");
1770 eRamCanvas.writeRAWfile(
"ut-geom_tfrm-e.mrw");
1771 eRamCanvas.scaleUpProximal(16);
1772 eRamCanvas.writeTIFFfile(
"ut-geom_tfrm-e.tiff");
1774 fRamCanvas.writeRAWfile(
"ut-geom_tfrm-f.mrw");
1775 fRamCanvas.scaleUpProximal(16);
1776 fRamCanvas.writeTIFFfile(
"ut-geom_tfrm-f.tiff");
1778 gRamCanvas.writeRAWfile(
"ut-geom_tfrm-g.mrw");
1779 gRamCanvas.scaleUpProximal(16);
1780 gRamCanvas.writeTIFFfile(
"ut-geom_tfrm-g.tiff");
1784BOOST_AUTO_TEST_CASE(p_scale) {
1786 mjr::ramCanvas1c8b aRamCanvas(4, 4); mjr::ramCanvas1c8b RaRamCanvas(8, 8);
1789 aRamCanvas.drawLine(0, 0, 4, 0,
"white");
1790 aRamCanvas.drawLine(0, 1, 4, 1,
"black");
1792 aRamCanvas.drawLine(2, 0, 2, 4,
"black");
1793 aRamCanvas.drawLine(3, 4, 3, 4,
"white");
1795 aRamCanvas.drawLine(0, 2, 4, 2,
"black");
1796 aRamCanvas.drawLine(0, 3, 4, 4,
"white");
1798 BOOST_TEST_CHECK(RaRamCanvas.readRAWfile(
"../data/utest/ut-p_scale-a.mrw") == 0);
1799 BOOST_TEST_CHECK(RaRamCanvas.isEqual(aRamCanvas) ==
true);
1802 mjr::ramCanvas1c8b bRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RbRamCanvas(8, 8);
1803 bRamCanvas.scaleDown1pt(2);
1804 BOOST_TEST_CHECK(RbRamCanvas.readRAWfile(
"../data/utest/ut-p_scale-b.mrw") == 0);
1805 BOOST_TEST_CHECK(RbRamCanvas.isEqual(bRamCanvas) ==
true);
1808 mjr::ramCanvas1c8b cRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RcRamCanvas(8, 8);
1809 cRamCanvas.scaleDownMax(2);
1810 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-p_scale-c.mrw") == 0);
1811 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
1814 mjr::ramCanvas1c8b dRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RdRamCanvas(8, 8);
1815 dRamCanvas.scaleDownMean(2);
1816 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-p_scale-d.mrw") == 0);
1817 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
1820 mjr::ramCanvas1c8b eRamCanvas(dRamCanvas); mjr::ramCanvas1c8b ReRamCanvas(8, 8);
1821 eRamCanvas.scaleUpProximal(2);
1822 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-p_scale-e.mrw") == 0);
1823 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
1826 aRamCanvas.writeRAWfile(
"ut-p_scale-a.mrw");
1827 aRamCanvas.scaleUpProximal(32);
1828 aRamCanvas.writeTIFFfile(
"ut-p_scale-a.tiff");
1830 bRamCanvas.writeRAWfile(
"ut-p_scale-b.mrw");
1831 bRamCanvas.scaleUpProximal(64);
1832 bRamCanvas.writeTIFFfile(
"ut-p_scale-b.tiff");
1834 cRamCanvas.writeRAWfile(
"ut-p_scale-c.mrw");
1835 cRamCanvas.scaleUpProximal(64);
1836 cRamCanvas.writeTIFFfile(
"ut-p_scale-c.tiff");
1838 dRamCanvas.writeRAWfile(
"ut-p_scale-d.mrw");
1839 dRamCanvas.scaleUpProximal(64);
1840 dRamCanvas.writeTIFFfile(
"ut-p_scale-d.tiff");
1842 eRamCanvas.writeRAWfile(
"ut-p_scale-e.mrw");
1843 eRamCanvas.scaleUpProximal(32);
1844 eRamCanvas.writeTIFFfile(
"ut-p_scale-e.tiff");
1848BOOST_AUTO_TEST_CASE(adjoin) {
1850 mjr::ramCanvas1c8b aRamCanvas(8, 8);
1851 aRamCanvas.drawRectangle(0, 0, 7, 7,
"white");
1852 aRamCanvas.drawLine(0, 7, 7, 0,
"white");
1854 mjr::ramCanvas1c8b bRamCanvas(8, 8);
1855 bRamCanvas.drawRectangle(0, 0, 7, 7,
"white");
1856 bRamCanvas.drawLine(0, 0, 7, 7,
"white");
1858 mjr::ramCanvas1c8b cRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RcRamCanvas(8, 8);
1859 cRamCanvas.adjoinCanvasRight(bRamCanvas);
1860 BOOST_TEST_CHECK(RcRamCanvas.readRAWfile(
"../data/utest/ut-adjoin-c.mrw") == 0);
1861 BOOST_TEST_CHECK(RcRamCanvas.isEqual(cRamCanvas) ==
true);
1863 mjr::ramCanvas1c8b dRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RdRamCanvas(8, 8);
1864 dRamCanvas.adjoinCanvasLeft(bRamCanvas);
1865 BOOST_TEST_CHECK(RdRamCanvas.readRAWfile(
"../data/utest/ut-adjoin-d.mrw") == 0);
1866 BOOST_TEST_CHECK(RdRamCanvas.isEqual(dRamCanvas) ==
true);
1868 mjr::ramCanvas1c8b eRamCanvas(aRamCanvas); mjr::ramCanvas1c8b ReRamCanvas(8, 8);
1869 eRamCanvas.adjoinCanvasBottom(bRamCanvas);
1870 BOOST_TEST_CHECK(ReRamCanvas.readRAWfile(
"../data/utest/ut-adjoin-e.mrw") == 0);
1871 BOOST_TEST_CHECK(ReRamCanvas.isEqual(eRamCanvas) ==
true);
1873 mjr::ramCanvas1c8b fRamCanvas(aRamCanvas); mjr::ramCanvas1c8b RfRamCanvas(8, 8);
1874 fRamCanvas.adjoinCanvasTop(bRamCanvas);
1875 BOOST_TEST_CHECK(RfRamCanvas.readRAWfile(
"../data/utest/ut-adjoin-f.mrw") == 0);
1876 BOOST_TEST_CHECK(RfRamCanvas.isEqual(fRamCanvas) ==
true);
1879 aRamCanvas.writeRAWfile(
"ut-adjoin-a.mrw");
1880 aRamCanvas.scaleUpProximal(32);
1881 aRamCanvas.writeTIFFfile(
"ut-adjoin-a.tiff");
1884 bRamCanvas.writeRAWfile(
"ut-adjoin-b.mrw");
1885 bRamCanvas.scaleUpProximal(32);
1886 bRamCanvas.writeTIFFfile(
"ut-adjoin-b.tiff");
1889 cRamCanvas.writeRAWfile(
"ut-adjoin-c.mrw");
1890 cRamCanvas.scaleUpProximal(32);
1891 cRamCanvas.writeTIFFfile(
"ut-adjoin-c.tiff");
1894 dRamCanvas.writeRAWfile(
"ut-adjoin-d.mrw");
1895 dRamCanvas.scaleUpProximal(32);
1896 dRamCanvas.writeTIFFfile(
"ut-adjoin-d.tiff");
1899 eRamCanvas.writeRAWfile(
"ut-adjoin-e.mrw");
1900 eRamCanvas.scaleUpProximal(32);
1901 eRamCanvas.writeTIFFfile(
"ut-adjoin-e.tiff");
1904 fRamCanvas.writeRAWfile(
"ut-adjoin-f.mrw");
1905 fRamCanvas.scaleUpProximal(32);
1906 fRamCanvas.writeTIFFfile(
"ut-adjoin-f.tiff");