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
580d90f0
Commit
580d90f0
authored
Aug 09, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some casts to avoid warnings in gcc 4.1.2
parent
aa4d7caa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
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
=
st
d
::
ceil
(
left_boundary
[
i
]
);
long
left_x
=
st
atic_cast
<
long
>
(
std
::
ceil
(
left_boundary
[
i
])
);
long
right_x
=
st
d
::
floor
(
right_boundary
[
i
]
);
long
right_x
=
st
atic_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
(
st
d
::
floor
(
left_boundary
[
i
]
),
i
+
top
);
const
point
p
(
st
atic_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
=
st
d
::
ceil
(
left_boundary
[
i
-
1
]
);
x
<
left_x
;
++
x
)
for
(
long
x
=
st
atic_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
=
st
d
::
ceil
(
left_boundary
[
i
-
1
]
);
const
long
old_left_x
=
st
atic_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
(
st
d
::
ceil
(
right_boundary
[
i
]
),
i
+
top
);
const
point
p
(
st
atic_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
=
st
d
::
floor
(
right_boundary
[
i
-
1
]
)
+
1
;
x
<=
right_x
;
++
x
)
for
(
long
x
=
st
atic_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
=
st
d
::
floor
(
right_boundary
[
i
-
1
]
);
const
long
old_right_x
=
st
atic_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