Index: olena/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* olena/tests/level/tests/md5_level_set_level_hh0: Add file.
* olena/tests/level/tests/md5_level_threshold_hh0: Likewise.
+2004-03-23 Giovanni Palma <giovanni(a)lrde.epita.fr>
+
* tests/topo/tests/md5_topo_dmap_hh0: Add file.
* tests/topo/tests/md5_topo_tarjan_flat-zone_hh0: Likewise.
Index: olena/tests/level/tests/md5_level_threshold_hh0
--- olena/tests/level/tests/md5_level_threshold_hh0 Tue, 23 Mar 2004 15:57:58 +0100
palma_g ()
+++ olena/tests/level/tests/md5_level_threshold_hh0 Tue, 23 Mar 2004 12:08:28 +0100
palma_g (oln/m/14_md5_level_ 644)
@@ -0,0 +1,33 @@
+// -*- c++ -*-
+#include "data.hh"
+#include <oln/utils/md5.hh>
+
+#include "check.hh"
+#include <oln/basics2d.hh>
+#include <oln/level/threshold.hh>
+#include <ntg/all.hh>
+using namespace ntg;
+
+
+int main()
+{
+oln::utils::key::value_type data_key[16] = {0x98, 0xf0, 0x2f, 0x75, 0x92, 0x22, 0xbe,
0x3f, 0x36, 0x10, 0x44, 0x1e, 0x53, 0xf3, 0xb9, 0xce};
+
+oln::utils::key key(data_key);
+
+ oln::image2d<
+int_u8> in = oln::load(rdata("lena256.pgm"));
+
+int_u8 th = 127;
+ rgb_8 low = rgb_8(100, 0, 0);
+ rgb_8 height = rgb_8(0, 200, 255);
+ oln::image2d<rgb_8> out = apply(oln::level::threshold<
+int_u8, rgb_8 >(th, low, height), in);
+ if (oln::utils::md5(out) == key)
+ std::cout << "OK" << std::endl;
+else
+ {
+ std::cout << "FAIL" << std::endl;
+ return true;
+ }
+ }
Index: olena/tests/level/tests/md5_level_set_level_hh0
--- olena/tests/level/tests/md5_level_set_level_hh0 Tue, 23 Mar 2004 15:57:58 +0100
palma_g ()
+++ olena/tests/level/tests/md5_level_set_level_hh0 Tue, 23 Mar 2004 15:52:08 +0100
palma_g (oln/m/15_md5_level_ 644)
@@ -0,0 +1,37 @@
+// -*- c++ -*-
+#include "data.hh"
+#include <oln/utils/md5.hh>
+
+#include "check.hh"
+#include <oln/basics2d.hh>
+#include <oln/level/set_level.hh>
+#include <ntg/all.hh>
+
+int main()
+{
+ oln::utils::key::value_type data_key[16] = {0xdd, 0x90, 0x28, 0xf1, 0xd2,
+ 0x6f, 0xd3, 0xfb, 0x64, 0x60,
+ 0x80, 0xaa, 0x11, 0xbc, 0x3e,
+ 0xd6};
+
+ oln::utils::key key(data_key);
+
+ oln::image2d<ntg::int_u8> in = oln::load(rdata("lena256.pgm"));
+ oln::coord R = in.nrows();
+ oln::coord C = in.ncols();
+ oln::level::set_level(in,
+ oln::point2d(R * 1/4, C* 1/2),
+ oln::point2d(R * 4/5, C* 7/8),
+ 0);
+ oln::box<oln::point2d> b;
+ b.add(oln::point2d(R * 1/6, C * 1/6));
+ b.add(oln::point2d(R * 4/5, C * 1/3));
+ oln::level::set_level(in, b, 255);
+ if (oln::utils::md5(in) == key)
+ std::cout << "OK" << std::endl;
+ else
+ {
+ std::cout << "FAIL" << std::endl;
+ return true;
+ }
+}
--
Giovanni Palma
EPITA - promo 2005 - membre d'EpX - LRDE
Mob. : +33 (0)6 60 97 31 74