Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
ed3c2522
Commit
ed3c2522
authored
May 29, 2011
by
Davis King
Browse files
Made get_pixel_intensity() more efficient.
parent
02bf1190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
dlib/pixel.h
dlib/pixel.h
+5
-5
No files found.
dlib/pixel.h
View file @
ed3c2522
...
@@ -237,7 +237,7 @@ namespace dlib
...
@@ -237,7 +237,7 @@ namespace dlib
- if (pixel_traits<P>::grayscale == true) then
- if (pixel_traits<P>::grayscale == true) then
- returns src
- returns src
- else
- else
- converts src to
the HSI color spac
e and returns the
intensity
- converts src to
grayscal
e and returns the
resulting value.
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -1043,9 +1043,9 @@ namespace dlib
...
@@ -1043,9 +1043,9 @@ namespace dlib
{
{
P
temp
=
src
;
P
temp
=
src
;
temp
.
alpha
=
255
;
temp
.
alpha
=
255
;
h
si_pixel
p
;
typename
pixel_traits
<
P
>::
ba
si
c
_pixel
_type
p
;
assign_pixel
(
p
,
temp
);
assign_pixel
(
p
,
temp
);
return
static_cast
<
typename
pixel_traits
<
P
>::
basic_pixel_type
>
(
p
.
i
)
;
return
p
;
}
}
template
<
template
<
...
@@ -1057,9 +1057,9 @@ namespace dlib
...
@@ -1057,9 +1057,9 @@ namespace dlib
const
P
&
src
const
P
&
src
)
)
{
{
h
si_pixel
p
;
typename
pixel_traits
<
P
>::
ba
si
c
_pixel
_type
p
;
assign_pixel
(
p
,
src
);
assign_pixel
(
p
,
src
);
return
static_cast
<
typename
pixel_traits
<
P
>::
basic_pixel_type
>
(
p
.
i
)
;
return
p
;
}
}
template
<
template
<
...
...
Write
Preview
Markdown
is supported
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