Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
olena
Commits
f7773bdb
Commit
f7773bdb
authored
Dec 14, 2009
by
Guillaume Lazzara
Browse files
Add rbg_to_int_u function.
* mln/fun/v2v/all.hh: Include the new header. * mln/fun/v2v/rgb_to_int_u.hh: New.
parent
97aadbd7
Changes
3
Hide whitespace changes
Inline
Side-by-side
milena/ChangeLog
View file @
f7773bdb
2009-12-14 Guillaume Lazzara <z@lrde.epita.fr>
Add rbg_to_int_u function.
* mln/fun/v2v/all.hh: Include the new header.
* mln/fun/v2v/rgb_to_int_u.hh: New.
2009-12-14 Guillaume Lazzara <z@lrde.epita.fr>
Add an antialiased subsampling.
milena/mln/fun/v2v/all.hh
View file @
f7773bdb
...
...
@@ -60,6 +60,7 @@ namespace mln
# include <mln/fun/v2v/linear.hh>
# include <mln/fun/v2v/norm.hh>
# include <mln/fun/v2v/projection.hh>
# include <mln/fun/v2v/rgb_to_int_u.hh>
//<<lrde
# include <mln/fun/v2v/rgb_to_hsi.hh>
# include <mln/fun/v2v/rgb_to_hsl.hh>
...
...
milena/mln/fun/v2v/rgb_to_int_u.hh
0 → 100644
View file @
f7773bdb
// 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_FUN_V2V_RGB_TO_INT_U_HH
# define MLN_FUN_V2V_RGB_TO_INT_U_HH
namespace
mln
{
namespace
fun
{
namespace
v2v
{
template
<
unsigned
n
>
struct
rgb_to_int_u
:
Function_v2v
<
rgb_to_int_u
<
n
>
>
{
typedef
value
::
int_u
<
n
>
result
;
result
operator
()(
const
value
::
rgb
<
n
>&
c
)
const
;
};
# ifndef MLN_INCLUDE_ONLY
template
<
unsigned
n
>
typename
rgb_to_int_u
<
n
>::
result
rgb_to_int_u
<
n
>::
operator
()(
const
value
::
rgb
<
n
>&
c
)
const
{
return
(
c
.
red
()
+
c
.
green
()
+
c
.
blue
())
/
3
;
}
# endif // ! MLN_INCLUDE_ONLY
}
// end of namespace mln::fun::v2v
}
// end of namespace mln::fun
}
// end of namespace mln
#endif // ! MLN_FUN_V2V_RGB_TO_INT_U_HH
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment