Commit beddc3b8 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Small fixes.

	* headers.mk: add new headers to distribution.

	* mln/core/internal/site_relative_iterator_base.hh: avoid a warning.

	* mln/labeling/blobs.hh,
	* mln/draw/line.hh: use trace::warning.

	* mln/trace/warning.hh: always print warnings.

	* mln/fun/x2x/rotation.hh: fix a precondition.

	* mln/morpho/tree/data.hh: add a missing method.

	* tests/level/median.cc: add a missing include.

	* tests/unit_test/Makefile.am,
	* tests/unit_test/mln_accu_transform_line.cc,
	* tests/unit_test/mln_convert_impl_from_double_to_value.cc,
	* tests/unit_test/mln_opt_value.cc: add missing unit_tests.

	* tests/unit_test/mln_histo_data.cc: rename as...
	* tests/unit_test/mln_histo_array.cc: ... this.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3162 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent a56c027c
2009-01-16 Guillaume Lazzara <z@lrde.epita.fr>
Small fixes.
* headers.mk: add new headers to distribution.
* mln/core/internal/site_relative_iterator_base.hh: avoid a warning.
* mln/labeling/blobs.hh,
* mln/draw/line.hh: use trace::warning.
* mln/trace/warning.hh: always print warnings.
* mln/fun/x2x/rotation.hh: fix a precondition.
* mln/morpho/tree/data.hh: add a missing method.
* tests/level/median.cc: add a missing include.
* tests/unit_test/Makefile.am,
* tests/unit_test/mln_accu_transform_line.cc,
* tests/unit_test/mln_convert_impl_from_double_to_value.cc,
* tests/unit_test/mln_opt_value.cc: add missing unit_tests.
* tests/unit_test/mln_histo_data.cc: rename as...
* tests/unit_test/mln_histo_array.cc: ... this.
2009-01-16 Guillaume Lazzara <z@lrde.epita.fr>
 
