Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ed3c2522
Commit
ed3c2522
authored
May 29, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made get_pixel_intensity() more efficient.
parent
02bf1190
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
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 space and returns the intensity
- converts src to
grayscale 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
;
hsi_pixel
p
;
typename
pixel_traits
<
P
>::
basic_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
)
)
{
{
hsi_pixel
p
;
typename
pixel_traits
<
P
>::
basic_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