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
58888fcb
"python/vscode:/vscode.git/clone" did not exist on "8154de5a326f945b514a98d075361db95eadd6ad"
Commit
58888fcb
authored
Apr 28, 2018
by
Davis King
Browse files
Merged
parents
b95cb7d4
69b3894f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
dlib/image_loader/image_loader.h
dlib/image_loader/image_loader.h
+13
-9
No files found.
dlib/image_loader/image_loader.h
View file @
58888fcb
...
...
@@ -44,7 +44,7 @@ namespace dlib
unsigned
long
bfReserved
;
unsigned
long
biSize
;
unsigned
long
biWidth
;
unsigned
long
biHeight
;
long
biHeight
;
unsigned
short
biBitCount
;
unsigned
long
biCompression
;
/*
...
...
@@ -111,6 +111,10 @@ namespace dlib
a
=
buf
[
i
];
b
=
buf
[
i
+
1
];
c
=
buf
[
i
+
2
];
d
=
buf
[
i
+
3
];
biHeight
=
a
|
(
b
<<
8
)
|
(
c
<<
16
)
|
(
d
<<
24
);
bool
bottomUp
=
biHeight
<
0
;
if
(
bottomUp
)
biHeight
=
0
-
biHeight
;
i
+=
4
+
2
;
a
=
buf
[
i
];
b
=
buf
[
i
+
1
];
biBitCount
=
static_cast
<
unsigned
short
>
(
a
|
(
b
<<
8
));
...
...
@@ -216,7 +220,7 @@ namespace dlib
p
.
red
=
red
[
pixels
[
i
]];
p
.
green
=
green
[
pixels
[
i
]];
p
.
blue
=
blue
[
pixels
[
i
]];
assign_pixel
(
image
[
row
][
col
+
i
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
+
i
],
p
);
}
}
if
(
in
.
sgetn
(
reinterpret_cast
<
char
*>
(
buf
),
padding
)
!=
padding
)
...
...
@@ -281,14 +285,14 @@ namespace dlib
p
.
red
=
red
[
pixel1
];
p
.
green
=
green
[
pixel1
];
p
.
blue
=
blue
[
pixel1
];
assign_pixel
(
image
[
row
][
col
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
],
p
);
if
(
col
+
1
<
biWidth
)
{
p
.
red
=
red
[
pixel2
];
p
.
green
=
green
[
pixel2
];
p
.
blue
=
blue
[
pixel2
];
assign_pixel
(
image
[
row
][
col
+
1
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
+
1
],
p
);
}
}
if
(
in
.
sgetn
(
reinterpret_cast
<
char
*>
(
buf
),
padding
)
!=
padding
)
...
...
@@ -359,7 +363,7 @@ namespace dlib
p
.
red
=
red
[
buf
[
0
]];
p
.
green
=
green
[
buf
[
0
]];
p
.
blue
=
blue
[
buf
[
0
]];
assign_pixel
(
image
[
row
][
col
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
],
p
);
}
if
(
in
.
sgetn
(
reinterpret_cast
<
char
*>
(
buf
),
padding
)
!=
padding
)
throw
image_load_error
(
"bmp load error 9: file too short"
);
...
...
@@ -434,7 +438,7 @@ namespace dlib
p
.
red
=
red
[
buf
[
0
]];
p
.
green
=
green
[
buf
[
0
]];
p
.
blue
=
blue
[
buf
[
0
]];
assign_pixel
(
image
[
row
][
col
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
],
p
);
++
col
;
}
...
...
@@ -469,7 +473,7 @@ namespace dlib
p
.
red
=
red
[
command
];
p
.
green
=
green
[
command
];
p
.
blue
=
blue
[
command
];
assign_pixel
(
image
[
row
][
col
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
],
p
);
++
col
;
}
...
...
@@ -521,7 +525,7 @@ namespace dlib
p
.
red
=
buf
[
2
];
p
.
green
=
buf
[
1
];
p
.
blue
=
buf
[
0
];
assign_pixel
(
image
[
row
][
col
],
p
);
assign_pixel
(
image
[
bottomUp
?
biHeight
-
row
-
1
:
row
][
col
],
p
);
}
if
(
in
.
sgetn
(
reinterpret_cast
<
char
*>
(
buf
),
padding
)
!=
padding
)
...
...
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