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
580d90f0
"git@developer.sourcefind.cn:OpenDAS/dlib.git" did not exist on "4681209e19b5cd92fb68a34261f460a3408ae410"
Commit
580d90f0
authored
Aug 09, 2011
by
Davis King
Browse files
Added some casts to avoid warnings in gcc 4.1.2
parent
aa4d7caa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
dlib/gui_widgets/canvas_drawing.h
dlib/gui_widgets/canvas_drawing.h
+8
-8
No files found.
dlib/gui_widgets/canvas_drawing.h
View file @
580d90f0
...
@@ -564,8 +564,8 @@ namespace dlib
...
@@ -564,8 +564,8 @@ namespace dlib
// draw the polygon row by row
// draw the polygon row by row
for
(
unsigned
long
i
=
top_offset
;
i
<
left_boundary
.
size
();
++
i
)
for
(
unsigned
long
i
=
top_offset
;
i
<
left_boundary
.
size
();
++
i
)
{
{
long
left_x
=
std
::
ceil
(
left_boundary
[
i
]);
long
left_x
=
static_cast
<
long
>
(
std
::
ceil
(
left_boundary
[
i
])
)
;
long
right_x
=
std
::
floor
(
right_boundary
[
i
]);
long
right_x
=
static_cast
<
long
>
(
std
::
floor
(
right_boundary
[
i
])
)
;
left_x
=
max
(
left_x
,
valid_area
.
left
());
left_x
=
max
(
left_x
,
valid_area
.
left
());
right_x
=
min
(
right_x
,
valid_area
.
right
());
right_x
=
min
(
right_x
,
valid_area
.
right
());
...
@@ -591,7 +591,7 @@ namespace dlib
...
@@ -591,7 +591,7 @@ namespace dlib
{
{
if
(
std
::
floor
(
left_boundary
[
i
])
!=
left_x
)
if
(
std
::
floor
(
left_boundary
[
i
])
!=
left_x
)
{
{
const
point
p
(
std
::
floor
(
left_boundary
[
i
]),
i
+
top
);
const
point
p
(
static_cast
<
long
>
(
std
::
floor
(
left_boundary
[
i
])
)
,
i
+
top
);
rgb_alpha_pixel
temp
=
alpha_pixel
;
rgb_alpha_pixel
temp
=
alpha_pixel
;
temp
.
alpha
=
max_alpha
-
static_cast
<
unsigned
char
>
((
left_boundary
[
i
]
-
p
.
x
())
*
max_alpha
);
temp
.
alpha
=
max_alpha
-
static_cast
<
unsigned
char
>
((
left_boundary
[
i
]
-
p
.
x
())
*
max_alpha
);
if
(
valid_area
.
contains
(
p
))
if
(
valid_area
.
contains
(
p
))
...
@@ -600,7 +600,7 @@ namespace dlib
...
@@ -600,7 +600,7 @@ namespace dlib
}
}
else
if
(
delta
<
0
)
// on the bottom side
else
if
(
delta
<
0
)
// on the bottom side
{
{
for
(
long
x
=
std
::
ceil
(
left_boundary
[
i
-
1
]);
x
<
left_x
;
++
x
)
for
(
long
x
=
static_cast
<
long
>
(
std
::
ceil
(
left_boundary
[
i
-
1
])
)
;
x
<
left_x
;
++
x
)
{
{
const
point
p
(
x
,
i
+
top
);
const
point
p
(
x
,
i
+
top
);
rgb_alpha_pixel
temp
=
alpha_pixel
;
rgb_alpha_pixel
temp
=
alpha_pixel
;
...
@@ -611,7 +611,7 @@ namespace dlib
...
@@ -611,7 +611,7 @@ namespace dlib
}
}
else
// on the top side
else
// on the top side
{
{
const
long
old_left_x
=
std
::
ceil
(
left_boundary
[
i
-
1
]);
const
long
old_left_x
=
static_cast
<
long
>
(
std
::
ceil
(
left_boundary
[
i
-
1
])
)
;
for
(
long
x
=
left_x
;
x
<
old_left_x
;
++
x
)
for
(
long
x
=
left_x
;
x
<
old_left_x
;
++
x
)
{
{
const
point
p
(
x
,
i
+
top
-
1
);
const
point
p
(
x
,
i
+
top
-
1
);
...
@@ -629,7 +629,7 @@ namespace dlib
...
@@ -629,7 +629,7 @@ namespace dlib
{
{
if
(
std
::
ceil
(
right_boundary
[
i
])
!=
right_x
)
if
(
std
::
ceil
(
right_boundary
[
i
])
!=
right_x
)
{
{
const
point
p
(
std
::
ceil
(
right_boundary
[
i
]),
i
+
top
);
const
point
p
(
static_cast
<
long
>
(
std
::
ceil
(
right_boundary
[
i
])
)
,
i
+
top
);
rgb_alpha_pixel
temp
=
alpha_pixel
;
rgb_alpha_pixel
temp
=
alpha_pixel
;
temp
.
alpha
=
max_alpha
-
static_cast
<
unsigned
char
>
((
p
.
x
()
-
right_boundary
[
i
])
*
max_alpha
);
temp
.
alpha
=
max_alpha
-
static_cast
<
unsigned
char
>
((
p
.
x
()
-
right_boundary
[
i
])
*
max_alpha
);
if
(
valid_area
.
contains
(
p
))
if
(
valid_area
.
contains
(
p
))
...
@@ -638,7 +638,7 @@ namespace dlib
...
@@ -638,7 +638,7 @@ namespace dlib
}
}
else
if
(
delta
<
0
)
// on the top side
else
if
(
delta
<
0
)
// on the top side
{
{
for
(
long
x
=
std
::
floor
(
right_boundary
[
i
-
1
])
+
1
;
x
<=
right_x
;
++
x
)
for
(
long
x
=
static_cast
<
long
>
(
std
::
floor
(
right_boundary
[
i
-
1
])
)
+
1
;
x
<=
right_x
;
++
x
)
{
{
const
point
p
(
x
,
i
+
top
-
1
);
const
point
p
(
x
,
i
+
top
-
1
);
rgb_alpha_pixel
temp
=
alpha_pixel
;
rgb_alpha_pixel
temp
=
alpha_pixel
;
...
@@ -649,7 +649,7 @@ namespace dlib
...
@@ -649,7 +649,7 @@ namespace dlib
}
}
else
// on the bottom side
else
// on the bottom side
{
{
const
long
old_right_x
=
std
::
floor
(
right_boundary
[
i
-
1
]);
const
long
old_right_x
=
static_cast
<
long
>
(
std
::
floor
(
right_boundary
[
i
-
1
])
)
;
for
(
long
x
=
right_x
+
1
;
x
<=
old_right_x
;
++
x
)
for
(
long
x
=
right_x
+
1
;
x
<=
old_right_x
;
++
x
)
{
{
const
point
p
(
x
,
i
+
top
);
const
point
p
(
x
,
i
+
top
);
...
...
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