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
36a0776a
Commit
36a0776a
authored
Aug 05, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sutr90-lab_pixel'
parents
8c037c3c
83324898
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
4 deletions
+36
-4
save_png.h
dlib/image_saver/save_png.h
+2
-2
matrix_utilities.h
dlib/matrix/matrix_utilities.h
+34
-2
pixel.h
dlib/pixel.h
+0
-0
pixel.cpp
dlib/test/pixel.cpp
+0
-0
No files found.
dlib/image_saver/save_png.h
View file @
36a0776a
...
...
@@ -80,9 +80,9 @@ namespace dlib
impl
::
impl_save_png
(
file_name
,
row_pointers
,
img
.
nc
(),
impl
::
png_type_rgb_alpha
,
8
);
}
else
if
(
pixel_traits
<
pixel_type
>::
hsi
||
pixel_traits
<
pixel_type
>::
rgb
)
else
if
(
pixel_traits
<
pixel_type
>::
lab
||
pixel_traits
<
pixel_type
>::
hsi
||
pixel_traits
<
pixel_type
>::
rgb
)
{
// convert from HSI to RGB (Or potentially RGB pixels that aren't laid out as R G B)
// convert from
Lab or
HSI to RGB (Or potentially RGB pixels that aren't laid out as R G B)
array2d
<
rgb_pixel
>
temp_img
;
assign_image
(
temp_img
,
img_
);
for
(
unsigned
long
i
=
0
;
i
<
row_pointers
.
size
();
++
i
)
...
...
dlib/matrix/matrix_utilities.h
View file @
36a0776a
...
...
@@ -2573,7 +2573,8 @@ namespace dlib
pixel_traits
<
P
>::
grayscale
,
pixel_traits
<
P
>::
rgb
,
pixel_traits
<
P
>::
hsi
,
pixel_traits
<
P
>::
rgb_alpha
pixel_traits
<
P
>::
rgb_alpha
,
pixel_traits
<
P
>::
lab
>::
value
>
struct
pixel_to_vector_helper
;
...
...
@@ -2637,6 +2638,21 @@ namespace dlib
}
};
template
<
typename
P
>
struct
pixel_to_vector_helper
<
P
,
5
>
{
template
<
typename
M
>
static
void
assign
(
M
&
m
,
const
P
&
pixel
)
{
m
(
0
)
=
static_cast
<
typename
M
::
type
>
(
pixel
.
l
);
m
(
1
)
=
static_cast
<
typename
M
::
type
>
(
pixel
.
a
);
m
(
2
)
=
static_cast
<
typename
M
::
type
>
(
pixel
.
b
);
}
};
template
<
typename
T
,
...
...
@@ -2660,7 +2676,8 @@ namespace dlib
pixel_traits
<
P
>::
grayscale
,
pixel_traits
<
P
>::
rgb
,
pixel_traits
<
P
>::
hsi
,
pixel_traits
<
P
>::
rgb_alpha
pixel_traits
<
P
>::
rgb_alpha
,
pixel_traits
<
P
>::
lab
>::
value
>
struct
vector_to_pixel_helper
;
...
...
@@ -2724,6 +2741,21 @@ namespace dlib
}
};
template
<
typename
P
>
struct
vector_to_pixel_helper
<
P
,
5
>
{
template
<
typename
M
>
static
void
assign
(
P
&
pixel
,
const
M
&
m
)
{
pixel
.
l
=
static_cast
<
unsigned
char
>
(
m
(
0
));
pixel
.
a
=
static_cast
<
unsigned
char
>
(
m
(
1
));
pixel
.
b
=
static_cast
<
unsigned
char
>
(
m
(
2
));
}
};
template
<
typename
P
,
typename
EXP
...
...
dlib/pixel.h
View file @
36a0776a
This diff is collapsed.
Click to expand it.
dlib/test/pixel.cpp
View file @
36a0776a
This diff is collapsed.
Click to expand it.
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