URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2008-04-02 Caroline Vigouroux <vigour_c(a)epita.fr>
change RGB encoding from int_u to float01_.
* sandbox/vigouroux/color/my_hsi.hh: plug HSI on value.
* sandbox/vigouroux/color/rgb_to_hsi.hh: .
* sandbox/vigouroux/moyenne.cc: test new HSI and RGB.
---
color/my_hsi.hh | 5 +++++
color/rgb_to_hsi.hh | 6 +++---
moyenne.cc | 4 ++--
3 files changed, 10 insertions(+), 5 deletions(-)
Index: trunk/milena/sandbox/vigouroux/color/my_hsi.hh
===================================================================
--- trunk/milena/sandbox/vigouroux/color/my_hsi.hh (revision 1819)
+++ trunk/milena/sandbox/vigouroux/color/my_hsi.hh (revision 1820)
@@ -18,6 +18,11 @@
template <typename E>
struct HSI
+ :
+ public internal::value_like_< algebra::vec< 3, float01_<n> >, //
Equivalent.
+ algebra::vec< 3, float01_<n> >, // Encoding.
+ algebra::vec< 3, float01_<n> >, // Interoperation.
+ HSI<E> >
{
};
Index: trunk/milena/sandbox/vigouroux/color/rgb_to_hsi.hh
===================================================================
--- trunk/milena/sandbox/vigouroux/color/rgb_to_hsi.hh (revision 1819)
+++ trunk/milena/sandbox/vigouroux/color/rgb_to_hsi.hh (revision 1820)
@@ -88,9 +88,9 @@
beta = hsi.sat() * std::sin(h);
- red_t r = to_r(sqrt3_3 * hsi.inty() + 2 * inv_sqrt6 * beta);
- green_t g = to_g(sqrt3_3 * hsi.inty() + inv_sqrt2 * alpha - inv_sqrt6 * beta);
- blue_t b = to_b(sqrt3_3 * hsi.inty() - inv_sqrt2 * alpha - inv_sqrt6 * beta);
+ red_t r = sqrt3_3 * hsi.inty() + 2 * inv_sqrt6 * beta;
+ green_t g = sqrt3_3 * hsi.inty() + inv_sqrt2 * alpha - inv_sqrt6 * beta;
+ blue_t b = sqrt3_3 * hsi.inty() - inv_sqrt2 * alpha - inv_sqrt6 * beta;
T_rgb rgb(r, g, b);
Index: trunk/milena/sandbox/vigouroux/moyenne.cc
===================================================================
--- trunk/milena/sandbox/vigouroux/moyenne.cc (revision 1819)
+++ trunk/milena/sandbox/vigouroux/moyenne.cc (revision 1820)
@@ -1,10 +1,10 @@
#include <mln/value/hsi.hh>
-#include <mln/fun/v2v/rgb_to_hsi.hh>
+#include "color/rgb_to_hsi.hh"
#include <cmath>
#include <mln/core/image2d.hh>
-#include <mln/value/rgb8.hh>
+#include "rgb.hh"
#include <mln/io/ppm/load.hh>
#include <mln/io/ppm/save.hh>