Add soft heap implementation.
......@@ -3,7 +3,7 @@
nobase_include_HEADERS = \
mln/version.hh \
mln/histo/all.hh \
mln/histo/data.hh \
mln/histo/array.hh \
mln/histo/compute.hh \
mln/histo/compute.spe.hh \
mln/histo/essential.hh \
......@@ -263,6 +263,7 @@ mln/convert/to_window.hh \
mln/convert/from_to.hh \
mln/convert/impl/from_value_to_value.hh \
mln/convert/impl/all.hh \
mln/convert/impl/from_double_to_value.hh \
mln/convert/impl/from_image_to_site_set.hh \
mln/convert/impl/from_float_to_value.hh \
mln/convert/impl/from_int_to_value.hh \
......@@ -372,6 +373,7 @@ mln/accu/count_adjacent_vertices.hh \
mln/accu/convolve.hh \
mln/accu/v.hh \
mln/accu/rank_bool.hh \
mln/accu/transform_line.hh \
mln/accu/min.hh \
mln/accu/transform_directional.hh \
mln/accu/compute.hh \
......@@ -425,6 +427,7 @@ mln/math/essential.hh \
mln/math/acos.hh \
mln/math/round_sat.hh \
mln/opt/at.hh \
mln/opt/value.hh \
mln/binarization/includes.hh \
mln/binarization/all.hh \
mln/binarization/binarization.hh \
......
......@@ -238,7 +238,7 @@ namespace mln
template <typename P>
inline
void
site_relative_iterator_base<S,E>::center_at_(const P& c)
site_relative_iterator_base<S,E>::center_at_(const P&)
{
// Default is no-op, meaning "no extra code".
}
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,10 +29,9 @@
#ifndef MLN_DRAW_LINE_HH
# define MLN_DRAW_LINE_HH
/*! \file mln/draw/line.hh
*
* \brief Draw a line in an image.
*/
/// \file mln/draw/line.hh
///
/// Draw a line in an image.
# include <mln/core/concept/image.hh>
# include <mln/core/site_set/p_line2d.hh>
......@@ -76,7 +76,8 @@ namespace mln
{
I& ima = exact(ima_);
mln_precondition(ima.is_valid());
// if (! ima.has(beg) || ! ima.has(end)) trace::warning("out");
if (! ima.has(beg) || ! ima.has(end))
trace::warning("Begin or end site is not part of the given image.");
data::paste(pw::cst(v) | p_line2d(beg, end),
safe(ima).rw());
}
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -53,29 +53,32 @@ namespace mln
{
template < unsigned n, typename C >
algebra::h_mat<n, C>
get_rot_h_mat(const float alpha_, const algebra::vec<3,C>& axis_)
get_rot_h_mat(const float alpha_, const algebra::vec<n,C>& axis_)
{
assert(!"get_h_mat : n not implemented");
mln_assertion(!"get_h_mat : n not implemented");
}
template <typename C >
algebra::h_mat<3, C>
get_rot_h_mat(const float alpha_, const algebra::vec<3,C>& axis_)
{
algebra::h_mat<3, C> m_;
//test axis is valid
typedef algebra::vec<3,C> vec_t;
//FIXME: cannot use '!=' operator.
mln_precondition(!(axis_ == vec_t(literal::zero)));
const float cos_a = cos(alpha_);
const float sin_a = sin(alpha_);
const float u = axis_[0];
const float v = axis_[1];
const float w = axis_[2];
//test axis is valid
assert(u != 0 && v != 0 && w != 0);
const float u2 = u * u;
const float v2 = v * v;
const float w2 = w * w;
const float uvw2 = u2 + v2 + w2;
algebra::h_mat<3, C> m_;
m_(0,0) = (u2 + (v2 + w2) * cos_a) / uvw2;
m_(0,1) = (u*v * (1 - cos_a) - u * std::sqrt(uvw2) * sin_a) / uvw2;
m_(0,2) = (u*w * (1 - cos_a) + v * std::sqrt(uvw2) * sin_a) / uvw2;
......@@ -103,11 +106,11 @@ namespace mln
algebra::h_mat<2, C>
get_rot_h_mat(const float alpha_, const algebra::vec<2,C>&)
{
algebra::h_mat<2, C> m_;
const float cos_a = cos(alpha_);
const float sin_a = sin(alpha_);
algebra::h_mat<2, C> m_;
m_(0,0) = cos_a; m_(0,1) = -sin_a; m_(0,2) = 0;
m_(1,0) = sin_a; m_(1,1) = cos_a; m_(1,2) = 0;
m_(2,0) = 0; m_(2,1) = 0; m_(2,2) = 1;
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -101,7 +101,7 @@ namespace mln
// Label this point component.
if (nlabels == mln_max(L))
{
std::cerr << "FIXME: labeling aborted!" << std::endl;
trace::warning("labeling aborted!");
return output;
}
++nlabels;
......
......@@ -105,6 +105,13 @@ namespace mln
return parent_(p) == p || f_(parent_(p)) != f_(p);
}
bool is_a_non_root_node(const mln_psite(I)& p) const
{
mln_precondition(is_valid());
mln_precondition(parent_.domain().has(p));
return f_(parent_(p)) != f_(p);
}
/// \}
......
// Copyright (C) 2008 EPITA Research and Development Laboratory
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -29,6 +30,7 @@
# define MLN_TRACE_WARNING_HH
/// \file mln/trace/warning.hh
///
/// Display warning message in trace output.
# include <string>
......@@ -50,10 +52,9 @@ namespace mln
inline
void warning(const std::string& message)
{
if (!quiet)
std::cout << "Warning: "
<< message
<< std::endl;
std::cout << "Warning: "
<< message
<< std::endl;
}
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -31,6 +31,7 @@
/// Test on mln::level::median.
#include <mln/core/image/image2d.hh>
#include <mln/level/compare.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
......
......@@ -4,7 +4,7 @@ include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
mln_histo_all \
mln_histo_data \
mln_histo_array \
mln_histo_compute \
mln_histo_essential \
mln_geom_pmin_pmax \
......@@ -260,6 +260,7 @@ mln_convert_to_window \
mln_convert_from_to \
mln_convert_impl_from_value_to_value \
mln_convert_impl_all \
mln_convert_impl_from_double_to_value \
mln_convert_impl_from_image_to_site_set \
mln_convert_impl_from_float_to_value \
mln_convert_impl_from_int_to_value \
......@@ -368,6 +369,7 @@ mln_accu_count_adjacent_vertices \
mln_accu_convolve \
mln_accu_v \
mln_accu_rank_bool \
mln_accu_transform_line \
mln_accu_min \
mln_accu_transform_directional \
mln_accu_compute \
......@@ -419,6 +421,7 @@ mln_math_essential \
mln_math_acos \
mln_math_round_sat \
mln_opt_at \
mln_opt_value \
mln_binarization_includes \
mln_binarization_all \
mln_binarization_binarization \
......@@ -1015,7 +1018,7 @@ mln_subsampling_subsampling \
mln_subsampling_essential
mln_histo_all_SOURCES = mln_histo_all.cc
mln_histo_data_SOURCES = mln_histo_data.cc
mln_histo_array_SOURCES = mln_histo_array.cc
mln_histo_compute_SOURCES = mln_histo_compute.cc
mln_histo_essential_SOURCES = mln_histo_essential.cc
mln_geom_pmin_pmax_SOURCES = mln_geom_pmin_pmax.cc
......@@ -1271,6 +1274,7 @@ mln_convert_to_window_SOURCES = mln_convert_to_window.cc
mln_convert_from_to_SOURCES = mln_convert_from_to.cc
mln_convert_impl_from_value_to_value_SOURCES = mln_convert_impl_from_value_to_value.cc
mln_convert_impl_all_SOURCES = mln_convert_impl_all.cc
mln_convert_impl_from_double_to_value_SOURCES = mln_convert_impl_from_double_to_value.cc
mln_convert_impl_from_image_to_site_set_SOURCES = mln_convert_impl_from_image_to_site_set.cc
mln_convert_impl_from_float_to_value_SOURCES = mln_convert_impl_from_float_to_value.cc
mln_convert_impl_from_int_to_value_SOURCES = mln_convert_impl_from_int_to_value.cc
......@@ -1379,6 +1383,7 @@ mln_accu_count_adjacent_vertices_SOURCES = mln_accu_count_adjacent_vertices.cc
mln_accu_convolve_SOURCES = mln_accu_convolve.cc
mln_accu_v_SOURCES = mln_accu_v.cc
mln_accu_rank_bool_SOURCES = mln_accu_rank_bool.cc
mln_accu_transform_line_SOURCES = mln_accu_transform_line.cc
mln_accu_min_SOURCES = mln_accu_min.cc
mln_accu_transform_directional_SOURCES = mln_accu_transform_directional.cc
mln_accu_compute_SOURCES = mln_accu_compute.cc
......@@ -1430,6 +1435,7 @@ mln_math_essential_SOURCES = mln_math_essential.cc
mln_math_acos_SOURCES = mln_math_acos.cc
mln_math_round_sat_SOURCES = mln_math_round_sat.cc
mln_opt_at_SOURCES = mln_opt_at.cc
mln_opt_value_SOURCES = mln_opt_value.cc
mln_binarization_includes_SOURCES = mln_binarization_includes.cc
mln_binarization_all_SOURCES = mln_binarization_all.cc
mln_binarization_binarization_SOURCES = mln_binarization_binarization.cc
......
// Unit test for mln/accu/transform_line.hh.
// Generated by ./build_unit_test.sh, do not modify.
// Include the file twice, so we detect missing inclusion guards.
#include <mln/accu/transform_line.hh>
#include <mln/accu/transform_line.hh>
int main()
{
// Nothing.
}
// Unit test for mln/convert/impl/from_double_to_value.hh.
// Generated by ./build_unit_test.sh, do not modify.
// Include the file twice, so we detect missing inclusion guards.
#include <mln/convert/impl/from_double_to_value.hh>
#include <mln/convert/impl/from_double_to_value.hh>
int main()
{
// Nothing.
}
// Unit test for mln/histo/array.hh.
// Generated by ./build_unit_test.sh, do not modify.
// Include the file twice, so we detect missing inclusion guards.
#include <mln/histo/array.hh>
#include <mln/histo/array.hh>
int main()
{
// Nothing.
}
// Unit test for mln/histo/data.hh.
// Unit test for mln/opt/value.hh.
// Generated by ./build_unit_test.sh, do not modify.
// Include the file twice, so we detect missing inclusion guards.
#include <mln/histo/data.hh>
#include <mln/histo/data.hh>
#include <mln/opt/value.hh>
#include <mln/opt/value.hh>
int main()
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment