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
60a19cfb
Commit
60a19cfb
authored
Jun 04, 2011
by
Davis King
Browse files
Made the conversion to and from HSI a little more robust.
parent
611cbfaa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
dlib/pixel.h
dlib/pixel.h
+9
-9
No files found.
dlib/pixel.h
View file @
60a19cfb
...
...
@@ -841,9 +841,9 @@ namespace dlib
h
.
l
=
src
.
i
/
255.0
;
c
=
HSL2RGB
(
h
);
dest
.
red
=
static_cast
<
unsigned
char
>
(
c
.
r
*
255.0
);
dest
.
green
=
static_cast
<
unsigned
char
>
(
c
.
g
*
255.0
);
dest
.
blue
=
static_cast
<
unsigned
char
>
(
c
.
b
*
255.0
);
dest
.
red
=
static_cast
<
unsigned
char
>
(
c
.
r
*
255.0
+
0.5
);
dest
.
green
=
static_cast
<
unsigned
char
>
(
c
.
g
*
255.0
+
0.5
);
dest
.
blue
=
static_cast
<
unsigned
char
>
(
c
.
b
*
255.0
+
0.5
);
}
// -----------------------------
...
...
@@ -895,9 +895,9 @@ namespace dlib
h
.
l
=
src
.
i
/
255.0
;
c
=
HSL2RGB
(
h
);
dest
.
red
=
static_cast
<
unsigned
char
>
(
c
.
r
*
255.0
);
dest
.
green
=
static_cast
<
unsigned
char
>
(
c
.
g
*
255.0
);
dest
.
blue
=
static_cast
<
unsigned
char
>
(
c
.
b
*
255.0
);
dest
.
red
=
static_cast
<
unsigned
char
>
(
c
.
r
*
255.0
+
0.5
);
dest
.
green
=
static_cast
<
unsigned
char
>
(
c
.
g
*
255.0
+
0.5
);
dest
.
blue
=
static_cast
<
unsigned
char
>
(
c
.
b
*
255.0
+
0.5
);
dest
.
alpha
=
255
;
}
...
...
@@ -934,9 +934,9 @@ namespace dlib
c1
.
b
=
src
.
blue
/
255.0
;
c2
=
RGB2HSL
(
c1
);
dest
.
h
=
static_cast
<
unsigned
char
>
(
c2
.
h
/
360.0
*
255.0
);
dest
.
s
=
static_cast
<
unsigned
char
>
(
c2
.
s
*
255.0
);
dest
.
i
=
static_cast
<
unsigned
char
>
(
c2
.
l
*
255.0
);
dest
.
h
=
static_cast
<
unsigned
char
>
(
c2
.
h
/
360.0
*
255.0
+
0.5
);
dest
.
s
=
static_cast
<
unsigned
char
>
(
c2
.
s
*
255.0
+
0.5
);
dest
.
i
=
static_cast
<
unsigned
char
>
(
c2
.
l
*
255.0
+
0.5
);
}
template
<
typename
P1
,
typename
P2
>
...
...
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