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
5f7007cf
Commit
5f7007cf
authored
Feb 11, 2015
by
Davis King
Browse files
Fixed sub_image() so it works properly with nested sub-images.
parent
5fa13921
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
dlib/image_transforms/interpolation.h
dlib/image_transforms/interpolation.h
+2
-2
No files found.
dlib/image_transforms/interpolation.h
View file @
5f7007cf
...
@@ -49,13 +49,13 @@ namespace dlib
...
@@ -49,13 +49,13 @@ namespace dlib
inline
void
*
image_data
(
sub_image_proxy
<
T
>&
img
)
inline
void
*
image_data
(
sub_image_proxy
<
T
>&
img
)
{
{
typedef
typename
image_traits
<
T
>::
pixel_type
pixel_type
;
typedef
typename
image_traits
<
T
>::
pixel_type
pixel_type
;
return
static_cast
<
pixel_type
*>
(
image_data
(
img
.
img
)
)
+
img
.
rect
.
left
()
+
img
.
rect
.
top
()
*
num_columns
(
img
.
img
);
return
(
char
*
)
image_data
(
img
.
img
)
+
sizeof
(
pixel_type
)
*
img
.
rect
.
left
()
+
img
.
rect
.
top
()
*
width_step
(
img
);
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
const
void
*
image_data
(
const
sub_image_proxy
<
T
>&
img
)
inline
const
void
*
image_data
(
const
sub_image_proxy
<
T
>&
img
)
{
{
typedef
typename
image_traits
<
T
>::
pixel_type
pixel_type
;
typedef
typename
image_traits
<
T
>::
pixel_type
pixel_type
;
return
static_cast
<
const
pixel_type
*>
(
image_data
(
img
.
img
)
)
+
img
.
rect
.
left
()
+
img
.
rect
.
top
()
*
num_columns
(
img
.
img
);
return
(
const
char
*
)
image_data
(
img
.
img
)
+
sizeof
(
pixel_type
)
*
img
.
rect
.
left
()
+
img
.
rect
.
top
()
*
width_step
(
img
);
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
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