milena r1730: corrections for compilation

URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2008-02-14 Caroline Vigouroux <vigour_c@epita.fr> corrections for compilation. * my_cmy.hh: . * rgb_to_cmy.hh: . * rgb_to_hsi.hh: . * tests.cc: . --- my_cmy.hh | 4 ++-- rgb_to_cmy.hh | 4 ++-- rgb_to_hsi.hh | 18 +++++++++--------- tests.cc | 6 ++++++ 4 files changed, 19 insertions(+), 13 deletions(-) Index: trunk/milena/sandbox/vigouroux/color/rgb_to_cmy.hh =================================================================== --- trunk/milena/sandbox/vigouroux/color/rgb_to_cmy.hh (revision 1729) +++ trunk/milena/sandbox/vigouroux/color/rgb_to_cmy.hh (revision 1730) @@ -16,7 +16,7 @@ struct value::cmy<8> doit(const struct value::rgb<8> rgb) const { - struct value::cmy cmy; + struct value::cmy<8> cmy; cmy.c(1 - rgb.red()); cmy.m(1 - rgb.green()); @@ -29,7 +29,7 @@ struct f_cmy_to_rgb { struct value::rgb<8> - doit(const struct value::cmy cmy) const + doit(const struct value::cmy<8> cmy) const { int red; int green; Index: trunk/milena/sandbox/vigouroux/color/tests.cc =================================================================== --- trunk/milena/sandbox/vigouroux/color/tests.cc (revision 1729) +++ trunk/milena/sandbox/vigouroux/color/tests.cc (revision 1730) @@ -9,6 +9,12 @@ #include "rgb_to_yuv.hh" #include "my_yuv.hh" +#include "rgb_to_cmy.hh" +#include "my_cmy.hh" + +#include "rgb_to_hsi.hh" +#include "my_hsi.hh" + int main() { using namespace mln; Index: trunk/milena/sandbox/vigouroux/color/my_cmy.hh =================================================================== --- trunk/milena/sandbox/vigouroux/color/my_cmy.hh (revision 1729) +++ trunk/milena/sandbox/vigouroux/color/my_cmy.hh (revision 1730) @@ -45,14 +45,14 @@ template <unsigned n> inline - yuv::cmy() + cmy<n>::cmy() :c_(0), m_(0), y_(0) { } template <unsigned n> inline - cmy::cmy(double c, double m, double y) + cmy<n>::cmy(double c, double m, double y) { mln_precondition(c >= 0); mln_precondition(m >= 0); Index: trunk/milena/sandbox/vigouroux/color/rgb_to_hsi.hh =================================================================== --- trunk/milena/sandbox/vigouroux/color/rgb_to_hsi.hh (revision 1729) +++ trunk/milena/sandbox/vigouroux/color/rgb_to_hsi.hh (revision 1730) @@ -12,14 +12,14 @@ namespace convert { struct f_rgb_to_hsi { - struct value::hsi + struct value::hsi<8> doit(const struct value::rgb<8> rgb) const { - struct value::hsi hsi; + struct value::hsi<8> hsi; - hsi.h(0.299 * rgb.red() + 0.587 * rgb.green() + 0.114 * rgb.blue()); - hsi.s(0.436 * (rgb.blue() - yuv.y()) / (1 - 0.114)); - hsi.i(0.615 * (rgb.red() - yuv.y()) / (1 - 0.299)); + hsi.h(0); // not yet implemented + hsi.s(0); // not yet implemented + hsi.i(0); // not yet implemented return (hsi); } @@ -28,13 +28,13 @@ struct f_hsi_to_rgb { struct value::rgb<8> - doit(const struct value::hsi hsi) const + doit(const struct value::hsi<8> hsi) const { struct value::rgb<8> rgb; - rgb.red() = yuv.y() + 1.13983 * yuv.v(); - rgb.green() = yuv.y() - 0.39465 * yuv.u() - 0.58060 * yuv.v(); - rgb.blue() = yuv.y() + 2.03211 * yuv.u(); + rgb.red() = 0; // not yet implemented + rgb.green() = 0; // not yet implemented + rgb.blue() = 0; // not yet implemented return (rgb); }
participants (1)
-
Caroline Vigouroux