Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
* levillain/constrained-connectivity.cc: Complete the processing
chain.
Add a copyright header.
Translate the documentation into English.
s/ima/input/g.
s/ima_x2/f/g.
* levillain/soille.pgm: New.
* levillain/Makefile: New.
---
milena/sandbox/ChangeLog | 13 ++
milena/sandbox/levillain/Makefile | 27 +++
.../sandbox/levillain/constrained-connectivity.cc | 175 ++++++++++++++++----
milena/sandbox/levillain/soille.pgm | 11 ++
4 files changed, 197 insertions(+), 29 deletions(-)
create mode 100644 milena/sandbox/levillain/Makefile
create mode 100644 milena/sandbox/levillain/soille.pgm
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 673d4d8..4dcc85b 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,16 @@
+2009-09-04 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Finish the experiment for Laurent.
+
+ * levillain/constrained-connectivity.cc: Complete the processing
+ chain.
+ Add a copyright header.
+ Translate the documentation into English.
+ s/ima/input/g.
+ s/ima_x2/f/g.
+ * levillain/soille.pgm: New.
+ * levillain/Makefile: New.
+
2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
Start a new experiment for Laurent.
diff --git a/milena/sandbox/levillain/Makefile b/milena/sandbox/levillain/Makefile
new file mode 100644
index 0000000..d95c7a5
--- /dev/null
+++ b/milena/sandbox/levillain/Makefile
@@ -0,0 +1,27 @@
+# FIXME: A part of this should move out of this sandbox and into milena/apps.
+
+milena_dir = ../..
+img_dir = $(milena_dir)/img
+
+CPPFLAGS = -I. -I$(milena_dir)
+CXXFLAGS = -ggdb -Wall -Werror
+
+PROGRAMS = double min-max constrained-connectivity
+
+all: $(PROGRAMS)
+
+check: check-double check-min-max check-constrained-connectivity
+check-double: double
+ ./$<
+check-min-max: min-max
+ ./$<
+check-constrained-connectivity: constrained-connectivity soille.pgm
+ ./$< soille.pgm
+
+CLEANFILES = double min-max constrained-connectivity
+
+clean:
+ rm -f $(CLEANFILES)
+
+.PHONY: all check clean
+.PHONY: check-double check-min-max check-constrained-connectivity
diff --git a/milena/sandbox/levillain/constrained-connectivity.cc b/milena/sandbox/levillain/constrained-connectivity.cc
index d740956..81c86ca 100644
--- a/milena/sandbox/levillain/constrained-connectivity.cc
+++ b/milena/sandbox/levillain/constrained-connectivity.cc
@@ -1,21 +1,65 @@
-/* The Work:
-
- - Prendre une image 2d
- - En doubler les pixels (un pixel -> un carré de quatre pixels)
- - En calculer un graphe d'arrête (passage en complexe cubique)
- - Valuer les arrêtes avec une magnitude de gradient (|v1 - v2|)
- - Calculer une LPE topo sur ce gradient
- - Seuiller les valeurs de cette LPE doit être équivalent aux
- alpha-CC de Pierre Soille (hypothèse de Laurent)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/** \file constrained-connectivity.cc
- - Puis, sur l'arbre des coupes (correspondant à la LPE topo
- calculée ci-avant), calculer pour chaque arrête `e' un attribut
- initialisé tel que `a(e) = (min(v1,v2), max(v1,v2))' (couple) où
- `v1' et `v2' sont adjacents à `e', et propager ce min et ce max
- sur tous les noeuds.
- - Il doit normalement être possible d'obtenir les (alpha,
- omega)-CC de Pierre Soille en filtrant cet arbre. */
-
+ \brief A topological watershed-based implementation of Pierre
+ Soille's constrained connectivity segmentation.
+
+ Reference:
+
+ Pierre Soille. Constrained Connectivity for Hierarchical Image
+ Partitioning and Simplification. In: IEEE Transactions on
+ Pattern Analysis and Machine Intelligence, vol. 30, no. 7, July
+ 2008, pages 1132-1145.
+
+
+ The scenario is as follows.
+
+ Part 1.
+ \li Load a 2D image.
+ \li Double its resolution (a pixel becomes a square of four pixels).
+ \li Compute a line graph from this image and
+ \li Assign values of a gradient to the edges (e.g., |v1 - v2|).
+ \li Compute a topological watershed transform on this gradient.
+ \li Thresholding the values of this watershed gives
+ alpha-connected component (alpha-cc) described by Pierre Soille.
+
+ Part 2.
+ \li For each edge of the watershed (line graph-based) image,
+ compute the min and max value of the adjacent vertices (pixels).
+ \li Using the component tree corresponding to the previously
+ computed topological watershed transform, propagate and
+ compute the min and max value for each component of the
+ watershed.
+ \li Create an image of ``heights'' by subtracting the image of min
+ values from the image of max values.
+ \li Thresholding the watershed image (using a parameter alpha)
+ <em>and</em> the height image (using a parameter omega) gives
+ the (alpha, omega)-connected component (alpha-omega cc)
+ described by Pierre Soille. */
#include <cstdio>
@@ -27,15 +71,19 @@
#include <mln/pw/all.hh>
-#include <mln/io/pgm/load.hh>
-#include <mln/debug/println.hh>
-
// From Théo's sandbox.
#include <theo/cplx2d.hh>
// From Alexandre Abraham's sandbox.
#include <alexandre/topo_wst.hh>
+#include <mln/morpho/tree/compute_attribute_image.hh>
+#include <mln/accu/stat/min.hh>
+#include <mln/accu/stat/max.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/debug/println.hh>
+
int main(int argc, char* argv[])
{
@@ -49,12 +97,12 @@ int main(int argc, char* argv[])
using mln::value::int_u8;
// Load an image.
- image2d<int_u8> ima;
- io::pgm::load(ima, argv[1]);
+ image2d<int_u8> input;
+ io::pgm::load(input, argv[1]);
// Double its resolution.
- image2d<int_u8> ima_x2 (10, 10);
- mln_piter_(image2d<int_u8>) p(ima_x2.domain());
+ image2d<int_u8> f(input.nrows() * 2, input.ncols() * 2);
+ mln_piter_(image2d<int_u8>) p(f.domain());
for_all(p)
{
/* This conversion from ``piter'' to ``point'' is required, since
@@ -62,16 +110,17 @@ int main(int argc, char* argv[])
point (among which the methods row(), col(), etc.). */
point2d p_ = p;
point2d q(p_.row() / 2, p_.col() / 2);
- ima_x2(p) = ima(q);
+ f(p) = input(q);
}
- debug::println(ima_x2);
+ debug::println(f);
// Compute the associated line graph gradient.
- mln_VAR(g, cplx2d::f_to_g(ima_x2) );
+ mln_VAR(g, cplx2d::f_to_g(f) );
debug::println("g:", g);
// Compute a topological watershed transform on this gradient.
- morpho::topo_wst<g_t, cplx2d::dbl_neighb2d> tree(g, cplx2d::e2e());
+ typedef morpho::topo_wst<g_t, cplx2d::dbl_neighb2d> tree_t;
+ tree_t tree(g, cplx2d::e2e());
tree.go();
mln_VAR(w, morpho::topo_watershed(tree));
debug::println("w:", w);
@@ -84,7 +133,7 @@ int main(int argc, char* argv[])
values.insert (w(p2));
// Thresholding for each value of W.
- for (std::set<int_u8>::iterator alpha = values.begin();
+ for (std::set<int_u8>::const_iterator alpha = values.begin();
alpha != values.end(); ++alpha)
{
mln_VAR(alpha_cc, w | (pw::value(w) > pw::cst(*alpha)));
@@ -95,4 +144,72 @@ int main(int argc, char* argv[])
std::cout << *alpha << "-cc:" << std::endl;
debug::impl::println(w.unmorph_().domain(), alpha_cc);
}
+
+
+ // Compute attributes on the components of the topological watershed (W).
+ typedef p_array<tree_t::site> sites_t;
+ sites_t sites = data::sort_psites_decreasing(w);
+
+ /* FIXME: Of course, we'd like to be able to reuse the component tree
+ within TREE instead of rebuilding a morpho::tree::data... This
+ requires some changes in the topological WST implementation to
+ make its component tree structure compatible with
+ morpho::tree::data. */
+ morpho::tree::data<w_t, sites_t> t(w, sites, cplx2d::e2e());
+
+ // Height (max-min) on the line graph WST, but with min and max
+ // values computed on vertices.
+ mln_ch_value_(w_t, accu::stat::min<int_u8>) init_min_val;
+ initialize (init_min_val, w);
+ mln_ch_value_(w_t, accu::stat::max<int_u8>) init_max_val;
+ initialize (init_max_val, w);
+
+ mln_fwd_piter_(w_t) e(w.domain());
+ mln_niter_(cplx2d::dbl_neighb2d) v(cplx2d::e2p(), e);
+ for_all(e)
+ {
+ // Compute the min and max values on vertices (pixels) adjacent to edge E.
+ for_all(v)
+ {
+ /* Unfortunately, the data structure G does not record any
+ information from the image F (i.e., the values on
+ vertices/pixels). We have to convert the coordinates of V
+ to its equivalent in F's domain to get the values on
+ vertices.
+
+ In addition, note that an explicit `to_site()' conversion
+ is required here, since an iterator does not expose the
+ interface of the underlying point (among which the methods
+ row(), col(), etc.). */
+ point2d v_(v.to_site().row() / 2, v.to_site().col() / 2);
+ init_min_val(e).take(f(v_));
+ init_max_val(e).take(f(v_));
+ }
+ }
+ accu::stat::min<int_u8> min_accu;
+ mln_ch_value_(w_t, int_u8) min_val =
+ morpho::tree::compute_attribute_image_from(min_accu, t, init_min_val);
+ accu::stat::max<int_u8> max_accu;
+ mln_ch_value_(w_t, int_u8) max_val =
+ morpho::tree::compute_attribute_image_from(max_accu, t, init_max_val);
+
+ mln_ch_value_(w_t, int_u8) height;
+ initialize(height, w);
+ for_all(e)
+ height(e) = max_val(e) - min_val(e);
+ debug::println(height);
+
+ // Thresholding for the first integer values with a condition on HEIGHT.
+ for (unsigned alpha = 0; alpha <= 6; ++alpha)
+ {
+ mln_VAR(alpha_alpha_cc,
+ w | (pw::value(w) > pw::cst(alpha)
+ || (pw::value(height) > pw::cst(alpha))));
+ /* FIXME: There should be variants of debug::println allowing
+ the user to pass an optional ``support'' larger than the
+ actual domain of the image. For now, use a low-level routine
+ as a workaround. */
+ std::cout << "(" << alpha << ", " << alpha << ")-cc:" << std::endl;
+ debug::impl::println(w.unmorph_().domain(), alpha_alpha_cc);
+ }
}
diff --git a/milena/sandbox/levillain/soille.pgm b/milena/sandbox/levillain/soille.pgm
new file mode 100644
index 0000000..7b1593b
--- /dev/null
+++ b/milena/sandbox/levillain/soille.pgm
@@ -0,0 +1,11 @@
+P2
+7 7
+255
+
+1 3 8 7 8 8 2
+2 1 9 8 8 9 1
+1 0 4 1 1 2 5
+1 1 9 3 4 2 6
+3 2 7 9 9 1 1
+1 0 8 4 9 6 7
+0 2 9 3 8 5 9
--
1.6.4.2
1
0
[PATCH 4/8] theo/esiee/laurent/ismm09/cplx2d.hh: Include mln/core/var.hh.
by Roland Levillain 04 Sep '09
by Roland Levillain 04 Sep '09
04 Sep '09
---
milena/sandbox/ChangeLog | 4 ++++
milena/sandbox/theo/esiee/laurent/ismm09/cplx2d.hh | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 7003772..83ef8c3 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,5 +1,9 @@
2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
+ * theo/esiee/laurent/ismm09/cplx2d.hh: Include mln/core/var.hh.
+
+2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix the topological watershed transform algorithm (mostly).
* abraham/mln/morpho/topo_wst.hh
diff --git a/milena/sandbox/theo/esiee/laurent/ismm09/cplx2d.hh b/milena/sandbox/theo/esiee/laurent/ismm09/cplx2d.hh
index 35458be..482f3de 100644
--- a/milena/sandbox/theo/esiee/laurent/ismm09/cplx2d.hh
+++ b/milena/sandbox/theo/esiee/laurent/ismm09/cplx2d.hh
@@ -7,6 +7,8 @@
#include <mln/core/image/dmorph/image_if.hh>
#include <mln/core/routine/extend.hh>
+#include <mln/core/var.hh>
+
#include <mln/data/paste.hh>
#include <mln/morpho/gradient.hh>
--
1.6.4.2
1
0
* levillain/.gitignore: Add constrained-connectivity.
* levillain/alexandre: New symlink to abraham/mln/morpho.
* levillain/theo: New symlink to theo/esiee/laurent/ismm09.
* levillain/constrained-connectivity.cc: New.
---
milena/sandbox/ChangeLog | 9 ++
milena/sandbox/levillain/.gitignore | 1 +
milena/sandbox/levillain/alexandre | 1 +
.../sandbox/levillain/constrained-connectivity.cc | 98 ++++++++++++++++++++
milena/sandbox/levillain/theo | 1 +
5 files changed, 110 insertions(+), 0 deletions(-)
create mode 120000 milena/sandbox/levillain/alexandre
create mode 100644 milena/sandbox/levillain/constrained-connectivity.cc
create mode 120000 milena/sandbox/levillain/theo
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 83ef8c3..673d4d8 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,5 +1,14 @@
2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Start a new experiment for Laurent.
+
+ * levillain/.gitignore: Add constrained-connectivity.
+ * levillain/alexandre: New symlink to abraham/mln/morpho.
+ * levillain/theo: New symlink to theo/esiee/laurent/ismm09.
+ * levillain/constrained-connectivity.cc: New.
+
+2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
+
* theo/esiee/laurent/ismm09/cplx2d.hh: Include mln/core/var.hh.
2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
diff --git a/milena/sandbox/levillain/.gitignore b/milena/sandbox/levillain/.gitignore
index 627984b..e55cea5 100644
--- a/milena/sandbox/levillain/.gitignore
+++ b/milena/sandbox/levillain/.gitignore
@@ -1,2 +1,3 @@
+constrained-connectivity
double
min-max
diff --git a/milena/sandbox/levillain/alexandre b/milena/sandbox/levillain/alexandre
new file mode 120000
index 0000000..5edb140
--- /dev/null
+++ b/milena/sandbox/levillain/alexandre
@@ -0,0 +1 @@
+../abraham/mln/morpho/
\ No newline at end of file
diff --git a/milena/sandbox/levillain/constrained-connectivity.cc b/milena/sandbox/levillain/constrained-connectivity.cc
new file mode 100644
index 0000000..d740956
--- /dev/null
+++ b/milena/sandbox/levillain/constrained-connectivity.cc
@@ -0,0 +1,98 @@
+/* The Work:
+
+ - Prendre une image 2d
+ - En doubler les pixels (un pixel -> un carré de quatre pixels)
+ - En calculer un graphe d'arrête (passage en complexe cubique)
+ - Valuer les arrêtes avec une magnitude de gradient (|v1 - v2|)
+ - Calculer une LPE topo sur ce gradient
+ - Seuiller les valeurs de cette LPE doit être équivalent aux
+ alpha-CC de Pierre Soille (hypothèse de Laurent)
+
+ - Puis, sur l'arbre des coupes (correspondant à la LPE topo
+ calculée ci-avant), calculer pour chaque arrête `e' un attribut
+ initialisé tel que `a(e) = (min(v1,v2), max(v1,v2))' (couple) où
+ `v1' et `v2' sont adjacents à `e', et propager ce min et ce max
+ sur tous les noeuds.
+ - Il doit normalement être possible d'obtenir les (alpha,
+ omega)-CC de Pierre Soille en filtrant cet arbre. */
+
+
+#include <cstdio>
+
+#include <set>
+#include <iostream>
+
+#include <mln/value/int_u8.hh>
+#include <mln/core/image/image2d.hh>
+
+#include <mln/pw/all.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/debug/println.hh>
+
+// From Théo's sandbox.
+#include <theo/cplx2d.hh>
+
+// From Alexandre Abraham's sandbox.
+#include <alexandre/topo_wst.hh>
+
+
+int main(int argc, char* argv[])
+{
+ if (argc != 2)
+ {
+ std::cerr << "Usage: " << argv[0] << " input.pbm" << std::endl;
+ std::exit(1);
+ }
+
+ using namespace mln;
+ using mln::value::int_u8;
+
+ // Load an image.
+ image2d<int_u8> ima;
+ io::pgm::load(ima, argv[1]);
+
+ // Double its resolution.
+ image2d<int_u8> ima_x2 (10, 10);
+ mln_piter_(image2d<int_u8>) p(ima_x2.domain());
+ for_all(p)
+ {
+ /* This conversion from ``piter'' to ``point'' is required, since
+ an iterator does not expose the interface of the underlying
+ point (among which the methods row(), col(), etc.). */
+ point2d p_ = p;
+ point2d q(p_.row() / 2, p_.col() / 2);
+ ima_x2(p) = ima(q);
+ }
+ debug::println(ima_x2);
+
+ // Compute the associated line graph gradient.
+ mln_VAR(g, cplx2d::f_to_g(ima_x2) );
+ debug::println("g:", g);
+
+ // Compute a topological watershed transform on this gradient.
+ morpho::topo_wst<g_t, cplx2d::dbl_neighb2d> tree(g, cplx2d::e2e());
+ tree.go();
+ mln_VAR(w, morpho::topo_watershed(tree));
+ debug::println("w:", w);
+
+ // Computing the set of values of W.
+ // FIXME: Milena may provide something simpler than this.
+ std::set<int_u8> values;
+ mln_piter_(w_t) p2(w.domain());
+ for_all(p2)
+ values.insert (w(p2));
+
+ // Thresholding for each value of W.
+ for (std::set<int_u8>::iterator alpha = values.begin();
+ alpha != values.end(); ++alpha)
+ {
+ mln_VAR(alpha_cc, w | (pw::value(w) > pw::cst(*alpha)));
+ /* FIXME: There should be variants of debug::println allowing
+ the user to pass an optional ``support'' larger than the
+ actual domain of the image. For now, use a low-level routine
+ as a workaround. */
+ std::cout << *alpha << "-cc:" << std::endl;
+ debug::impl::println(w.unmorph_().domain(), alpha_cc);
+ }
+}
diff --git a/milena/sandbox/levillain/theo b/milena/sandbox/levillain/theo
new file mode 120000
index 0000000..7612684
--- /dev/null
+++ b/milena/sandbox/levillain/theo
@@ -0,0 +1 @@
+../theo/esiee/laurent/ismm09
\ No newline at end of file
--
1.6.4.2
1
0
[PATCH 3/8] Fix the topological watershed transform algorithm (mostly).
by Roland Levillain 04 Sep '09
by Roland Levillain 04 Sep '09
04 Sep '09
* abraham/mln/morpho/topo_wst.hh
(topo_wst<I, N>::topo_wst(const Image<I>&, const Neighborhood<N>&)):
Properly initialize image new image members in this ctor.
(topo_watershed): Likewise.
(topo_wst<I, N>::BuildComponentTree): Do not assume the first site
of the domain is point2d(0,0).
Remove useless #include's.
Wrap long lines.
Some aesthetic changes.
---
milena/sandbox/ChangeLog | 14 +++
milena/sandbox/abraham/mln/morpho/topo_wst.hh | 108 +++++++++++++++----------
2 files changed, 78 insertions(+), 44 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 16aa288..7003772 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix the topological watershed transform algorithm (mostly).
+
+ * abraham/mln/morpho/topo_wst.hh
+ (topo_wst<I, N>::topo_wst(const Image<I>&, const Neighborhood<N>&)):
+ Properly initialize image new image members in this ctor.
+ (topo_watershed): Likewise.
+ (topo_wst<I, N>::BuildComponentTree): Do not assume the first site
+ of the domain is point2d(0,0).
+ Remove useless #include's.
+ Wrap long lines.
+ Some aesthetic changes.
+
2009-09-04 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix red component bug.
diff --git a/milena/sandbox/abraham/mln/morpho/topo_wst.hh b/milena/sandbox/abraham/mln/morpho/topo_wst.hh
index 2b643d5..7e9fb64 100644
--- a/milena/sandbox/abraham/mln/morpho/topo_wst.hh
+++ b/milena/sandbox/abraham/mln/morpho/topo_wst.hh
@@ -28,24 +28,19 @@
#ifndef MLN_MORPHO_TOPO_WST_HH
# define MLN_MORPHO_TOPO_WST_HH
+# include <vector>
+# include <map>
+# include <queue>
+# include <mln/core/site_set/p_set.hh>
+# include <mln/core/site_set/p_priority.hh>
+# include <mln/core/site_set/p_queue_fast.hh>
-#include <mln/data/sort_psites.hh>
-#include <mln/data/fill.hh>
-#include <mln/core/image/image2d.hh>
-#include <mln/core/site_set/p_set.hh>
-#include <mln/estim/min_max.hh>
-#include <mln/math/sqr.hh>
-#include <mln/util/greater_psite.hh>
-#include <mln/util/ord.hh>
-#include <mln/arith/revert.hh>
+# include <mln/util/ord.hh>
-#include <mln/core/site_set/p_priority.hh>
-#include <mln/core/site_set/p_queue_fast.hh>
+# include <mln/data/sort_psites.hh>
+# include <mln/data/fill.hh>
-#include <queue>
-#include <vector>
-#include <map>
namespace mln
{
@@ -87,7 +82,7 @@ namespace mln
}
-
+ // Actually, this structure is a tree, despite its confusing name.
template <class I, class N>
struct topo_wst
{
@@ -195,22 +190,23 @@ namespace mln
void compressTree();
}; // struct topo_wst
+
+
# ifndef MLN_INCLUDE_ONLY
// Ctor
template <class I, class N>
topo_wst<I, N>::topo_wst(const Image<I>& i,
- const Neighborhood<N>& n)
- : Par_node(exact(i).domain(), exact(i).border()),
- Par_tree(exact(i).domain(), exact(i).border()),
- Rnk_tree(exact(i).domain(), exact(i).border()),
- Rnk_node(exact(i).domain(), exact(i).border()),
- subtreeRoot(exact(i).domain(), exact(i).border()),
- nodes(exact(i).domain(), exact(i).border()),
- isproc(exact(i).domain(), exact(i).border()),
- ima(exact(i)),
- nbh(exact(n))
+ const Neighborhood<N>& n)
+ : ima(exact(i)), nbh(exact(n))
{
+ initialize(Par_node, i);
+ initialize(Par_tree, i);
+ initialize(Rnk_tree, i);
+ initialize(Rnk_node, i);
+ initialize(subtreeRoot, i);
+ initialize(nodes, i);
+ initialize(isproc, i);
}
template <class I, class N>
@@ -285,6 +281,7 @@ namespace mln
site curCanonicalElt = Find_tree(p);
site curNode = Find_node(subtreeRoot(curCanonicalElt));
+ // FIXME: Should be `n' instead of `q'.
mln_niter(N) q(nbh, ip);
for_all(q)
if (ima.has(q) and isproc(q) and ima(q) <= ima(p))
@@ -319,12 +316,18 @@ namespace mln
for_all(r)
Par_node(r) = Find_node(r);
- Root = subtreeRoot(Find_tree(Find_node(site(0, 0))));
+ // Find the ``first'' site of ima, according to the forward
+ // traversal order.
+ mln_fwd_piter(I) rp(Par_node.domain());;
+ rp.start();
+
+ Root = subtreeRoot(Find_tree(Find_node(rp)));
}
template <class I, class N>
- typename topo_wst<I, N>::site topo_wst<I, N>::MergeNode(site& node1, site& node2)
+ typename topo_wst<I, N>::site topo_wst<I, N>::MergeNode(site& node1,
+ site& node2)
{
site tmpNode = Link_node(node1, node2);
site tmpNode2;
@@ -513,7 +516,8 @@ namespace mln
//Minim[j][i] = size - 1;
}
else {
- if (depth[euler[Minim[j - 1][i]]] <= depth[euler[Minim[j - 1][i + k]]])
+ if (depth[euler[Minim[j - 1][i]]]
+ <= depth[euler[Minim[j - 1][i + k]]])
Minim[j][i] = Minim[j - 1][i];
else
Minim[j][i] = Minim[j - 1][i + k];
@@ -553,7 +557,8 @@ namespace mln
template <class I, class N>
- void topo_wst<I, N>::removeOneSonNodes(site *p, mln_ch_value(I, site) &newPar_node)
+ void topo_wst<I, N>::removeOneSonNodes(site *p,
+ mln_ch_value(I, site) &newPar_node)
{
node &n = nodes(*p);
@@ -575,7 +580,8 @@ namespace mln
template <class I, class N>
void topo_wst<I, N>::compressTree()
{
- mln_ch_value(I, site) newPar_node(Par_node.domain(), Par_node.border());
+ mln_ch_value(I, site) newPar_node;
+ initialize(newPar_node, Par_node);
// Remove the nodes with one son
removeOneSonNodes(&Root, newPar_node);
@@ -597,24 +603,27 @@ namespace mln
const I &ima = exact(tree.ima);
const N &nbh = exact(tree.nbh);
+ // FIXME: Should be `n' instead of `q'.
mln_niter(N) q(nbh, p);
p_set<mln_site(I)> v;
for_all(q)
+ // FIXME: Shouldn't it be: `ima.has(q)' instead of
+ // `ima.domain().has(q)'?
if (ima.domain().has(q) && ima(q) < ima(p))
v.insert(tree.Par_node(q));
if (v.nsites() == 0)
return false;
- if (v.nsites() == 1) {
- r = v[0];
- return true;
- }
+ if (v.nsites() == 1)
+ {
+ r = v[0];
+ return true;
+ }
- mln_site(I)
- c = min(ima, v),
- cmin = c;
+ mln_site(I) c = min(ima, v);
+ mln_site(I) cmin = c;
typename p_set<mln_site(I)>::fwd_piter it(v);
for_all(it)
@@ -655,10 +664,12 @@ namespace mln
const N &nbh = exact(tree.nbh);
// Maxima components
- mln_ch_value(I, bool) cmax(ima.domain(), ima.border());
+ mln_ch_value(I, bool) cmax;
+ initialize(cmax, ima);
// Mark enqueued sites
- mln_ch_value(I, bool) enqueued(ima.domain(), ima.border());
+ mln_ch_value(I, bool) enqueued;
+ initialize(enqueued, ima);
p_priority< mln_value(I), p_queue_fast<mln_site(I)> > l;
// p_queue < site > m;
@@ -682,7 +693,10 @@ namespace mln
while (!m.empty())
{
+ // FIXME: Should be `n' instead of `q'.
mln_niter(N) q(nbh, m.front());
+ // FIXME: Shouldn't it be: `cmax.has(q)' instead of
+ // `cmax.domain().has(q)'?
for_all(q)
if (cmax.domain().has(q) && !cmax(q) && !enqueued(q))
{
@@ -716,15 +730,23 @@ namespace mln
else
// if (nodes(c).children.nsites() > 1)
if (tree.nodes(c).children.size() == 1)
- std::cerr << "ERREUR COMPOSANTE BRANCHE " << tree.nodes(c).children.size() << std::endl;
+ std::cerr << "ERREUR COMPOSANTE BRANCHE "
+ << tree.nodes(c).children.size() << std::endl;
+ // FIXME: Should be `n' instead of `q'.
mln_niter(N) q(nbh, x);
+ // FIXME: Shouldn't it be: `ima.has(q)' instead of
+ // `ima.domain().has(q)'?
for_all(q)
if (ima.domain().has(q) && !cmax(q) && !enqueued(q))
{
enqueued(q) = true;
- l.push(mln_max(mln_value(I)) - ima(q), q); // FIXME : just invert the priority
+ l.push(mln_max(mln_value(I)) - ima(q), q); // FIXME:
+ // Just
+ // invert
+ // the
+ // priority.
}
}
} // while(!l.empty())
@@ -736,8 +758,6 @@ namespace mln
}
-
-
# endif // MLN_INCLUDE_ONLY
@@ -745,4 +765,4 @@ namespace mln
}; // namespace mln
-#endif // MLN_MORPHO_TOPO_WST_HH
+#endif // ! MLN_MORPHO_TOPO_WST_HH
--
1.6.4.2
1
0
---
milena/ChangeLog | 4 ++
milena/mln/debug/println.spe.hh | 88 +++++++++++++++++++-------------------
2 files changed, 48 insertions(+), 44 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 940e501..654dd5c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-03 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * mln/debug/println.spe.hh: Reindent.
+
2009-09-01 Roland Levillain <roland(a)lrde.epita.fr>
Aesthetic changes in mln::win::multiple_qiter<W,F>.
diff --git a/milena/mln/debug/println.spe.hh b/milena/mln/debug/println.spe.hh
index 2a44177..257ddf4 100644
--- a/milena/mln/debug/println.spe.hh
+++ b/milena/mln/debug/println.spe.hh
@@ -45,7 +45,7 @@
# include <mln/accu/stat/max.hh>
# include <mln/opt/at.hh>
-//FIXME: do not include all these headers
+// FIXME: do not include all these headers
# include <mln/core/alias/box2d.hh>
# include <mln/core/alias/box2d_h.hh>
# include <mln/core/alias/box3d.hh>
@@ -82,11 +82,11 @@ namespace mln
println(const box2d& b, const image2d<char>& input)
{
for (def::coord row = b.min_row(); row <= b.max_row(); ++row)
- {
- for (def::coord col = b.min_col(); col <= b.max_col(); ++col)
- std::cout << opt::at(input, row, col) << ' ';
- std::cout << std::endl;
- }
+ {
+ for (def::coord col = b.min_col(); col <= b.max_col(); ++col)
+ std::cout << opt::at(input, row, col) << ' ';
+ std::cout << std::endl;
+ }
std::cout << std::endl;
}
@@ -99,32 +99,32 @@ namespace mln
accu::stat::max<unsigned> len_;
mln_piter(I) p(input.domain());
for_all(p)
- {
- std::ostringstream o;
- o << format(input(p));
- len_.take(o.str().length());
- }
+ {
+ std::ostringstream o;
+ o << format(input(p));
+ len_.take(o.str().length());
+ }
unsigned len = len_ + 1;
image2d<char> output(b.nrows(), b.ncols() * len, 0);
data::fill(output, ' ');
for_all(p)
- {
- std::ostringstream oss;
- oss << format(input(p));
- def::coord
- row = static_cast<def::coord>(p.row() - b.min_row()),
- col = static_cast<def::coord>((p.col() - b.min_col()) * len);
- point2d w(row, col);
- put_word(output, w, oss.str());
- }
-
- for (def::coord row = 0; row < def::coord(b.nrows()); ++row)
{
- for (def::coord col = 0; col < def::coord(b.ncols() * len); ++col)
- std::cout << opt::at(output, row, col);
- std::cout << std::endl;
+ std::ostringstream oss;
+ oss << format(input(p));
+ def::coord
+ row = static_cast<def::coord>(p.row() - b.min_row()),
+ col = static_cast<def::coord>((p.col() - b.min_col()) * len);
+ point2d w(row, col);
+ put_word(output, w, oss.str());
}
+
+ for (def::coord row = 0; row < def::coord(b.nrows()); ++row)
+ {
+ for (def::coord col = 0; col < def::coord(b.ncols() * len); ++col)
+ std::cout << opt::at(output, row, col);
+ std::cout << std::endl;
+ }
std::cout << std::endl;
}
@@ -140,13 +140,13 @@ namespace mln
int row_len = 1 + (b.max_col() - b.min_col()) / 2;
for_all(p)
- {
- if (input.domain().has(p))
- std::cout << format(input(p)) << " ";
- else
- std::cout << " ";
+ {
+ if (input.domain().has(p))
+ std::cout << format(input(p)) << " ";
+ else
+ std::cout << " ";
- if (c >= row_len)
+ if (c >= row_len)
{
std::cout << std::endl;
if (r % 2)
@@ -154,8 +154,8 @@ namespace mln
c = 0;
r++;
}
- c++;
- }
+ c++;
+ }
std::cout << std::endl;
}
@@ -174,20 +174,20 @@ namespace mln
max_col = b.max_col();
for (sli = b.min_sli(); sli <= max_sli; ++sli)
- {
- for (row = b.min_row(); row <= max_row; ++row)
{
- for (int i = max_row; i >= row; --i)
- std::cout << ' ';
- for (col = b.min_col(); col <= max_col; ++col)
- if (input.domain().has(p))
- std::cout << format(input(p)) << ' ';
- else
- std::cout << " ";
+ for (row = b.min_row(); row <= max_row; ++row)
+ {
+ for (int i = max_row; i >= row; --i)
+ std::cout << ' ';
+ for (col = b.min_col(); col <= max_col; ++col)
+ if (input.domain().has(p))
+ std::cout << format(input(p)) << ' ';
+ else
+ std::cout << " ";
+ std::cout << std::endl;
+ }
std::cout << std::endl;
}
- std::cout << std::endl;
- }
}
# endif // ! MLN_INCLUDE_ONLY
--
1.6.4.2
1
0
04 Sep '09
* mln/win/multiple.hh: Here.
---
milena/ChangeLog | 6 ++++++
milena/mln/win/multiple.hh | 22 +++++++++++-----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 60f3ad7..940e501 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-01 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Aesthetic changes in mln::win::multiple_qiter<W,F>.
+
+ * mln/win/multiple.hh: Here.
+
2009-08-24 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
* mln/win/multiple.hh: Add a missing init_ member.
diff --git a/milena/mln/win/multiple.hh b/milena/mln/win/multiple.hh
index a3632f5..a12bf83 100644
--- a/milena/mln/win/multiple.hh
+++ b/milena/mln/win/multiple.hh
@@ -139,15 +139,15 @@ namespace mln
public:
multiple_qiter();
+ template <typename Pref>
+ multiple_qiter(const multiple<W,F>& w, const Pref& c);
- template <typename P>
- multiple_qiter(const multiple<W,F>& w, const P& c);
-
- void change_target(const multiple<W,F>& w); // Overridden to initialize size_.
+ /// Overridden to initialize size_.
+ void change_target(const multiple<W,F>& w);
/// Delegated initialization.
- template <typename P>
- void init_(const multiple<W,F>& w, const P& c);
+ template <typename Pref>
+ void init_(const multiple<W,F>& w, const Pref& c);
/// Test the iterator validity.
bool is_valid_() const;
@@ -316,18 +316,18 @@ namespace mln
}
template <typename W, typename F>
- template <typename P>
+ template <typename Pref>
inline
- multiple_qiter<W,F>::multiple_qiter(const multiple<W,F>& w, const P& c)
+ multiple_qiter<W,F>::multiple_qiter(const multiple<W,F>& w, const Pref& c)
{
- this->init_(w, c);
+ init_(w, c);
}
template <typename W, typename F>
- template <typename P>
+ template <typename Pref>
inline
void
- multiple_qiter<W,F>::init_(const multiple<W,F>& w, const P& c)
+ multiple_qiter<W,F>::init_(const multiple<W,F>& w, const Pref& c)
{
this->center_at(c);
// We have to first change the center so that 'invalidate' can
--
1.6.4.2
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
ChangeLog:
2009-09-04 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fix red component bug.
* fabien/mln/upsampling/hq3x.hh: Fix red component bug, still not
working properly because of blue artifacts.
---
hq3x.hh | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Index: trunk/milena/sandbox/fabien/mln/upsampling/hq3x.hh
===================================================================
--- trunk/milena/sandbox/fabien/mln/upsampling/hq3x.hh (revision 4421)
+++ trunk/milena/sandbox/fabien/mln/upsampling/hq3x.hh (revision 4422)
@@ -74,7 +74,7 @@
unsigned short result = 0;
result += val.red() >> 3;
- result = result << 11;
+ result = result << 6;
result += val.green() >> 2;
result = result << 5;
result += val.blue() >> 3;
@@ -91,7 +91,7 @@
result += (val.red() + val.green() + val.blue()) / 3;
result = result << 8;
result = result << 8;
- result = result << 8;
+ //result = result << 8;
return result;
}
@@ -126,9 +126,6 @@
void
Interp3(image2d<T>& output, int row, int col, int c1, int c2)
{
- //*((int*)output) = (c1*7+c2)/8;
- //*((int*)output) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00)) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF)) & 0x07F807F8)) >> 3;
intToRgb8((c1 * 7 + c2) / 8, output.at_(row, col));
}
@@ -137,9 +134,6 @@
void
Interp4(image2d<T>& output, int row, int col, int c1, int c2, int c3)
{
- //*((int*)output) = (c1*2+(c2+c3)*7)/16;
- //*((int*)output) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7) & 0x000FF000) +
- // (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7) & 0x0FF00FF0)) >> 4;
intToRgb8((c1 * 2 + (c2 + c3) * 7) / 16, output.at_(row, col));
}
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
ChangeLog:
2009-09-04 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add implementation of HQ3x algorithm.
* fabien/mln/core/image/magick_tiled2d.hh: Small update.
* fabien/mln/core/image/tiled2d.hh: Small update.
* fabien/mln/upsampling/hq3x.hh: Implement HQ3x algorithm, not working
properly with colors.
* fabien/tests/core/image/tiled2d.cc: Update test.
* fabien/tests/upsampling/Makefile: New Makefile for target hq3x.
* fabien/tests/upsampling/hq3x.cc: New test for algorithm HQ3x.
---
mln/core/image/magick_tiled2d.hh | 5
mln/upsampling/hq3x.hh | 3981 +++++++++++++++++++++++++++++++++++++++
tests/core/image/tiled2d.cc | 2
tests/upsampling/Makefile | 6
tests/upsampling/hq3x.cc | 29
5 files changed, 4019 insertions(+), 4 deletions(-)
Index: trunk/milena/sandbox/fabien/tests/upsampling/hq3x.cc
===================================================================
--- trunk/milena/sandbox/fabien/tests/upsampling/hq3x.cc (revision 0)
+++ trunk/milena/sandbox/fabien/tests/upsampling/hq3x.cc (revision 4421)
@@ -0,0 +1,29 @@
+#include <mln/core/image/image2d.hh>
+
+#include <mln/io/ppm/all.hh>
+#include <mln/value/rgb8.hh>
+
+#include <mln/upsampling/hq3x.hh>
+
+
+using namespace mln;
+using value::rgb8;
+
+
+int main(int argc, char* argv[])
+{
+ if (argc != 3)
+ {
+ std::cout << "Usage: " << argv[0] << " input output" << std::endl;
+ return 1;
+ }
+
+ image2d<rgb8> ima;
+ io::ppm::load(ima, argv[1]);
+
+ image2d<rgb8> hq3x_ima;
+ hq3x_ima = upsampling::hq3x(ima);
+ io::ppm::save(hq3x_ima, argv[2]);
+
+ return 0;
+}
Index: trunk/milena/sandbox/fabien/tests/upsampling/Makefile
===================================================================
--- trunk/milena/sandbox/fabien/tests/upsampling/Makefile (revision 0)
+++ trunk/milena/sandbox/fabien/tests/upsampling/Makefile (revision 4421)
@@ -0,0 +1,6 @@
+CXX = g++
+CXXFLAGS = -DNDEBUG -O1
+INC = -I../../ -I../../../../
+
+hq3x: hq3x.cc
+ ${CXX} ${CXXFLAGS} ${INC} $^ -o hq3x
Index: trunk/milena/sandbox/fabien/tests/core/image/tiled2d.cc
===================================================================
--- trunk/milena/sandbox/fabien/tests/core/image/tiled2d.cc (revision 4420)
+++ trunk/milena/sandbox/fabien/tests/core/image/tiled2d.cc (revision 4421)
@@ -16,7 +16,7 @@
{
if (argc != 2)
{
- std::cout << "Usage: " << argv[0] << " input output" << std::endl;
+ std::cout << "Usage: " << argv[0] << " input" << std::endl;
return 1;
}
Index: trunk/milena/sandbox/fabien/mln/upsampling/hq3x.hh
===================================================================
--- trunk/milena/sandbox/fabien/mln/upsampling/hq3x.hh (revision 0)
+++ trunk/milena/sandbox/fabien/mln/upsampling/hq3x.hh (revision 4421)
@@ -0,0 +1,3981 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_UPSAMPLING_HQ3X_HH
+# define MLN_UPSAMPLING_HQ3X_HH
+
+/// \file
+///
+/// Produce an up-scaled image using hq3x algorithm.
+
+# include <mln/geom/ncols.hh>
+# include <mln/geom/nrows.hh>
+# include <mln/value/rgb8.hh>
+
+
+namespace mln
+{
+
+ namespace upsampling
+ {
+
+ /// Subsampling FIXME : doxy
+ template <typename I>
+ inline
+ mln_concrete(I)
+ hq3x(const Image<I>& input);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+ inline
+ int
+ rgb8toInt(value::rgb8 val)
+ {
+ int result = 0;
+
+ result += val.blue();
+ result = result << 8;
+ result += val.green();
+ result = result << 8;
+ result += val.red();
+ //result = result << 8;
+
+ return result;
+ }
+
+ inline
+ unsigned short
+ rgb8toShort(value::rgb8 val)
+ {
+ unsigned short result = 0;
+
+ result += val.red() >> 3;
+ result = result << 11;
+ result += val.green() >> 2;
+ result = result << 5;
+ result += val.blue() >> 3;
+
+ return result;
+ }
+
+ inline
+ unsigned int
+ rgb8toYuv(value::rgb8 val)
+ {
+ unsigned int result = 0;
+
+ result += (val.red() + val.green() + val.blue()) / 3;
+ result = result << 8;
+ result = result << 8;
+ result = result << 8;
+
+ return result;
+ }
+
+ inline
+ void
+ intToRgb8(int in, value::rgb8& out)
+ {
+ out.blue() = in % 256;
+ out.green() = (in >> 8) % 256;
+ out.red() = (in >> 16) % 256;
+ }
+
+ template<typename T>
+ inline
+ void
+ Interp1(image2d<T>& output, int row, int col, int c1, int c2)
+ {
+ intToRgb8((c1 * 3 + c2) >> 2, output.at_(row, col));
+ }
+
+ template<typename T>
+ inline
+ void
+ Interp2(image2d<T>& output, int row, int col, int c1, int c2, int c3)
+ {
+ intToRgb8((c1 * 2 + c2 + c3) >> 2, output.at_(row, col));
+ }
+
+ template<typename T>
+ inline
+ void
+ Interp3(image2d<T>& output, int row, int col, int c1, int c2)
+ {
+ //*((int*)output) = (c1*7+c2)/8;
+ //*((int*)output) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00)) & 0x0007F800) +
+ // (((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF)) & 0x07F807F8)) >> 3;
+ intToRgb8((c1 * 7 + c2) / 8, output.at_(row, col));
+ }
+
+ template<typename T>
+ inline
+ void
+ Interp4(image2d<T>& output, int row, int col, int c1, int c2, int c3)
+ {
+ //*((int*)output) = (c1*2+(c2+c3)*7)/16;
+ //*((int*)output) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7) & 0x000FF000) +
+ // (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7) & 0x0FF00FF0)) >> 4;
+ intToRgb8((c1 * 2 + (c2 + c3) * 7) / 16, output.at_(row, col));
+ }
+
+ template<typename T>
+ inline
+ void
+ Interp5(image2d<T>& output, int row, int col, int c1, int c2)
+ {
+ intToRgb8((c1 + c2) >> 1, output.at_(row, col));
+ }
+
+ template<typename T>
+ inline
+ void
+ Interp6(image2d<T>& output, int row, int col, int c1)
+ {
+ intToRgb8(c1, output.at_(row, col));
+ }
+
+
+# define PIXEL00_1M Interp1(output, i * 3, j * 3, c[5], c[1]);
+# define PIXEL00_1U Interp1(output, i * 3, j * 3, c[5], c[2]);
+# define PIXEL00_1L Interp1(output, i * 3, j * 3, c[5], c[4]);
+# define PIXEL00_2 Interp2(output, i * 3, j * 3, c[5], c[4], c[2]);
+# define PIXEL00_4 Interp4(output, i * 3, j * 3, c[5], c[4], c[2]);
+# define PIXEL00_5 Interp5(output, i * 3, j * 3, c[4], c[2]);
+# define PIXEL00_C Interp6(output, i * 3, j * 3, c[5]);
+
+# define PIXEL01_1 Interp1(output, i * 3, j * 3 + 1, c[5], c[2]);
+# define PIXEL01_3 Interp3(output, i * 3, j * 3 + 1, c[5], c[2]);
+# define PIXEL01_6 Interp1(output, i * 3, j * 3 + 1, c[2], c[5]);
+# define PIXEL01_C Interp6(output, i * 3, j * 3 + 1, c[5]);
+
+# define PIXEL02_1M Interp1(output, i * 3, j * 3 + 2, c[5], c[3]);
+# define PIXEL02_1U Interp1(output, i * 3, j * 3 + 2, c[5], c[2]);
+# define PIXEL02_1R Interp1(output, i * 3, j * 3 + 2, c[5], c[6]);
+# define PIXEL02_2 Interp2(output, i * 3, j * 3 + 2, c[5], c[2], c[6]);
+# define PIXEL02_4 Interp4(output, i * 3, j * 3 + 2, c[5], c[2], c[6]);
+# define PIXEL02_5 Interp5(output, i * 3, j * 3 + 2, c[2], c[6]);
+# define PIXEL02_C Interp6(output, i * 3, j * 3 + 2, c[5]);
+
+# define PIXEL10_1 Interp1(output, i * 3 + 1, j * 3, c[5], c[4]);
+# define PIXEL10_3 Interp3(output, i * 3 + 1, j * 3, c[5], c[4]);
+# define PIXEL10_6 Interp1(output, i * 3 + 1, j * 3, c[4], c[5]);
+# define PIXEL10_C Interp6(output, i * 3 + 1, j * 3, c[5]);
+
+# define PIXEL11 Interp6(output, i * 3 + 1, j * 3 + 1, c[5]);
+
+# define PIXEL12_1 Interp1(output, i * 3 + 1, j * 3 + 2, c[5], c[6]);
+# define PIXEL12_3 Interp3(output, i * 3 + 1, j * 3 + 2, c[5], c[6]);
+# define PIXEL12_6 Interp1(output, i * 3 + 1, j * 3 + 2, c[6], c[5]);
+# define PIXEL12_C Interp6(output, i * 3 + 1, j * 3 + 2, c[5]);
+
+# define PIXEL20_1M Interp1(output, i * 3 + 2, j * 3, c[5], c[7]);
+# define PIXEL20_1D Interp1(output, i * 3 + 2, j * 3, c[5], c[8]);
+# define PIXEL20_1L Interp1(output, i * 3 + 2, j * 3, c[5], c[4]);
+# define PIXEL20_2 Interp2(output, i * 3 + 2, j * 3, c[5], c[8], c[4]);
+# define PIXEL20_4 Interp4(output, i * 3 + 2, j * 3, c[5], c[8], c[4]);
+# define PIXEL20_5 Interp5(output, i * 3 + 2, j * 3, c[8], c[4]);
+# define PIXEL20_C Interp6(output, i * 3 + 2, j * 3, c[5]);
+
+# define PIXEL21_1 Interp1(output, i * 3 + 2, j * 3 + 1, c[5], c[8]);
+# define PIXEL21_3 Interp3(output, i * 3 + 2, j * 3 + 1, c[5], c[8]);
+# define PIXEL21_6 Interp1(output, i * 3 + 2, j * 3 + 1, c[8], c[5]);
+# define PIXEL21_C Interp6(output, i * 3 + 2, j * 3 + 1, c[5]);
+
+# define PIXEL22_1M Interp1(output, i * 3 + 2, j * 3 + 2, c[5], c[9]);
+# define PIXEL22_1D Interp1(output, i * 3 + 2, j * 3 + 2, c[5], c[8]);
+# define PIXEL22_1R Interp1(output, i * 3 + 2, j * 3 + 2, c[5], c[6]);
+# define PIXEL22_2 Interp2(output, i * 3 + 2, j * 3 + 2, c[5], c[6], c[8]);
+# define PIXEL22_4 Interp4(output, i * 3 + 2, j * 3 + 2, c[5], c[6], c[8]);
+# define PIXEL22_5 Interp5(output, i * 3 + 2, j * 3 + 2, c[6], c[8]);
+# define PIXEL22_C Interp6(output, i * 3 + 2, j * 3 + 2, c[5]);
+
+ inline
+ bool
+ Diff(int& YUV1, int& YUV2, int* RGBtoYUV,
+ const int trY, const int trU, const int trV,
+ const int Ymask, const int Umask, const int Vmask,
+ unsigned int w1, unsigned int w2)
+ {
+ YUV1 = RGBtoYUV[w1];
+ YUV2 = RGBtoYUV[w2];
+ return ((abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY) ||
+ (abs((YUV1 & Umask) - (YUV2 & Umask)) > trU) ||
+ (abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV));
+ }
+
+ inline
+ void
+ initLUTs(int LUT16to32[65536], int RGBtoYUV[65536])
+ {
+ int i, j, k, r, g, b, Y, u, v;
+
+ for (i=0; i<65536; i++)
+ LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3);
+
+ for (i=0; i<32; i++)
+ for (j=0; j<64; j++)
+ for (k=0; k<32; k++)
+ {
+ r = i << 3;
+ g = j << 2;
+ b = k << 3;
+ Y = (r + g + b) >> 2;
+ u = 128 + ((r - b) >> 2);
+ v = 128 + ((-r + 2*g -b)>>3);
+ RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
+ }
+ }
+
+
+ //FIXME: In Milena, nrows != row max
+ template <typename T>
+ inline
+ mln_concrete(image2d<T>)
+ hq3x_(const image2d<T>& input)
+ {
+ trace::entering("upsampling::impl::hq3x_");
+
+ int nrows = geom::nrows(input);
+ int ncols = geom::ncols(input);
+ mln_concrete(image2d<T>) output(nrows * 3, ncols * 3);
+
+ int LUT16to32[65536];
+ int RGBtoYUV[65536];
+ int YUV1, YUV2;
+ const int Ymask = 0x00FF0000;
+ const int Umask = 0x0000FF00;
+ const int Vmask = 0x000000FF;
+ const int trY = 0x00300000;
+ const int trU = 0x00000700;
+ const int trV = 0x00000006;
+
+ initLUTs(LUT16to32, RGBtoYUV);
+
+ unsigned int w[10];
+ unsigned int c[10];
+
+ // +----+----+----+
+ // | | | |
+ // | w1 | w2 | w3 |
+ // +----+----+----+
+ // | | | |
+ // | w4 | w5 | w6 |
+ // +----+----+----+
+ // | | | |
+ // | w7 | w8 | w9 |
+ // +----+----+----+
+ //
+ // w5 is the current point.
+
+ for (int j = 0; j < ncols; j++)
+ {
+ for (int i = 0; i < nrows; i++)
+ {
+ w[1] = rgb8toShort(input.at_(i - 1, j - 1));
+ w[2] = rgb8toShort(input.at_(i - 1, j));
+ w[3] = rgb8toShort(input.at_(i - 1, j + 1));
+ w[4] = rgb8toShort(input.at_(i, j - 1));
+ w[5] = rgb8toShort(input.at_(i, j));
+ w[6] = rgb8toShort(input.at_(i, j + 1));
+ w[7] = rgb8toShort(input.at_(i + 1, j - 1));
+ w[8] = rgb8toShort(input.at_(i + 1, j));
+ w[9] = rgb8toShort(input.at_(i + 1, j + 1));
+
+ int pattern = 0;
+ int flag = 1;
+
+ YUV1 = RGBtoYUV[w[5]];
+
+ for (int k = 1; k <= 9; k++)
+ {
+ if (k == 5)
+ continue;
+
+ if (w[k] != w[5])
+ {
+ YUV2 = RGBtoYUV[w[k]];
+ if ((abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY) ||
+ (abs((YUV1 & Umask) - (YUV2 & Umask)) > trU) ||
+ (abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV))
+ pattern |= flag;
+ }
+ flag <<= 1;
+ }
+
+ for (int k = 1; k <= 9; k++)
+ c[k] = LUT16to32[w[k]];
+
+ switch (pattern)
+ {
+ case 0:
+ case 1:
+ case 4:
+ case 32:
+ case 128:
+ case 5:
+ case 132:
+ case 160:
+ case 33:
+ case 129:
+ case 36:
+ case 133:
+ case 164:
+ case 161:
+ case 37:
+ case 165:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 2:
+ case 34:
+ case 130:
+ case 162:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 16:
+ case 17:
+ case 48:
+ case 49:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 64:
+ case 65:
+ case 68:
+ case 69:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 8:
+ case 12:
+ case 136:
+ case 140:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 3:
+ case 35:
+ case 131:
+ case 163:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 6:
+ case 38:
+ case 134:
+ case 166:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 20:
+ case 21:
+ case 52:
+ case 53:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 144:
+ case 145:
+ case 176:
+ case 177:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 192:
+ case 193:
+ case 196:
+ case 197:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 96:
+ case 97:
+ case 100:
+ case 101:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 40:
+ case 44:
+ case 168:
+ case 172:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 9:
+ case 13:
+ case 137:
+ case 141:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 18:
+ case 50:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 80:
+ case 81:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 72:
+ case 76:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_1M
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 10:
+ case 138:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 66:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 24:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 7:
+ case 39:
+ case 135:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 148:
+ case 149:
+ case 180:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 224:
+ case 228:
+ case 225:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 41:
+ case 169:
+ case 45:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 22:
+ case 54:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 208:
+ case 209:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 104:
+ case 108:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 11:
+ case 139:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 19:
+ case 51:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL01_6
+ PIXEL02_5
+ PIXEL12_1
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 146:
+ case 178:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL12_C
+ PIXEL22_1D
+ }
+ else
+ {
+ PIXEL01_1
+ PIXEL02_5
+ PIXEL12_6
+ PIXEL22_2
+ }
+ PIXEL00_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_2
+ PIXEL21_1
+ break;
+ }
+ case 84:
+ case 85:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL02_1U
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL02_2
+ PIXEL12_6
+ PIXEL21_1
+ PIXEL22_5
+ }
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ break;
+ }
+ case 112:
+ case 113:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_6
+ PIXEL22_5
+ }
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ break;
+ }
+ case 200:
+ case 204:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ }
+ else
+ {
+ PIXEL10_1
+ PIXEL20_5
+ PIXEL21_6
+ PIXEL22_2
+ }
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL11
+ PIXEL12_1
+ break;
+ }
+ case 73:
+ case 77:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL00_1U
+ PIXEL10_C
+ PIXEL20_1M
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL10_6
+ PIXEL20_5
+ PIXEL21_1
+ }
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL11
+ PIXEL12_1
+ PIXEL22_1M
+ break;
+ }
+ case 42:
+ case 170:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL10_C
+ PIXEL20_1D
+ }
+ else
+ {
+ PIXEL00_5
+ PIXEL01_1
+ PIXEL10_6
+ PIXEL20_2
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 14:
+ case 142:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_5
+ PIXEL01_6
+ PIXEL02_2
+ PIXEL10_1
+ }
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 67:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 70:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 28:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 152:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 194:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 98:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 56:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 25:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 26:
+ case 31:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL10_3
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL11
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 82:
+ case 214:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 88:
+ case 248:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 74:
+ case 107:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ }
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 27:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 86:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 216:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 106:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 30:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 210:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 120:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 75:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 29:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 198:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 184:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 99:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 57:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 71:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 156:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 226:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 60:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 195:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 102:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 153:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 58:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 83:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 92:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 202:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 78:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 154:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 114:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 89:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 90:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 55:
+ case 23:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL01_6
+ PIXEL02_5
+ PIXEL12_1
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 182:
+ case 150:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ PIXEL22_1D
+ }
+ else
+ {
+ PIXEL01_1
+ PIXEL02_5
+ PIXEL12_6
+ PIXEL22_2
+ }
+ PIXEL00_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_2
+ PIXEL21_1
+ break;
+ }
+ case 213:
+ case 212:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL02_1U
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL02_2
+ PIXEL12_6
+ PIXEL21_1
+ PIXEL22_5
+ }
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ break;
+ }
+ case 241:
+ case 240:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_6
+ PIXEL22_5
+ }
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ break;
+ }
+ case 236:
+ case 232:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ PIXEL22_1R
+ }
+ else
+ {
+ PIXEL10_1
+ PIXEL20_5
+ PIXEL21_6
+ PIXEL22_2
+ }
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL11
+ PIXEL12_1
+ break;
+ }
+ case 109:
+ case 105:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL00_1U
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL10_6
+ PIXEL20_5
+ PIXEL21_1
+ }
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL11
+ PIXEL12_1
+ PIXEL22_1M
+ break;
+ }
+ case 171:
+ case 43:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ PIXEL20_1D
+ }
+ else
+ {
+ PIXEL00_5
+ PIXEL01_1
+ PIXEL10_6
+ PIXEL20_2
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 143:
+ case 15:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_5
+ PIXEL01_6
+ PIXEL02_2
+ PIXEL10_1
+ }
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 124:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 203:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 62:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 211:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 118:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 217:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 110:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 155:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 188:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 185:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 61:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 157:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 103:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 227:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 230:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 199:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 220:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 158:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 234:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1R
+ break;
+ }
+ case 242:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1L
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 59:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 121:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 87:
+ {
+ PIXEL00_1L
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1M
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 79:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1R
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 122:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 94:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_C
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 218:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 91:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 229:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 167:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 173:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 181:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 186:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 115:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 93:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 206:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 205:
+ case 201:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_1M
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 174:
+ case 46:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_1M
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 179:
+ case 147:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_1M
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 117:
+ case 116:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_1M
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 189:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 231:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 126:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 219:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ PIXEL10_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 125:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL00_1U
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL10_6
+ PIXEL20_5
+ PIXEL21_1
+ }
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL11
+ PIXEL12_C
+ PIXEL22_1M
+ break;
+ }
+ case 221:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL02_1U
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL02_2
+ PIXEL12_6
+ PIXEL21_1
+ PIXEL22_5
+ }
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1M
+ break;
+ }
+ case 207:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_5
+ PIXEL01_6
+ PIXEL02_2
+ PIXEL10_1
+ }
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 238:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ PIXEL22_1R
+ }
+ else
+ {
+ PIXEL10_1
+ PIXEL20_5
+ PIXEL21_6
+ PIXEL22_2
+ }
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL11
+ PIXEL12_1
+ break;
+ }
+ case 190:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ PIXEL22_1D
+ }
+ else
+ {
+ PIXEL01_1
+ PIXEL02_5
+ PIXEL12_6
+ PIXEL22_2
+ }
+ PIXEL00_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1D
+ PIXEL21_1
+ break;
+ }
+ case 187:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ PIXEL20_1D
+ }
+ else
+ {
+ PIXEL00_5
+ PIXEL01_1
+ PIXEL10_6
+ PIXEL20_2
+ }
+ PIXEL02_1M
+ PIXEL11
+ PIXEL12_C
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 243:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_1
+ PIXEL20_2
+ PIXEL21_6
+ PIXEL22_5
+ }
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL10_1
+ PIXEL11
+ break;
+ }
+ case 119:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL01_6
+ PIXEL02_5
+ PIXEL12_1
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL20_1L
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 237:
+ case 233:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_2
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 175:
+ case 47:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_2
+ break;
+ }
+ case 183:
+ case 151:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_2
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 245:
+ case 244:
+ {
+ PIXEL00_2
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 250:
+ {
+ PIXEL00_1M
+ PIXEL01_C
+ PIXEL02_1M
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 123:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ }
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 95:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL10_3
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL11
+ PIXEL20_1M
+ PIXEL21_C
+ PIXEL22_1M
+ break;
+ }
+ case 222:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 252:
+ {
+ PIXEL00_1M
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 249:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 235:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ }
+ PIXEL02_1M
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 111:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 63:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1M
+ break;
+ }
+ case 159:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL10_3
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 215:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 246:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 254:
+ {
+ PIXEL00_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_4
+ }
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_4
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL21_3
+ PIXEL22_2
+ }
+ break;
+ }
+ case 253:
+ {
+ PIXEL00_1U
+ PIXEL01_1
+ PIXEL02_1U
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 251:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL01_3
+ }
+ PIXEL02_1M
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL10_C
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL10_3
+ PIXEL20_2
+ PIXEL21_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL12_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL12_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 239:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ PIXEL02_1R
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_1
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ PIXEL22_1R
+ break;
+ }
+ case 127:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL01_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_2
+ PIXEL01_3
+ PIXEL10_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL02_4
+ PIXEL12_3
+ }
+ PIXEL11
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ PIXEL21_C
+ }
+ else
+ {
+ PIXEL20_4
+ PIXEL21_3
+ }
+ PIXEL22_1M
+ break;
+ }
+ case 191:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1D
+ PIXEL21_1
+ PIXEL22_1D
+ break;
+ }
+ case 223:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ PIXEL10_C
+ }
+ else
+ {
+ PIXEL00_4
+ PIXEL10_3
+ }
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL01_C
+ PIXEL02_C
+ PIXEL12_C
+ }
+ else
+ {
+ PIXEL01_3
+ PIXEL02_2
+ PIXEL12_3
+ }
+ PIXEL11
+ PIXEL20_1M
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL21_C
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL21_3
+ PIXEL22_4
+ }
+ break;
+ }
+ case 247:
+ {
+ PIXEL00_1L
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_1
+ PIXEL11
+ PIXEL12_C
+ PIXEL20_1L
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ case 255:
+ {
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[4], w[2]))
+ {
+ PIXEL00_C
+ }
+ else
+ {
+ PIXEL00_2
+ }
+ PIXEL01_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[2], w[6]))
+ {
+ PIXEL02_C
+ }
+ else
+ {
+ PIXEL02_2
+ }
+ PIXEL10_C
+ PIXEL11
+ PIXEL12_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[8], w[4]))
+ {
+ PIXEL20_C
+ }
+ else
+ {
+ PIXEL20_2
+ }
+ PIXEL21_C
+ if (Diff(YUV1, YUV2, RGBtoYUV, trY, trU, trV, Ymask, Umask, Vmask, w[6], w[8]))
+ {
+ PIXEL22_C
+ }
+ else
+ {
+ PIXEL22_2
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ trace::exiting("upsampling::impl::hq3x_");
+ return output;
+ }
+
+ } // end of namespace mln::upsampling::impl
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ hq3x(const Image<I>& input)
+ {
+ trace::entering("upsampling::hq3x");
+ mln_precondition(exact(input).is_valid());
+
+ mln_concrete(I) output;
+
+ output = impl::hq3x_(exact(input));
+
+ trace::exiting("upsampling::hq3x");
+ return output;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::upsampling
+
+} // end of namespace mln
+
+
+#endif // ! MLN_UPSAMPLING_HQ3X_HH
Index: trunk/milena/sandbox/fabien/mln/core/image/magick_tiled2d.hh
===================================================================
--- trunk/milena/sandbox/fabien/mln/core/image/magick_tiled2d.hh (revision 4420)
+++ trunk/milena/sandbox/fabien/mln/core/image/magick_tiled2d.hh (revision 4421)
@@ -27,7 +27,7 @@
# define MLN_CORE_IMAGE_TILED2D_HH
/// \file
-/// Definition of the basic mln::tiled2d class.
+/// Definition of the basic mln::magick_tiled2d class.
# include <Magick++.h>
@@ -47,17 +47,16 @@
{
// Forward declaration.
- template <typename T> struct tiled2d;
+ template <typename T> struct magick_tiled2d;
namespace internal
{
- /// Data structure for \c mln::tiled2d<T>.
+ /// Data structure for \c mln::magick_tiled2d<T>.
template <typename T>
- struct data< tiled2d<T> >
+ struct data< magick_tiled2d<T> >
{
-// data(const box2d& b, unsigned bdr);
data(const std::string& filename);
~data();
@@ -72,7 +71,7 @@
void update_vb_();
void allocate_();
void deallocate_();
- void swap_(data< tiled2d<T> >& other_);
+ void swap_(data< magick_tiled2d<T> >& other_);
void reallocate_(unsigned new_border);
};
@@ -83,7 +82,7 @@
{
template <typename T>
- struct image_< tiled2d<T> > : default_image_< T, tiled2d<T> >
+ struct image_< magick_tiled2d<T> > : default_image_< T, magick_tiled2d<T> >
{
// misc
typedef trait::image::category::primary category;
@@ -123,9 +122,9 @@
/// \ingroup modimageconcrete
//
template <typename T>
- class tiled2d : public internal::image_primary< T, mln::box2d, tiled2d<T> >
+ class magick_tiled2d : public internal::image_primary< T, mln::box2d, magick_tiled2d<T> >
{
- typedef internal::image_primary< T, mln::box2d, tiled2d<T> > super_;
+ typedef internal::image_primary< T, mln::box2d, magick_tiled2d<T> > super_;
public:
/// Value associated type.
@@ -135,30 +134,19 @@
typedef const T& rvalue;
/// Return type of read-write access.
- typedef mln::value::proxy< tiled2d<T> > lvalue;
+ typedef mln::value::proxy< magick_tiled2d<T> > lvalue;
/// Skeleton.
- typedef tiled2d< tag::value_<T> > skeleton;
+ typedef magick_tiled2d< tag::value_<T> > skeleton;
/// Constructor without argument.
- tiled2d();
-
- /// Constructor with the numbers of rows and columns and the
- /// border thickness.
- //tiled2d(int nrows, int ncols, unsigned bdr = border::thickness);
-
- /// Constructor with a box and the border thickness (default is
- /// 3).
- // tiled2d(const box2d& b, unsigned bdr = border::thickness);
+ magick_tiled2d();
/// Constructor with a filename.
- tiled2d(const std::string& filename);
-
+ magick_tiled2d(const std::string& filename);
- /// Initialize an empty image.
- //void init_(const box2d& b, unsigned bdr = border::thickness);
/// Initialize an empty image.
void init_(const std::string& filename);
@@ -177,7 +165,7 @@
const T& operator()(const point2d& p) const;
/// Read-write access to the image value located at point \p p.
- mln::value::proxy< tiled2d<T> > operator()(const point2d& p);
+ mln::value::proxy< magick_tiled2d<T> > operator()(const point2d& p);
// Read access to the image value located at point \p p.
const T& read_(const point2d& p) const;
@@ -252,10 +240,10 @@
// Forward declaration
template <typename T>
- void init_(tag::border_t, unsigned& bdr, const tiled2d<T>& model);
+ void init_(tag::border_t, unsigned& bdr, const magick_tiled2d<T>& model);
template <typename T, typename J>
- void init_(tag::image_t, mln::tiled2d<T>& target, const J& model);
+ void init_(tag::image_t, mln::magick_tiled2d<T>& target, const J& model);
@@ -265,14 +253,14 @@
template <typename T>
inline
- void init_(tag::border_t, unsigned& bdr, const tiled2d<T>& model)
+ void init_(tag::border_t, unsigned& bdr, const magick_tiled2d<T>& model)
{
bdr = model.border();
}
template <typename T, typename J>
inline
- void init_(tag::image_t, tiled2d<T>& target, const J& model)
+ void init_(tag::image_t, magick_tiled2d<T>& target, const J& model)
{
box2d b;
init_(tag::bbox, b, model);
@@ -282,36 +270,22 @@
}
- // internal::data< tiled2d<T> >
+ // internal::data< magick_tiled2d<T> >
namespace internal
{
-/* template <typename T>
- inline
- data< tiled2d<T> >::data(const box2d& b, unsigned bdr)
- : buffer_(0),
- b_ (b),
- bdr_ (bdr)
- {
- allocate_();
- }*/
template <typename T>
inline
- data< tiled2d<T> >::data(const std::string& filename)
+ data< magick_tiled2d<T> >::data(const std::string& filename)
{
buffer_.read(filename);
- // DELETEME
- std::cout << "columns: " << buffer_.columns() << std::endl;
- std::cout << "rows: " << buffer_.rows() << std::endl;
- // ! DELETEME
b_ = make::box2d(buffer_.rows(), buffer_.columns());
- std::cout << "bbox: " << b_ << std::endl; // DELETEME
}
template <typename T>
inline
- data< tiled2d<T> >::~data()
+ data< magick_tiled2d<T> >::~data()
{
deallocate_();
}
@@ -319,7 +293,7 @@
template <typename T>
inline
void
- data< tiled2d<T> >::update_vb_()
+ data< magick_tiled2d<T> >::update_vb_()
{
vb_.pmin() = b_.pmin() - dpoint2d(all_to(bdr_));
vb_.pmax() = b_.pmax() + dpoint2d(all_to(bdr_));
@@ -328,21 +302,9 @@
template <typename T>
inline
void
- data< tiled2d<T> >::allocate_()
+ data< magick_tiled2d<T> >::allocate_()
{
update_vb_();
-// unsigned
-// nr = vb_.len(0),
-// nc = vb_.len(1);
-// buffer_ = new T[nr * nc];
-// array_ = new T*[nr];
-// T* buf = buffer_ - vb_.pmin().col();
-// for (unsigned i = 0; i < nr; ++i)
-// {
-// array_[i] = buf;
-// buf += nc;
-// }
-// array_ -= vb_.pmin().row();
mln_postcondition(vb_.len(0) == b_.len(0) + 2 * bdr_);
mln_postcondition(vb_.len(1) == b_.len(1) + 2 * bdr_);
}
@@ -350,27 +312,16 @@
template <typename T>
inline
void
- data< tiled2d<T> >::deallocate_()
+ data< magick_tiled2d<T> >::deallocate_()
{
-// if (buffer_)
-// {
-// delete[] buffer_;
-// buffer_ = 0;
-// }
-// if (array_)
-// {
-// array_ += vb_.pmin().row();
-// delete[] array_;
-// array_ = 0;
-// }
}
template <typename T>
inline
void
- data< tiled2d<T> >::swap_(data< tiled2d<T> >& other_)
+ data< magick_tiled2d<T> >::swap_(data< magick_tiled2d<T> >& other_)
{
- data< tiled2d<T> > self_ = *this;
+ data< magick_tiled2d<T> > self_ = *this;
*this = other_;
other_ = self_;
}
@@ -378,9 +329,9 @@
template <typename T>
inline
void
- data< tiled2d<T> >::reallocate_(unsigned new_border)
+ data< magick_tiled2d<T> >::reallocate_(unsigned new_border)
{
- data< tiled2d<T> >& tmp = *(new data< tiled2d<T> >(this->b_, new_border));
+ data< magick_tiled2d<T> >& tmp = *(new data< magick_tiled2d<T> >(this->b_, new_border));
this->swap_(tmp);
}
@@ -388,17 +339,17 @@
} // end of namespace mln::internal
- // tiled2d<T>
+ // magick_tiled2d<T>
template <typename T>
inline
- tiled2d<T>::tiled2d()
+ magick_tiled2d<T>::magick_tiled2d()
{
}
template <typename T>
inline
- tiled2d<T>::tiled2d(const std::string& filename)
+ magick_tiled2d<T>::magick_tiled2d(const std::string& filename)
{
init_(filename);
}
@@ -406,16 +357,16 @@
template <typename T>
inline
void
- tiled2d<T>::init_(const std::string& filename)
+ magick_tiled2d<T>::init_(const std::string& filename)
{
mln_precondition(! this->is_valid());
- this->data_ = new internal::data< tiled2d<T> >(filename);
+ this->data_ = new internal::data< magick_tiled2d<T> >(filename);
}
template <typename T>
inline
const box2d&
- tiled2d<T>::domain() const
+ magick_tiled2d<T>::domain() const
{
mln_precondition(this->is_valid());
return this->data_->b_;
@@ -424,7 +375,7 @@
template <typename T>
inline
const box2d&
- tiled2d<T>::bbox() const
+ magick_tiled2d<T>::bbox() const
{
mln_precondition(this->is_valid());
return this->data_->b_;
@@ -433,7 +384,7 @@
template <typename T>
inline
bool
- tiled2d<T>::has(const point2d& p) const
+ magick_tiled2d<T>::has(const point2d& p) const
{
mln_precondition(this->is_valid());
return this->data_->vb_.has(p);
@@ -442,26 +393,26 @@
template <typename T>
inline
const T&
- tiled2d<T>::operator()(const point2d& p) const
+ magick_tiled2d<T>::operator()(const point2d& p) const
{
return read_(p);
}
template <typename T>
inline
- mln::value::proxy< tiled2d<T> >
- tiled2d<T>::operator()(const point2d& p)
+ mln::value::proxy< magick_tiled2d<T> >
+ magick_tiled2d<T>::operator()(const point2d& p)
{
- mln::value::proxy<tiled2d> prx(*this, p);
+ mln::value::proxy<magick_tiled2d> prx(*this, p);
return prx;
}
template <typename T>
inline
const T&
- tiled2d<T>::read_(const point2d& p) const
+ magick_tiled2d<T>::read_(const point2d& p) const
{
- mln::tiled2d<T>* this_ = const_cast<mln::tiled2d<T>* >(this); // Trust me, I have to do this(_).
+ mln::magick_tiled2d<T>* this_ = const_cast<mln::magick_tiled2d<T>* >(this); // Trust me, I have to do this(_).
this_->data_->pixel_cache = this_->data_->buffer_.getPixels(p.col(), p.row(), p.col(), p.row());
this->data_->value_.red() = this->data_->pixel_cache->red % 256;
this->data_->value_.green() = this->data_->pixel_cache->green % 256;
@@ -472,7 +423,7 @@
template <typename T>
inline
void
- tiled2d<T>::write_(const point2d& p, const T& value)
+ magick_tiled2d<T>::write_(const point2d& p, const T& value)
{
std::cout << "setting value " << value << " at point " << p << std::endl; // DELETEME
/*this->data_->pixel_cache = this->data_->buffer_.getPixels(p.col(), p.row(), p.col(), p.row());
@@ -487,7 +438,7 @@
template <typename T>
inline
const T&
- tiled2d<T>::at_(unsigned row, unsigned col) const
+ magick_tiled2d<T>::at_(unsigned row, unsigned col) const
{
mln_precondition(this->has(point2d(row, col)));
//FIXME: use the cache Luke.
@@ -501,7 +452,7 @@
template <typename T>
inline
T&
- tiled2d<T>::at_(unsigned row, unsigned col)
+ magick_tiled2d<T>::at_(unsigned row, unsigned col)
{
mln_precondition(this->has(point2d(row, col)));
//FIXME: use the cache Luke.
@@ -515,7 +466,7 @@
template <typename T>
inline
unsigned
- tiled2d<T>::nrows() const
+ magick_tiled2d<T>::nrows() const
{
mln_precondition(this->is_valid());
return this->data_->b_.len(0);
@@ -524,7 +475,7 @@
template <typename T>
inline
unsigned
- tiled2d<T>::ncols() const
+ magick_tiled2d<T>::ncols() const
{
mln_precondition(this->is_valid());
return this->data_->b_.len(1);
@@ -536,7 +487,7 @@
template <typename T>
inline
const Magick::Image
- tiled2d<T>::buffer() const
+ magick_tiled2d<T>::buffer() const
{
mln_precondition(this->is_valid());
return this->data_->buffer_;
@@ -545,7 +496,7 @@
template <typename T>
inline
Magick::Image
- tiled2d<T>::buffer()
+ magick_tiled2d<T>::buffer()
{
mln_precondition(this->is_valid());
return this->data_->buffer_;
@@ -573,79 +524,79 @@
// pixter
template <typename T>
- struct fwd_pixter< tiled2d<T> >
+ struct fwd_pixter< magick_tiled2d<T> >
{
- typedef fwd_pixter2d< tiled2d<T> > ret;
+ typedef fwd_pixter2d< magick_tiled2d<T> > ret;
};
template <typename T>
- struct fwd_pixter< const tiled2d<T> >
+ struct fwd_pixter< const magick_tiled2d<T> >
{
- typedef fwd_pixter2d< const tiled2d<T> > ret;
+ typedef fwd_pixter2d< const magick_tiled2d<T> > ret;
};
template <typename T>
- struct bkd_pixter< tiled2d<T> >
+ struct bkd_pixter< magick_tiled2d<T> >
{
- typedef bkd_pixter2d< tiled2d<T> > ret;
+ typedef bkd_pixter2d< magick_tiled2d<T> > ret;
};
template <typename T>
- struct bkd_pixter< const tiled2d<T> >
+ struct bkd_pixter< const magick_tiled2d<T> >
{
- typedef bkd_pixter2d< const tiled2d<T> > ret;
+ typedef bkd_pixter2d< const magick_tiled2d<T> > ret;
};
// qixter
template <typename T, typename W>
- struct fwd_qixter< tiled2d<T>, W >
+ struct fwd_qixter< magick_tiled2d<T>, W >
{
- typedef dpoints_fwd_pixter< tiled2d<T> > ret;
+ typedef dpoints_fwd_pixter< magick_tiled2d<T> > ret;
};
template <typename T, typename W>
- struct fwd_qixter< const tiled2d<T>, W >
+ struct fwd_qixter< const magick_tiled2d<T>, W >
{
- typedef dpoints_fwd_pixter< const tiled2d<T> > ret;
+ typedef dpoints_fwd_pixter< const magick_tiled2d<T> > ret;
};
template <typename T, typename W>
- struct bkd_qixter< tiled2d<T>, W >
+ struct bkd_qixter< magick_tiled2d<T>, W >
{
- typedef dpoints_bkd_pixter< tiled2d<T> > ret;
+ typedef dpoints_bkd_pixter< magick_tiled2d<T> > ret;
};
template <typename T, typename W>
- struct bkd_qixter< const tiled2d<T>, W >
+ struct bkd_qixter< const magick_tiled2d<T>, W >
{
- typedef dpoints_bkd_pixter< const tiled2d<T> > ret;
+ typedef dpoints_bkd_pixter< const magick_tiled2d<T> > ret;
};
// nixter
template <typename T, typename N>
- struct fwd_nixter< tiled2d<T>, N >
+ struct fwd_nixter< magick_tiled2d<T>, N >
{
- typedef dpoints_fwd_pixter< tiled2d<T> > ret;
+ typedef dpoints_fwd_pixter< magick_tiled2d<T> > ret;
};
template <typename T, typename N>
- struct fwd_nixter< const tiled2d<T>, N >
+ struct fwd_nixter< const magick_tiled2d<T>, N >
{
- typedef dpoints_fwd_pixter< const tiled2d<T> > ret;
+ typedef dpoints_fwd_pixter< const magick_tiled2d<T> > ret;
};
template <typename T, typename N>
- struct bkd_nixter< tiled2d<T>, N >
+ struct bkd_nixter< magick_tiled2d<T>, N >
{
- typedef dpoints_bkd_pixter< tiled2d<T> > ret;
+ typedef dpoints_bkd_pixter< magick_tiled2d<T> > ret;
};
template <typename T, typename N>
- struct bkd_nixter< const tiled2d<T>, N >
+ struct bkd_nixter< const magick_tiled2d<T>, N >
{
- typedef dpoints_bkd_pixter< const tiled2d<T> > ret;
+ typedef dpoints_bkd_pixter< const magick_tiled2d<T> > ret;
};
} // end of namespace mln::trait
Index: trunk/milena/sandbox/fabien/mln/core/image/tiled2d.hh
===================================================================
--- trunk/milena/sandbox/fabien/mln/core/image/tiled2d.hh (revision 4420)
+++ trunk/milena/sandbox/fabien/mln/core/image/tiled2d.hh (revision 4421)
@@ -55,7 +55,6 @@
template <typename T>
struct data< tiled2d<T> >
{
-// data(const box2d& b, unsigned bdr);
data(const box2d& b, unsigned bdr);
~data();
@@ -145,17 +144,10 @@
/// Constructor without argument.
tiled2d();
- /// Constructor with the numbers of rows and columns and the
- /// border thickness.
- //tiled2d(int nrows, int ncols, unsigned bdr = border::thickness);
-
/// Constructor with a box and the border thickness (default is
/// 3).
tiled2d(const box2d& b, unsigned bdr = border::thickness);
- /// Constructor with a filename.
- //tiled2d(const std::string& filename);
-
/// Initialize an empty image.
void init_(const box2d& b, unsigned bdr = border::thickness);
@@ -234,12 +226,6 @@
// Hooks
- /// Give a hook to the value buffer.
- //const std::fstream* buffer() const;
-
- /// Give a hook to the value buffer.
- //std::fstream* buffer();
-
/// Give a hook to the offset for accessing data.
const std::streampos& pos_() const;
@@ -305,14 +291,6 @@
allocate_();
}
- /*template <typename T>
- inline
- data< tiled2d<T> >::data(const std::string& filename)
- {
- // FIXME
- //b_ = make::box2d(buffer_.rows(), buffer_.columns());
- }*/
-
template <typename T>
inline
data< tiled2d<T> >::~data()
@@ -335,18 +313,6 @@
data< tiled2d<T> >::allocate_()
{
update_vb_();
-// unsigned
-// nr = vb_.len(0),
-// nc = vb_.len(1);
-// buffer_ = new T[nr * nc];
-// array_ = new T*[nr];
-// T* buf = buffer_ - vb_.pmin().col();
-// for (unsigned i = 0; i < nr; ++i)
-// {
-// array_[i] = buf;
-// buf += nc;
-// }
-// array_ -= vb_.pmin().row();
mln_postcondition(vb_.len(0) == b_.len(0) + 2 * bdr_);
mln_postcondition(vb_.len(1) == b_.len(1) + 2 * bdr_);
}
@@ -408,22 +374,6 @@
this->data_->loaded_ = false;
}
- /*template <typename T>
- inline
- tiled2d<T>::tiled2d(const std::string& filename)
- {
- init_(filename);
- }
-
- template <typename T>
- inline
- void
- tiled2d<T>::init_(const std::string& filename)
- {
- mln_precondition(! this->is_valid());
- this->data_ = new internal::data< tiled2d<T> >(filename);
- }*/
-
template <typename T>
inline
const box2d&
@@ -513,10 +463,6 @@
{
mln_precondition(this->has(point2d(row, col)));
//FIXME: use the cache Luke.
- this->data_->pixel_cache = this->data_->buffer_.getPixels(col, row, col, row);
- this->data_->value_.red() = this->data_->pixel_cache->red % 256;
- this->data_->value_.green() = this->data_->pixel_cache->green % 256;
- this->data_->value_.blue() = this->data_->pixel_cache->blue % 256;
return this->data_->value_;
}
@@ -527,10 +473,6 @@
{
mln_precondition(this->has(point2d(row, col)));
//FIXME: use the cache Luke.
- this->data_->pixel_cache = this->data_->buffer_.getPixels(col, row, col, row);
- this->data_->value_.red() = this->data_->pixel_cache->red % 256;
- this->data_->value_.green() = this->data_->pixel_cache->green % 256;
- this->data_->value_.blue() = this->data_->pixel_cache->blue % 256;
return this->data_->value_;
}
@@ -555,24 +497,6 @@
// Hooks.
- /*template <typename T>
- inline
- const std::fstream*
- tiled2d<T>::buffer() const
- {
- mln_precondition(this->is_valid());
- return this->data_->f_;
- }
-
- template <typename T>
- inline
- std::fstream*
- tiled2d<T>::buffer()
- {
- mln_precondition(this->is_valid());
- return this->data_->f_;
- }*/
-
template <typename T>
inline
const std::streampos&
1
0
---
milena/ChangeLog | 4 ++++
milena/mln/win/multiple.hh | 13 +++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f40e949..60f3ad7 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-24 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ * mln/win/multiple.hh: Add a missing init_ member.
+
2009-08-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Small fixes.
diff --git a/milena/mln/win/multiple.hh b/milena/mln/win/multiple.hh
index f39a55e..a3632f5 100644
--- a/milena/mln/win/multiple.hh
+++ b/milena/mln/win/multiple.hh
@@ -145,6 +145,10 @@ namespace mln
void change_target(const multiple<W,F>& w); // Overridden to initialize size_.
+ /// Delegated initialization.
+ template <typename P>
+ void init_(const multiple<W,F>& w, const P& c);
+
/// Test the iterator validity.
bool is_valid_() const;
@@ -316,6 +320,15 @@ namespace mln
inline
multiple_qiter<W,F>::multiple_qiter(const multiple<W,F>& w, const P& c)
{
+ this->init_(w, c);
+ }
+
+ template <typename W, typename F>
+ template <typename P>
+ inline
+ void
+ multiple_qiter<W,F>::init_(const multiple<W,F>& w, const P& c)
+ {
this->center_at(c);
// We have to first change the center so that 'invalidate' can
// work when changing the target.
--
1.5.6.5
1
0
Re: [Olena-patches] 4396: Introduce mixed windows and neighborhood for graph images.
by Guillaume Lazzara 01 Sep '09
by Guillaume Lazzara 01 Sep '09
01 Sep '09
Roland Levillain wrote:
>
> Le 25 août 09 à 19:13, Guillaume Lazzara a écrit :
>
>> * mln/core/box_runstart_piter.hh,
>> * mln/core/dpsites_piter.hh,
>> * mln/core/image/complex_window_piter.hh: Add new init_() member.
>
> Is this new `init_()' member mandatory or is it just a shortcut?
>
Yes, it is now mandatory. I needed a shared member for all piter classes
to be able to call specific initialization routines.
>> + /// Delayed initialization.
>> + template <typename Pref>
>> + void init_(const Window<W>& win, const Pref& p_ref);
>> +
>
> Didn't you want to mean "Delegated initialization" instead of "Delayed
> initialization"?
Yes, that's probably a better description.
1
0